freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] Detecting Unicode font's and CMAP's and Symbol Fonts


From: Dave Roach
Subject: [ft] Detecting Unicode font's and CMAP's and Symbol Fonts
Date: Tue, 20 Feb 2007 06:59:26 -0500

First of all let me congratulate all involved with FreeType.  It is a wonderful piece of technology that I have had an opportunity to work with several times in my career.  Great job!
 
I am currently developing a PDF output filter for a leading graphics application and am using FreeType to do several different things.  I am using it to help me access individual character glyphs and pack them into the PDF.  It works very well but I have a question concerning Unicode and Symbol fonts.
 
I looked through the archive trying to determine if someone else has come across the need to detect Unicode versus non Unicode fonts.  From what I read, it appears that a flag was introduced in 2000 to help with this matter.
 
I will describe what the true source of the problem is and see if I am correctly assuming my resolution to the problem.
 
When I receive text that must be embedded into a PDF, I receive all of my text as unicode strings.  This is fine in most cases and when a user decides that do not want embed the entire font in their PDF, I use FreeType to get at each individual glyph and create a pseudo font (via PDFNet which uses FreeType as it's core) within the PDF file that gets refrenced accordingly.  When the typeface Wingdings comes about, it seems that it is not a unicode font.  It appears to have characters mapped between 32 and 255.  However, the application that is sending me information about text that is to be in the PDF sends me unicode values as follows:
 
32-127        sent as unicode in 16 bit 0x0000 - 0x007F
 
127-255      sent as unicode in 16 bit 0xF080 - 0xF0FF
 
This causes all kinds of havoc with my glyph decoding code and since the Wingdings font is not a real Unicode font everything falls apart.  When I embed a font into the PDF I have a choice whether or not to embed it as an Ansi font or a Unicode font.  If I embed the font as Ansi and strip the F0 from the 16 bit unicode data that is being passed to me, everything works fine. 
 
So, in my solution I am looking to detect whether a font is truly Unicode and if it is I follow one form of logic if it is not, I proceed with another form of logic.  The key is finding out whether a font is a truly unicode.  Like I said, I read through the FAQ archives and found reference to a define that was added to help aid in detecting unicode fonts, but I can not find where this is with respect to the FreeType library or methods.
 
Thanks for your help in this matter.
 
Dave Roach
Ike Software

reply via email to

[Prev in Thread] Current Thread [Next in Thread]