[Top][All Lists]
[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:31:43 -0400 |
AFAIK, FreeType just renders glyphs in the font based on character
indicies. It doesn't render entire text strings; that's up to the
application to do. That means you'll need to write a function to read
characters from a UTF8 string and render them.
For Unicode text in UCS-2 or UCS-4 format, it's just a straight array of
character codes. All you have to do is read the character codes and use
a Unicode character map in FreeType. (Though UCS-2 text can have
surrogate character pairs that have to be interpreted specially... see
the Unicode standard for details).
For Unicode text in UTF-8 format, characters are a variable number of
bytes in size. You can find details on the UTF-8 format, including a
sample C function to read UTF-8 characters from a string, in the Unicode
standard in one of the apendicies. You can also find details on UTF-8
(but no sample code) in the Internet RFC 2044. Once you have the
character codes, again, you can just use a Unicode character map.
Off the top of my head, I can't tell you how to get a Unicode character
map in FreeType, but it's a pretty standard operation and I seem to
remember there being an example for it in the FreeType docs. There are
also lots of people on this list who can probably help you with that.
--Matthew
> -----Original Message-----
> From: Allen Lin [mailto:address@hidden
> Sent: Friday, August 11, 2000 4:33 PM
> To: address@hidden
> Subject: unicode?
>
>
> Two questions.
>
> 1) FreeType2 supports unicode text and UTF8, correct?
>
> 2) Does FreeType2 have a function which reads in unicode text
> or UTF8 from a
> file? If so, how do I access it?
>
> - Allen H. Lin (not quite Asok)
> Programming Intern
> Quicksilver Software Inc.
> (949)474-2150 x56
>
> The views addressed in this e-mail are not representative of
> Quicksilver
> Software in any way, shape, or form.
>
- unicode?, Allen Lin, 2000/08/12
- RE: unicode?,
Feinberg, Matthew <=
- RE: unicode?, Feinberg, Matthew, 2000/08/12