[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] Support for user-synthesized cmaps
From: |
Vincent Caron |
Subject: |
[Devel] Support for user-synthesized cmaps |
Date: |
24 Jul 2002 00:07:59 +0200 |
Hello,
I have implemented a support for synthesized cmaps in my own
application : I'm basically invoking iconv() when the font does not
provide a cmap matching the current locale. However I feel I'm
reinventing the wheel, and of course squarer :). I end up with encoding
lookup and cache problems that are already smartly solved by FreeType
itself. I was wondering if adding some support to help the user add
easily its own synthesized cmaps to the current face object is a good
idea. IMHO it would greatly simplify the tedious locale/cmap mathing on
user side, while reusing a bunch of FreeType components (cmap and cache
infrastructures).
An example :
typedef FT_Uint32 (*FT_CMap_Callback)(FT_Uint32);
FT_Error
FT_CMap_Synthesize (FT_Face* face,
FT_CMap_Callback callback,
FT_Encoding* user_encoding);
This would create a generic cmap class (using a resized array or a
FT_Uint32 hash), then invoke the callback for every glyph to populate
the synthesized cmap. The callback accepts a char code from the face
selected encoding and should return the equivalent char code wrt. user
encoding. This function would return a dynamically encoding ID (since
FT_Encoding is currently an enum, this is not correct) that you would
just select later.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Devel] Support for user-synthesized cmaps,
Vincent Caron <=