summaryrefslogtreecommitdiff
path: root/src/cache/ftccmap.c
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2008-09-02 02:34:29 +0000
committerDavid Turner <david@freetype.org>2008-09-02 02:34:29 +0000
commit17cd687266dadb4bd371c2c74e3298a8ccf87da5 (patch)
treedb7cbb7af2a034733b57aec3076fbe6f8b30e487 /src/cache/ftccmap.c
parentf47d263f1bb01fe7701249fe5df4ac2e1534bd51 (diff)
downloadfreetype2-17cd687266dadb4bd371c2c74e3298a8ccf87da5.tar.gz
* include/freetype/ftcache.h, src/cache/ftccmap.c:
modify FTC_CMapCache_Lookup to accept a negative cmap index to mean "use default cached FT_Face's charmap". This fixes Savannah issue #22625
Diffstat (limited to 'src/cache/ftccmap.c')
-rw-r--r--src/cache/ftccmap.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index aa59307f4..51bef1e91 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -288,7 +288,19 @@
FT_Error error;
FT_UInt gindex = 0;
FT_UInt32 hash;
+ FT_Int no_cmap_change = 0;
+ if (cmap_index < 0)
+ {
+ /* treat a negative cmap index as a special value that
+ * means you don't want to change the FT_Face's character
+ * map through this call. this can be useful when the
+ * face requester callback already set the face's charmap
+ * to the appropriate value.
+ */
+ no_cmap_change = 1;
+ cmap_index = 0;
+ }
if ( !cache )
{
@@ -311,7 +323,7 @@
* Adobe Acrobat Reader Pack, named `KozMinProVI-Regular.otf',
* which contains more than 5 charmaps.
*/
- if ( cmap_index >= 16 )
+ if ( cmap_index >= 16 && !no_cmap_change )
{
FTC_OldCMapDesc desc = (FTC_OldCMapDesc) face_id;
@@ -393,12 +405,12 @@
old = face->charmap;
cmap = face->charmaps[cmap_index];
- if ( old != cmap )
+ if ( old != cmap && !no_cmap_change )
FT_Set_Charmap( face, cmap );
gindex = FT_Get_Char_Index( face, char_code );
- if ( old != cmap )
+ if ( old != cmap && !no_cmap_change )
FT_Set_Charmap( face, old );
}