[scribus-dev] GSoC Updates
Pierre Marchand
pierremarc at oep-h.com
Thu Jul 2 18:02:07 CEST 2009
Vous (Thach Tran) avez écrit :
> Hi,
>
> I have solved the TrueType embedding problem in PDF/X-4. What I did is
> I embedded it as a Type0 font (CID font).
I finally found time to read your code and think a bit more about it? I must
say I’m not exactly excited by tricking the font type.
After looking again at PDF ref. (1.3) I would suggest to do things the simple
way. As in following instructions given for TrueType fonts regarding encoding
(p. 307 and ff). First of all, it’s clearly stated that Differences array is
not recommended for TT fonts, so nothing new in fact. p. 310 gives us 3
possibilities to map char code as found in strings to glyph index. None of
them is impossible to use inside the Scribus pdflib. What we need is to add
few methods to ScFace_ttf in order to check the presence of platform/encoding
pairs, and maybe check the validity of the cmap table. Plus, we want to check
if the glyph index we get through AGL leads to the same index as selected by
Freetype for the very same codepoint.
Case 1, all is fine, got the right platform/encoding, got good indexes for
charcodes, etc, we embed the font as is and that’s it (well, write the correct
Font dictionary:)
Case 2, there’s no cmap with 3/1 or 1/0, I would tend to not embedded the TT
font at this point. Means outline it in a Type3.
Case 3, glyph indexes as returned by AGL are not the same as returned by
Freetype: a) if there’s a cmap 1/0, check if possible to follow same
instructions as for symbolics fonts (no Encoding dictionary at all) b) else,
outline again.
I haven’t considered the possibility to alter the string itself to fit in a
particular encoding. You can explore it but really it would be nice to achieve
clean embedding without hack elsewhere :)
This work would benefit generally for TTF embedding and I’ll be available to
help writing or write myself needed methods in ScFace.
What do you think?
--
Pierre Marchand
http://www.oep-h.com
More information about the scribus-dev
mailing list