2

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

Kara
  • 6,115
  • 16
  • 50
  • 57
Googlebot
  • 15,159
  • 44
  • 133
  • 229

2 Answers2

3

There might be other issues, but at first sight I can see that you font descriptor is corrupt:

8 0 obj 
<<
/FontName /Acens
/StemV 105
/Leading 83
/FontFile2 10 0 R
/Ascent 720
/Flags 262178
/XHeight 394
/AvgWidth 478
/Descent −270
/ItalicAngle 0
/StemH 45
/MaxWidth 1212
/MissingWidth 255
/FontBBox [−177 −269 1123 866] <- This guy here does not look very well
/Type /FontDescriptor
/CapHeight 660
>>
endobj 

Most probably all the readers you have tried except Acrobat are just ignoring the issue and assuming some kind of "default" values.

yms
  • 10,361
  • 3
  • 38
  • 68
  • 2
    '/Descent' key is also suspect – djangodude Oct 24 '12 at 02:31
  • As soon as those funny "−" fragments are removed (overwritten with spaces), a failure to retrieve the embedded font "Acens" is displayed. Thus, more to do... ;) – mkl Oct 24 '12 at 07:25
  • Good point, I edited the file, but still have problem to use the embedded font. – Googlebot Oct 24 '12 at 11:10
  • @yms I simply used a hex editor to overwrite those bad characters with ASCII 32, thus no objects were shifted around – mkl Oct 24 '12 at 13:00
3

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.

mkl
  • 90,588
  • 15
  • 125
  • 265
  • Yes, you're right, but I have no idea how to calculate `Length1`. The stream length is the size of binary ttf file, but how to calculate `Length1`? – Googlebot Oct 24 '12 at 11:12
  • In your case, i.e. for TrueType fonts, it is the size of the entire uncompressed font program, see the quotation above. I'm not too familiar with all the font stuff, but doesn't that mean in your case that Length1 is identical to Length for you as you do not apply compression after all? – mkl Oct 24 '12 at 11:20