possible bug win32 font metrics
Lynn Neir <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <F85A5683C7A97040826AE82D00E14CD00563957D@TK5EX14MBXC284.redmond.corp.microsoft.com> |
Hello, I was debugging into method _cairo_win32_scaled_font_set_metrics (cairo-win32-font.c) and I'm trying to figure out the logic. It seems when preserve_axes is true (which it is for 0 and 90 rotations) then regardless of hint metrics setting it always follows the first path that does hinting. In another method _cairo_win32_scaled_font_init_glyph_metrics, it does something different. It seems like the code in _cairo_win32_scaled_font_set_metrics should match logic in _cairo_win32_scaled_font_init_glyph_metrics. I guess I also don't understand this 'preserve_axis' logic and why hint metrics setting is basically ignored in current code below.
Current code:
static cairo_status_t
_cairo_win32_scaled_font_set_metrics (cairo_win32_scaled_font_t *scaled_font)
{
cairo_status_t status;
cairo_font_extents_t extents;
TEXTMETRIC metrics;
HDC hdc;
hdc = _get_global_font_dc ();
assert (hdc != NULL);
if (scaled_font->preserve_axes || scaled_font->base.options.hint_metrics == CAIRO_HINT_METRICS_OFF) {
/* For 90-degree rotations (including 0), we get the metrics
* from the GDI in logical space, then convert back to font space
*/
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
...
Proposed change???:
static cairo_status_t
_cairo_win32_scaled_font_set_metrics (cairo_win32_scaled_font_t *scaled_font)
{
cairo_status_t status;
cairo_font_extents_t extents;
TEXTMETRIC metrics;
HDC hdc;
hdc = _get_global_font_dc ();
assert (hdc != NULL);
if (scaled_font->preserve_axes && scaled_font->base.options.hint_metrics != CAIRO_HINT_METRICS_OFF) {
/* For 90-degree rotations (including 0), we get the metrics
* from the GDI in logical space, then convert back to font space
*/
status = cairo_win32_scaled_font_select_font (&scaled_font->base, hdc);
....
Thanks for your help,
Lynn
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo