Question

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

PDF can just encode char width metrics or it can encode kerning pair too? How?

Was it helpful?

Solution

If you study the section 9.4.4 of the PDF specification ISO 32000-1 (see below), you'll see that no special kerning information (e.g. extracted from the font program) are included in the calculation of the glyph displacement.

You'll also see, though, that there is a Tj value which denotes a number in a TJ array, if any, which specifies a position adjustment. This value is used to implement kerning.

E.g. that phrase "denotes a number in a TJ array, if any, which specifies a position adjustment" from the specification itself is set as:

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

You see for example kerning applied in denotes between 'e' and 'n', 'o' and 't', and 'e' and 's'.

The section from the specification:

The section 9.4.4 referenced above

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top