freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Using hashes in FT2 code


From: Tom Kacvinsky
Subject: [Devel] Using hashes in FT2 code
Date: Sun, 16 Dec 2001 11:57:16 -0500 (EST)

I am working on a problem for CID keyed CFF fonts.  The basic issues is fidning
an economical way of storing the CharSet table, which according to the CFF
specification is the where the mapping between glyph indices and CIDs are
stored.

Currently, the array where the CharSet information is stored is indexed by GID,
and its values are SIDs (for non CID keyed fonts) and CIDs (for CID keyed
fonts).  I would like to store values index by CIDs/SIDs, the values being the
GID.

In order to do this, I need a hash function that always maps a given SID/CID
into the range 0 to num_glpyhs - 1.  Any ideas on how to best achieve this (I
haven't coded hash tables in LONG time, so forgive my newbie-ish question).

Anyway, such a hash function would need to be tied to a certian font, because
the num_glyphs value changes from font to font.  This, I suspect, will be the
magor difficulty, because such a function would need to be built on the fly.

But, if such a function is feasible, we then have a quick way of looking up GIDs
based on a given CID,a nd the storeage would be economical.

Any ideas on this train of thought?

Thanks,

Tom




reply via email to

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