freetype
[Top][All Lists]
Advanced

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

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


From: Werner LEMBERG
Subject: Re: [ft] Detecting Unicode font's and CMAP's and Symbol Fonts
Date: Tue, 20 Feb 2007 14:22:03 +0100 (CET)

> 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.

Which `wingdings' font do you mean exactly?  The one from Windows?

> 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

It seems that this application is based on Windows, which handles both
the WingDings and Symbol font as you describe (at least older Windows
versions do so; I know nothing about Vista).

> 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.

I suggest that you handle those two fonts specially -- in case your
fonts are based on TTFs, you might check for the (3,0) PID/EID pair
which signals this special treatment.  Just map them to the right
Unicode values (using the PS names to properly identify them), and you
are done.


    Werner




reply via email to

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