freetype-devel
[Top][All Lists]
Advanced

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

Handling of OTTO/CFF CIDFonts


From: Chris Liddell
Subject: Handling of OTTO/CFF CIDFonts
Date: Mon, 13 Dec 2021 17:17:31 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Hello Werner and all,

We've encountered a problem with our use of Freetype in mupdf.

We have a PDF with an embedded OTTO/CFF font that is used as a CIDFont
in the PDF.

Now, the way CIDFonts work in PDF is that the character code is mapped
through the PDF CMap, to get a "glyph index".

In the case of a font with TrueType outlines, that is the GID of the
glyph, so the TTF/OTTO cmap tables are ignored.

In the case of a font with CFF outlines, the "glyph index" should still
be mapped through the CFF Charset.

The problem we've is that, for a CFF CIDFont that comes from an OTTO
font, Freetype does not build the inverted Charset lookup that would be
used when we render glyphs.

This is all centred around:

cff_font_load() (with the "pure_cff" parameter)
cff_charset_load() (with the "invert" parameter)

and

cff_slot_load()


Basically, it looks like we need a way to tell freetype to still treat
the CFF fibt as a CIDFont, even if it started life as an OTTO. Now I
believe, in theory, the Charset and cmap table mappings are supposed to
be the same, but that is not always the case, so we can't rely on that
assumption.

So, firstly: Are we missing something obvious (or less obvious) that
would allow us to solve the problem?

Secondly, if not, do you have any suggestions/preferences about how to
solve it? We were thinking of something like an
"FT_PARAM_TAG_IGNORE_OTTO_FEATURES" parameter flag or similar, but don't
want to embark on that in case you folks have an approach you'd prefer.

Thanks,

Chris



reply via email to

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