Search code examples
pdffontspdf-generationtruetypeadobe-reader

Embedded TrueType fonts in Adobe Reader


I embedded TrueType fonts in pdf file according to the Adobe Manual:

7 0 obj 
<<
/BaseFont /Arial
/FirstChar 32
/LastChar 126
/Subtype /TrueType
/FontDescriptor 8 0 R
/Widths 59 0 R
/Type /Font
>>

It works perfectly in most of PDF viewers such Evince, Xournal, PDF Editor, etc; but it does not work in Adobe Reader XI. It simply does not show any text (displaying drawings). In the PDF properties, it does not have my embedded font. It seems, Adobe Reader is unable to find the embedded font. But what is the difference of Adobe Reader with other PDF viewers.

UPDATE: Initially, I copied the text from PDF manual and the illegal character was Unicode minus. Here is an updated version of the file. Still,it does not show the embedded font, but the default alternative font.

PDF File


Solution

  • In addition to the font descriptor corruptness, the FontFile2 stream dictionary is incomplete:

    8 0 obj 
    <<
    [...]
    /FontFile2 10 0 R
    [...]
    >> 
    endobj 
    10 0 obj 
    <<
    /Length 29061
    >>
    stream 
    [...]
    

    According to the specification (ISO 32000-1:2008) the Length1 entry is missing:

    (Required for Type 1 and TrueType fonts) The length in bytes of the clear-text portion of the Type 1 font program, or the entire TrueType font program, after it has been decoded using the filters specified by the stream’s Filter entry, if any.