freetype
[Top][All Lists]
Advanced

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

RE: unicode?


From: Feinberg, Matthew
Subject: RE: unicode?
Date: Sat, 12 Aug 2000 00:35:20 -0400

> -----Original Message-----
> From: Werner LEMBERG [mailto:address@hidden
> Sent: Saturday, August 12, 2000 12:19 AM
> To: address@hidden
> Cc: address@hidden
> Subject: Re: unicode?
> 
> > 1) FreeType2 supports unicode text and UTF8, correct?
> 
> No.  It only accepts character codes which are mapped to glyph indices
> according to a cmap in the font.

...so what you want to do (as I mentioned in my other e-mail) is pick a
Unicode cmap from the font (the FreeType docs have examples on how to do
this) and then use the Unicode character indicies to look up characters
in the character map.  For UCS-4, each character is simply a 4-byte
Unicode index.  UCS-2 is nearly as simple (2 byte indicies) but if you
want a robust implementation you have to deal with surrogates (see the
Unicode standard).  UTF-8 is more complex, but the Unicode standard has
a sample function for reading UTF-8 text, and RFC 2044 has detals on the
UTF-8 format (it's not hard to read UTF-8).

> > 2) Does FreeType2 have a function which reads in unicode text or
> >    UTF8 from a file?  If so, how do I access it?
> 
> It doesn't have such a function. This is at least one level higher.
> There are a lot of free (and robust!) UTF8->Unicode converters
> available in the net (e.g. in the latest xterm versions for the X
> Window system).
> 
> 
>     Werner
> 



reply via email to

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