[Bug 891457] uneven emulated Bold/Slant for subsetted large fonts

bugzilla at redhat.com bugzilla at redhat.com
Mon Jan 14 05:10:44 UTC 2013

Product: Fedora

--- Comment #23 from Hin-Tak Leung <htl10 at users.sourceforge.net> ---
(In reply to comment #21)
> (In reply to comment #20)
> Since cairo_text_path produced the correct output the next idea I had was to
> try changing the size of the font outlines that cairo-type1-fallback
> requests. At line 105 the matrix size is set to 1000 since Type 1 fonts have
> an EM grid size of 1000. I changed this to 500 and the output was smaller
> but correct. I tried some different values. 800 works. 900 fails. So
> somewhere between a font size of 800 and 900 FreeType starts producing
> incorrect output for some glyphs with synthetic bold enabled.

That looks like a magic number that can be changed everywhere, for cleanliness,
at least:

$ grep -n 1000 src/*fallback*
src/cairo-type1-fallback.c:105:    cairo_matrix_init_scale (&font_matrix, 1000,
src/cairo-type1-fallback.c:752:    type1_subset->widths[i] =
src/cairo-type1-fallback.c:754:    type1_subset->x_min   =
src/cairo-type1-fallback.c:755:    type1_subset->y_min   =
src/cairo-type1-fallback.c:756:    type1_subset->x_max   =
src/cairo-type1-fallback.c:757:    type1_subset->y_max   =
src/cairo-type1-fallback.c:758:    type1_subset->ascent  =
src/cairo-type1-fallback.c:759:    type1_subset->descent =

I Haven't tried, but I think it should work by replacing every "1000" with
"800" - since the code basically scale glyph co-ordinates up to x1000 then
round to integer. That does not answer why 1000 fails but 800 works though.

You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=JqmauBt0Ym&a=cc_unsubscribe

More information about the fonts-bugs mailing list