diff options
Diffstat (limited to 'src/3rdparty/freetype/src/cache')
-rw-r--r-- | src/3rdparty/freetype/src/cache/ftccmap.c | 20 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/cache/ftcmanag.c | 9 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/cache/rules.mk | 10 |
3 files changed, 27 insertions, 12 deletions
diff --git a/src/3rdparty/freetype/src/cache/ftccmap.c b/src/3rdparty/freetype/src/cache/ftccmap.c index aa59307f4..4c6a7fd96 100644 --- a/src/3rdparty/freetype/src/cache/ftccmap.c +++ b/src/3rdparty/freetype/src/cache/ftccmap.c @@ -4,7 +4,7 @@ /* */ /* FreeType CharMap cache (body) */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -288,8 +288,20 @@ 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, meaning that you */ + /* don't want to change the FT_Face's character map through this */ + /* call. This can be useful if the face requester callback already */ + /* sets the face's charmap to the appropriate value. */ + + no_cmap_change = 1; + cmap_index = 0; + } + if ( !cache ) { FT_ERROR(( "FTC_CMapCache_Lookup: bad arguments, returning 0!\n" )); @@ -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 ); } diff --git a/src/3rdparty/freetype/src/cache/ftcmanag.c b/src/3rdparty/freetype/src/cache/ftcmanag.c index 9d7347c3d..4d44094ce 100644 --- a/src/3rdparty/freetype/src/cache/ftcmanag.c +++ b/src/3rdparty/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -181,7 +181,7 @@ if ( asize == NULL ) - return FTC_Err_Bad_Argument; + return FTC_Err_Invalid_Argument; *asize = NULL; @@ -306,7 +306,7 @@ if ( aface == NULL ) - return FTC_Err_Bad_Argument; + return FTC_Err_Invalid_Argument; *aface = NULL; @@ -608,7 +608,8 @@ } Exit: - *acache = cache; + if ( acache ) + *acache = cache; return error; } diff --git a/src/3rdparty/freetype/src/cache/rules.mk b/src/3rdparty/freetype/src/cache/rules.mk index 457dec848..ed75a6a91 100644 --- a/src/3rdparty/freetype/src/cache/rules.mk +++ b/src/3rdparty/freetype/src/cache/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 2000, 2001, 2003, 2004, 2006 by +# Copyright 2000, 2001, 2003, 2004, 2006, 2008 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -26,7 +26,7 @@ CACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR)) # CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \ $(CACHE_DIR)/ftccache.c \ - $(CACHE_DIR)/ftccmap.c \ + $(CACHE_DIR)/ftccmap.c \ $(CACHE_DIR)/ftcglyph.c \ $(CACHE_DIR)/ftcimage.c \ $(CACHE_DIR)/ftcmanag.c \ @@ -35,12 +35,14 @@ CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \ # Cache driver headers # -CACHE_DRV_H := $(CACHE_DIR)/ftccback.h \ +CACHE_DRV_H := $(CACHE_DIR)/ftccache.h \ + $(CACHE_DIR)/ftccback.h \ $(CACHE_DIR)/ftcerror.h \ $(CACHE_DIR)/ftcglyph.h \ $(CACHE_DIR)/ftcimage.h \ $(CACHE_DIR)/ftcmanag.h \ - $(CACHE_DIR)/ftcmru.h + $(CACHE_DIR)/ftcmru.h \ + $(CACHE_DIR)/ftcsbits.h # Cache driver object(s) |