freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Glyph -> Unicode?


From: Antoine Leca
Subject: Re: [Freetype] Glyph -> Unicode?
Date: Mon, 19 Jan 2004 12:02:52 +0100

Halo,

Matthias Kramm wrote:
> how do I find out the Unicode index of a given glyph?

Sorrry if I am too pedantic and you already know what is following. But it
is also for the general enlightment of the readers and lurkers here.

The relationship between glyph indexes and Unicode codepoints no is direct.
You can perfectly have many codepoint with the same glyph (obvious examples
are the space, as you discovered; another obvious example is capital letter
A, which many be Latin A, U+0041, Greek Alpha, U+03B1, or Cyrillic A,
U+0410); on the other hand, you may have various glyphes for the same
Unicode codepoints, in particular for the so-called "complex scripts"
(Arabic, Indian), and for the Han characters (Chinese, Japanese), where the
same ideogram, with the same Unicode "unified" codepoint, will have various
glyphes associated, according to the different look it may have in China or
in Japan.

As you see, furthermore, the relationship is tied to the font design. This
is the ultimate reason why every font has to bear _all_ the informations for
the so-called character mapping(s), which is another way to call the
expression of the many-to-many relationship I described above (in fact, the
charmap as it stand in the font, and in the Freetype API, is the many-to-one
part of the relationship; the rest is encoded apart, usually with higher
level datas such as GX or OpenType tables).

Hope this explanation will help you to dig a bit in the process, so you can
figure out what may be show. You really would have to explain a bit more
your purpose if you want us to help you further: obviously, since the base
situation is a bit complex, for a given purpose you may take short tracks
which give you useful results without needing to expose a many-to-many
mapping (which is very difficult to figure out in the user interface!)


Hope it helps,

Antoine




reply via email to

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