[cairo] Strange problem with PDF generation

Franz Schmid Franz.Schmid at altmuehlnet.de
Wed Jan 31 07:50:56 PST 2007


Umberto Allievi wrote
> Here is pdffonts output:
> 
> [umbi at keops src]$ pdffonts test.pdf
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> ArialBold                            TrueType     yes no  no       7  0
> [umbi at keops src]$ 
> 
> 
> Attached the original pdf file: test.pdf
Found 2 things that are not correct in the attached pdf:

1) there is a typo in the main font descriptor:
	/FontName /7ArialBold
    should be for sure:
	/FontName /ArialBold

2) in the font descripor (object 7 in this pdf) you need to add
    an encoding entry to make printing working correctly. This
    encoding entry maps glyph numbers to postscript glyph names.

Sample font descriptor:
7 0 obj
<< /Type /Font
    /Subtype /TrueType
    /BaseFont /ArialBold
    /FirstChar 0
    /LastChar 18
    /FontDescriptor 6 0 R
    /Widths [ 1251 1251 569 1139 569 1251 1251 569 1251 1251 797 1251 682 1139 1139 1139 569 1251 682 ]
    /Encoding << /Type /Encoding /Differences [ 0 /space /exclam /quotedbl /numbersign /dollar ] >>
 >>

The important thing is the Array /Differences, its first entry it the index of the first glyph,
followed by the names of the glyphs in your font in ascending order. The names in the sample
above are not correct, they are only there to show how it works.

Franz Schmid


More information about the cairo mailing list