Quantcast
Channel: Adobe Community : Popular Discussions - Typography
Viewing all articles
Browse latest Browse all 14182

Differences between /FontFile2 and /FontFile3, or OS X Preview?

$
0
0

(This is my first post in these forums, so apologies if this topic is not appropriate.)

 

I've written a pile of Java utility code to generate PDFs with subsetted TrueType fonts using a CID-keyed font. (I know: there are multiple frameworks that do this type of thing. But I'm a hobbyist tinkerer who enjoys building things, and I'm enjoying learning how these technology stacks hang together.)

 

My code creates a font descriptor with a /FontFile2 reference to my TrueType font program output stream. The subsetted font always has the .notdef glyph at glyphIndex 0, with subsetted glyphs thereafter as they are first referenced. I'm using an identity mapping of CID==GlyphID. (I've been reading the various specs... the ISO PDF 1.7 reference, TrueType and OpenType specs at Microsoft and Apple, and several Adobe Tech Notes on various font and CMap technologies.)

 

All this seems to work.

 

However I'd like to also explore OpenType fonts with glyphs in a 'CFF ' table (CIDFontType0 instead of my CIDFontType2), and in preparation I'm trying to adapt my current TrueType-based code to OpenType using a /FontFile3 reference.

 

That's where the wheels fall off the train. Since I'm still dealing with 'glyf'-based fonts, I expected minimal changes, e.g., switching the font file dictionary key and putting the /Subtype -> /OpenType wrapper on the font stream itself.

 

Adobe Acrobat renders the resulting PDF just fine, and preflighting didn't bring up any errors (though possibly I'm not using Acrobat right). However OS X Preview under Mavericks scrambles my glyph mapping in a way that I can't mentally reverse engineer. I've tried tweaking things, but I'm stuck.

 

So my questions are: if your font subset is a TrueType-based CID font with 'glyf' outlines using /FontFile2, what changes are necessary to make an equivalent OpenType font using /FontFile3? and/or Does Mavericks Preview support PDFs with /FontFile3 and 'glyf'-based OpenType fonts? I think the odds are with me misunderstanding aspects of the specifications, and it's also possible that my /FontFile2 code is also broken in a way that (un)fortunately is forgiven by both Acrobat and Preview.

 

(I have two "equivalent" PDF examples of what my code generates that I can try to attach if this topic gets any traction.)

 

Thank you in advance!

 

/djk


Viewing all articles
Browse latest Browse all 14182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>