[cairo] freetype backend: ignore global advace if required
Owen Taylor
otaylor at redhat.com
Mon Aug 22 09:52:04 PDT 2005
On Sat, 2005-08-13 at 18:10 +0800, sunmoon1997 wrote:
> hi,
> This small patch adds FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH to load
> flags if required, otherwise the spacing of CJK mono font become too
> large. In details, you can see attached images.
My understanding is that this flag applies particularly to fonts that
have the isFixedPitch flag set in the 'post' table, which is documented
as:
ULONG isFixedPitch Set to 0 if the font is proportionally spaced,
non-zero if the font is not proportionally spaced (i.e.
monospaced).
But have both single-width and double-width characters instead of
having all characters the same width. The FreeType docs read:
FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
Indicates that the glyph loader should ignore the global advance
width defined in the font. For historical reasons (to support
buggy CJK fonts), FreeType uses the value of the
`advanceWidthMax' field in the `htmx' table for all glyphs if the
font is monospaced. Activating this flags makes FreeType use the
metric values given in the `htmx' table.
The two questions are:
- How common are fonts that set isFixedPitch but have multiple
character widths?
- How common are fonts that have a correct advanceWidthMax but
buggy advances for individual characters?
If the second group is much bigger than the first group, then
your patch is right ... we should default to not setting
the FreeType flag. If the first group is bigger than the second
group, the default should go the other way.
I think the first group is actually the one that conforms to
the TrueType spec.
I've never actually seen a font in either group...
Regards,
Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050822/d19803b4/attachment-0001.pgp
More information about the cairo
mailing list