[pdftex] Re: font strategy in pdftex
Kuznetsov A,V.
kuzn at htsc.mephi.ru
Wed Feb 14 13:16:05 CET 2001
The discussed problem must be made more exact as follows.
To reduce pdf-document size, one uses 14 standard fonts
which can be scaled to any size. However at big and small sizes
scaled fonts look bad. More correct transformation should
consist of scaling and extending of small/big fonts.
My example represents Times-Roman fonts with set of extensions
used in cmr fonts. However, when correct transformation is
used, font strategy became very important (see comments below).
Mark A. Wikcs wrote
> I am not a pdftex developer, but I think I understand the problem
> pretty well. You are correct that Tz can change the horizontal scaling to
> implement ExtendFont, but that doesn't solve the more general problem.
> What about SlantFont, for example? If I recall correctly, PDF, unlike
> PostScript, does not allow the font matrix to be modified on the fly.
> The slant of the font is determined from the font matrix contained in the
> embedded font. I believe that the only way to change the font matrix is to
> re-embed a new copy of the font using different font matrix for each
> instance, and that's apparently what pdftex is doing.
Yes, extended and slanted fonts are different cases in pdf, therefore
slanted font should be embedded. But when one adds to my example similar
set of slanted fonts with different extensions for different sizes,
13 fonts will be embedded. Whereas only a single slanted font
is really needed. If one adds Helvetica in the same manner,
26 fonts will be embedded, but only two of them are needed. When one uses
virtual font with Latin part from standard fonts and, for example, Cyrillic
part from nonstandard fonts, 52 fonts will be embedded and only
6 are needed...... Number of fonts proliferates very quickly.
Mark A. Wikcs wrote
> Dvipdfm and Distiller handle this by modifying the graphics state
> rather than the text state. Having implemented this in dvipdfm, I know
> that this is very difficult to get right (I'll explain the issues to
> anybody who wants to know), and it produces some unnatural looking PDF
> output streams. However, it does produce the right result and allows the
> font to be embedded only once.
So a way towards the correct font strategy exists.
Han The Thanh wrote
> in the early days of pdftex, I used to change the graphic state matrix to
> emulate FontExtend and FontSlant, so it could be used for truetype fonts as
> well. Afterward, when experimenting with hz-opt, I found it too
> problematic to do it this way. So I switched to changing the FontMatrix of
> Type1 font instead. This causes the output larger and avoids
> extending/slanting truetype fonts, but also makes the implementation
> cleaner and easier to extend, especially when playing with the hz-opt.
I think, the main problem related to Tz-operator usage is that 'the
text state parameters are initialized to their default values at
the beginning of each page'(PDF Ref. 5.2). So one should reinstall
T_h parameter at any page. It seems difficult to use correctly
Tz-operator when text is not broken up into pages but content of
any page is known after TeX translation finishes. Is it possible to embed
fonts and to optimize text-related operators after TeX'ing?
Pdftex is the excellent program. I think that future is in pdfTeX'ing.
Therefore it will be fine if the font strategy will be improved.
A.Kuznetsov
More information about the pdftex
mailing list