freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] Prevent synthesis of Unicode charmap?


From: Antony Lee
Subject: Re: [ft] Prevent synthesis of Unicode charmap?
Date: Tue, 4 Dec 2018 11:35:59 +0100

>
> > In practice, right now we just look up a charmap with either
> > TT_ADOBE_ID_STANDARD or TT_ADOBE_ID_CUSTOM encoding, which
> > essentially works, but having a way to distinguish the actual
> > font-provided charmap from the FreeType-synthesized one seems
> > cleaner.
>
> Up to now nobody has asked for such a feature.  Can you give a short
> outline what you would like FreeType to provide?
>

Given that Matplotlib will need to support not-too-recent versions of
FreeType at least for a while, I think just clarifying the documentation
may be sufficient, e.g. replacing (in the docs for FT_Encoding)

"By default, FreeType enables a Unicode charmap and tags it with
FT_ENCODING_UNICODE when it is either provided or can be generated from
PostScript glyph name dictionaries in the font file."

by something like

"When loading a font, FreeType will make a Unicode charmap active if
possible (either when the font provides such a charmap, or if FreeType can
synthesize one from PostScript glyph name dictionaries; in either case, the
charmap is tagged with FT_ENCODING_UNICODE).  If such a charmap is
synthesized, it will be placed at the first position of the charmap
array."  (Assuming this behavior can be relied on.)

(I guess in the current wording, "by default" refers to the enabling of the
charmap, (which can be changed) but until your reply I thought it referred
to the synthesis (which cannot actually be changed).  The new wording
hopefully makes it clearer that synthesis is not togglable and improves
one's chances to identify the synthesized charmap.)

Alternatively, perhaps the synthesis of the charmap could be completely
toggled off using a new params entry in FT_Open_Args, but perhaps that's a
bit overkill or too specialized to be worth an API addition.

Regards,

Antony


reply via email to

[Prev in Thread] Current Thread [Next in Thread]