How is kerning encoded in Adobe Type 1 embedded fonts in PDF files?

The Adobe PDF reference talks about / Widths array and / FontFile stream, but Adobe Type 1 font programs (.pfb or .pfa files) do not include font metrics; they are included in font metric files (.afm or .pfm files), but they are not embedded in the PDF file.

Can a PDF just encode char width metrics, or can it also encode a kerning pair? How?

+4
source share
1 answer

If you study section 9.4.4 of the PDF specification ISO 32000-1 (see below), you will see that no special kerning information (for example, extracted from the font program) is included in the calculation of glyph offsets.

You will also see that there is a Tj value that denotes a number in the TJ array, if any, that defines the position setting. This value is used to implement kerning.

eg. this phrase "denotes a number in the TJ array, if any, which defines the position setting" from the specification itself, is set as:

[( de)-5.5(no)-5.5(te)-5.5(sa nu)-5.5(m)-5.7(b).5(e)-5.5(r).3( in a )]TJ ... 

You see, for example, kerning used in the notation between "e" and "n", "o" and "t", and "e" and "s".

Section from the specification:

The section 9.4.4 referenced above

+6
source

Source: https://habr.com/ru/post/1497715/


All Articles