Draft: DWrite: handle hint style option in get glyph path
This is to fix #611 (closed).
_cairo_dwrite_scaled_font_init_glyph_path
does not handle the HINT_STYLE option. As GetGlyphRunOutline
only takes a height and returns a hinted outline, I've copied the behavior for of cairo-win32-font:
- If HINT_STYLE_NONE, get the outline at em scaled and transform by font_scale * 1/em
- Otherwise use the computed transform function from cairo-win32-font to compute a logical size to call
GetGlyphRunOutline
with then transform by font_scale * 1/logical_size.
Marked as draft as I'm not sure it I should use the compute transform in cairo-win32-font (as I have done in this MR) which also requires storing all the computed parameters. Or just copy the _cairo_matrix_compute_basis_scale_factors
code from compute transform.
I also noticed that _cairo_dwrite_scaled_font_init_glyph_metrics
is not handling the HINT_METRICS font options. We may need to copy the win32-font behavior for this as well.
In addition to the test case in #611 (closed), I also used this test program: glyph-metrics.c
@fujii.hironori could you review this?