Bug 96357 - Incorrect cache algorithm in _cairo_ft_unscaled_font_set_scale
Summary: Incorrect cache algorithm in _cairo_ft_unscaled_font_set_scale
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: freetype font backend (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: David Turner
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-03 15:01 UTC by Joshua Granick
Modified: 2018-08-25 14:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Joshua Granick 2016-06-03 15:01:59 UTC
The `_cairo_ft_unscaled_font_set_scale` method has an incorrect method of detecting whether it needs to call FT_Set_Char_Size to resize a glyph.

Use font APIs with different matrix values multiple text API calls with different cairo_matrix_t values (but a constant font size) is one example that breaks. Glyphs will be rendered with mixed sizes as a result. This also can occur if other libraries referencing the shared FT_Face, such as using harfbuzz together with cairo.

Commenting the following code (lines 811-816 in cairo 1.15.2) temporarily resolves the problem:

    if (unscaled->have_scale &&
    scale->xx == unscaled->current_scale.xx &&
    scale->yx == unscaled->current_scale.yx &&
    scale->xy == unscaled->current_scale.xy &&
    scale->yy == unscaled->current_scale.yy)
    return CAIRO_STATUS_SUCCESS;

It would be ideal determine what is needed to fix this calculation. Thank you!
Comment 1 Joshua Granick 2016-06-03 15:02:47 UTC
I apologize I forgot to mention, this code is in "cairo-ft-font.c", thank you again
Comment 2 GitLab Migration User 2018-08-25 14:02:31 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/325.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.