diff options
author | Werner Lemberg <wl@gnu.org> | 2002-02-04 20:55:58 +0000 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2002-02-04 20:55:58 +0000 |
commit | 0f7c2f1aa58c2251d6c1a3f388a50bfa97cb097f (patch) | |
tree | 7fb4c60ca8ca8dc4bde0661b7e490210555a122d /src/psnames | |
parent | 3604d5f5581bdf39d990dcc9b0e21a828dd0f24a (diff) |
Adding the function `FT_Get_Next_Char', doing the obvious thing
w.r.t. the selected charmap.
* include/freetype/freetype.h: Add prototype.
* include/freetype/internal/ftdriver.h: Add `FTDriver_getNextChar'
typedef.
(FT_Driver_Class): Use it.
* include/freetype/internal/psnames.h: Add `PS_Next_Unicode_Func'
typedef.
(PSNames_Interface): Use it.
* include/freetype/internal/tttypes.h: Add `TT_CharNext_Func'
typedef.
(TT_CMapTable): Use it.
* src/base/ftobjs.c (FT_Get_Next_Char): New function, implementing
high-level API.
* src/cff/cffdrivr.c (cff_get_next_char): New function.
(cff_driver_class): Add it.
* src/cid/cidriver.c (Cid_Get_Next_Char): New function.
(t1cid_driver_class): Add it.
* src/pcf/pcfdriver.c (PCF_Get_Next_Char): New function.
(pcf_driver_class): Add it.
* src/psnames/psmodule.c (PS_Next_Unicode): New function.
(psnames_interface): Add it.
* src/sfnt/ttcmap.c (code_to_next0, code_to_next2, code_to_next4,
code_to_next6, code_to_next_8_12, code_to_next_10): New auxiliary
functions.
(TT_CharMap_Load): Use them.
* src/truetype/ttdriver.c (Get_Next_Char): New function.
(tt_driver_class): Add it.
* src/type1/t1driver.c (Get_Next_Char): New function.
(t1_driver_class): Add it.
* src/winfnt/winfnt.c (FNT_Get_Next_Char): New function.
(winfnt_driver_class): Add it.
* src/pcf/pcfread.c (pcf_load_font): For now, report Unicode for
Unicode and Latin 1 encodings.
Diffstat (limited to 'src/psnames')
-rw-r--r-- | src/psnames/psmodule.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index 9f6ccf59..5b3e2de4 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -238,6 +238,48 @@ } + static FT_ULong + PS_Next_Unicode( PS_Unicodes* table, + FT_ULong unicode ) + { + PS_UniMap *min, *max, *mid; + + + unicode++; + /* perform a binary search on the table */ + + min = table->maps; + max = min + table->num_maps - 1; + + while ( min <= max ) + { + mid = min + ( max - min ) / 2; + if ( mid->unicode == unicode ) + return unicode; + + if ( min == max ) + break; + + if ( mid->unicode < unicode ) + min = mid + 1; + else + max = mid - 1; + } + + if ( max < table->maps ) + max = table->maps; + + while ( max < table->maps + table->num_maps ) + { + if ( unicode < max->unicode ) + return max->unicode; + max++; + } + + return 0; + } + + #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ @@ -272,6 +314,7 @@ 0, 0, 0, + 0, #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ @@ -279,7 +322,14 @@ (PS_Adobe_Std_Strings_Func)PS_Standard_Strings, t1_standard_encoding, - t1_expert_encoding + t1_expert_encoding, + +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + (PS_Next_Unicode_Func) PS_Next_Unicode +#else + 0 +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + }; |