Forum How do I...?

Are bitmaps in ttf fonts supported by Prince?

jrichter
I am currently evaluating Prince for an ebook project and have tested it with a ttf font file that contains in addition to vector fonts also bitmap fonts that create better results for certain smaller resolutions.

Using a modified font where the vector fonts are rotated by 90 degrees and the bitmap fonts are not and a sample xhtml document that uses a lot of different text sizes I got at least with Prince version 5 only the output from the vector fonts so at least version 5 seems to ignore the bitmap fonts.

Is this true for Prince Version 6 as well? (Am currently working on a Windows 2000 system where Prince Version 6 does not work.)

And if yes: Any plans in the future to change this?
mikeday
We have not done anything ourselves to support bitmap fonts, so I would be surprised if they worked. I suppose theoretically, if a TrueType font only included bitmaps, and subsetting was disabled so that Prince did not try looking for the glyf table, then the whole font could be embedded as is in the PDF file. After that, it would be up to the PDF viewer to display it appropriately. Do you have a font containing only bitmaps?
jrichter
What I am actually using is the Japanese font sazanami-gothic.ttf that contains not only a glyf table with vector fonts but also an EBDT table with bitmaps that should be used if the font size is in a certain medium range.

How do you embed the fonts into the pdf assuming subsetting is disabled? By embedding the whole ttf file as is (including the EBDT table) or do you copy only selected tables needed to do the vector font processing?

Because my little test document has a size of 4.5MB for text + embedded font whereas the font file itself has a size of 7.5MB which would indicate that the EBDT table is not copied.
mikeday
Strange, we should be embedding the whole font, if --no-subset-fonts is specified. Are you running on Windows, MacOS X, or Linux?
jrichter
I am running Prince Version 5 under Windows 2000 which if I understand it correctly does not support font subsetting, correct? At least I found no option to turn it off in the GUI.
mikeday
That's an oversight on our part: it can't be turned off from the GUI. Sorry! :)

However, you can disable it when running Prince\engine\bin\prince.exe from the command-line, with --no-subset-fonts.
jrichter
OK, I think I meanwhile know the answer to my initial question, it is "Wrong question! Real question is: Does PDF support EBDT tables in ttf fonts?" and if I am not very, very mistaken, the answer is "no" here:

    I am running Prince 5 (as I have to use Windows 2000) which does not support font subsetting (--no-subset-fonts results in an "unrecognized option `--no_compress' " error)

    The PDF file sizes are 2.1MB for a compressed file with embedded fonts, 4.8MB for an uncompressed file with embedded fonts and 72KB for an uncompressed file without embedded fonts. The original font size is 7.5MB!

    Using the PDF file without embedded fonts the Acrobat Reader (5.0) reads the font from the font directory and shows clearly the glyf table font and not the EBDT table font at all font sizes from very small to extremely large letters.

    I double checked against this the PDF reference 1.7 (latest version before Adobe made this an ISO standard for which you have to pay) and EBDT is not even mentioned in this document and the paragraph about handling ttf fonts speaks only about the glyf and cmap table. Add to this the fact that ttf was initially a Microsoft/Apple project against some Adobe patents ...

All in all I would say, Prince does not include the EBDT tables when embedding fonts in PDFs and this is the only correct thing as this makes the file a lot smaller and Acrobat reader would ignore the table anyway.

If someone verifies this with somewhat more modern equipment :oops: : Please post a reply here.