| Index: third_party/freetype/src/psnames/psmodule.c
|
| diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/psnames/fxft_psmodule.c b/third_party/freetype/src/psnames/psmodule.c
|
| similarity index 88%
|
| rename from core/src/fxge/fx_freetype/fxft2.5.01/src/psnames/fxft_psmodule.c
|
| rename to third_party/freetype/src/psnames/psmodule.c
|
| index 3380e3938a542c2d54098f8a2425611aa420c3d3..0a5bcb7d2a1f85b1921332d552424e4b1a73902a 100644
|
| --- a/core/src/fxge/fx_freetype/fxft2.5.01/src/psnames/fxft_psmodule.c
|
| +++ b/third_party/freetype/src/psnames/psmodule.c
|
| @@ -1,4 +1,3 @@
|
| -#if !defined(_FXFT_VERSION_) || _FXFT_VERSION_ == 2501
|
| /***************************************************************************/
|
| /* */
|
| /* psmodule.c */
|
| @@ -16,11 +15,11 @@
|
| /* */
|
| /***************************************************************************/
|
|
|
| -#define FT2_BUILD_LIBRARY
|
| -#include "../../include/ft2build.h"
|
| -#include "../../include/freetype/internal/ftdebug.h"
|
| -#include "../../include/freetype/internal/ftobjs.h"
|
| -#include "../../include/freetype/internal/services/svpscmap.h"
|
| +
|
| +#include <ft2build.h>
|
| +#include FT_INTERNAL_DEBUG_H
|
| +#include FT_INTERNAL_OBJECTS_H
|
| +#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
|
|
| #include "psmodule.h"
|
| #include "pstables.h"
|
| @@ -38,15 +37,14 @@
|
| #define VARIANT_BIT 0x80000000UL
|
| #define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )
|
|
|
| -#ifdef __cplusplus
|
| -extern "C" {
|
| -#endif
|
| +
|
| /* Return the Unicode value corresponding to a given glyph. Note that */
|
| /* we do deal with glyph variants by detecting a non-initial dot in */
|
| /* the name, as in `A.swash' or `e.final'; in this case, the */
|
| /* VARIANT_BIT is set in the return value. */
|
| /* */
|
| -int FXFT_unicode_from_adobe_name( const char* glyph_name )
|
| + static FT_UInt32
|
| + ps_unicode_value( const char* glyph_name )
|
| {
|
| /* If the name begins with `uni', then the glyph name may be a */
|
| /* hard-coded unicode character code. */
|
| @@ -164,62 +162,7 @@ int FXFT_unicode_from_adobe_name( const char* glyph_name )
|
| VARIANT_BIT );
|
| }
|
| }
|
| - #ifdef __cplusplus
|
| -}
|
| -#endif
|
|
|
| -static int xyq_search_node(char* glyph_name, int name_offset, int table_offset, FT_UInt32 unicode)
|
| -{
|
| - int i, count;
|
| -
|
| - // copy letters
|
| - while (1) {
|
| - glyph_name[name_offset] = ft_adobe_glyph_list[table_offset] & 0x7f;
|
| - name_offset ++;
|
| - table_offset ++;
|
| - if (!(ft_adobe_glyph_list[table_offset-1] & 0x80)) break;
|
| - }
|
| - glyph_name[name_offset] = 0;
|
| -
|
| - // get child count
|
| - count = ft_adobe_glyph_list[table_offset] & 0x7f;
|
| -
|
| - // check if we have value for this node
|
| - if (ft_adobe_glyph_list[table_offset] & 0x80) {
|
| - unsigned short thiscode = ft_adobe_glyph_list[table_offset+1] * 256 + ft_adobe_glyph_list[table_offset+2];
|
| - if (thiscode == unicode) // found it!
|
| - return 1;
|
| - table_offset += 3;
|
| - } else
|
| - table_offset ++;
|
| -
|
| - // now search in sub-nodes
|
| - if (count == 0) return 0;
|
| - for (i = 0; i < count; i ++) {
|
| - int child_offset = ft_adobe_glyph_list[table_offset+i*2] * 256 + ft_adobe_glyph_list[table_offset+i*2+1];
|
| - if (xyq_search_node(glyph_name, name_offset, child_offset, unicode))
|
| - // found in child
|
| - return 1;
|
| - }
|
| - return 0;
|
| -}
|
| -
|
| -// XYQ: function for searching Unicode in the glyph list
|
| -void FXFT_adobe_name_from_unicode(char* glyph_name, FT_UInt32 unicode)
|
| -{
|
| - int i, count;
|
| -
|
| - // start from top level node
|
| - count = ft_adobe_glyph_list[1];
|
| - for (i = 0; i < count; i ++) {
|
| - int child_offset = ft_adobe_glyph_list[i*2+2] * 256 + ft_adobe_glyph_list[i*2+3];
|
| - if (xyq_search_node(glyph_name, 0, child_offset, unicode))
|
| - return;
|
| - }
|
| -
|
| - // failed, clear the buffer
|
| - glyph_name[0] = 0;
|
| -}
|
|
|
| /* ft_qsort callback to sort the unicode map */
|
| FT_CALLBACK_DEF( int )
|
| @@ -390,7 +333,7 @@ void FXFT_adobe_name_from_unicode(char* glyph_name, FT_UInt32 unicode)
|
| {
|
| ps_check_extra_glyph_name( gname, n,
|
| extra_glyphs, extra_glyph_list_states );
|
| - uni_char = FXFT_unicode_from_adobe_name( gname );
|
| + uni_char = ps_unicode_value( gname );
|
|
|
| if ( BASE_GLYPH( uni_char ) != 0 )
|
| {
|
| @@ -582,7 +525,7 @@ void FXFT_adobe_name_from_unicode(char* glyph_name, FT_UInt32 unicode)
|
|
|
| FT_DEFINE_SERVICE_PSCMAPSREC(
|
| pscmaps_interface,
|
| - (PS_Unicode_ValueFunc) FXFT_unicode_from_adobe_name,
|
| + (PS_Unicode_ValueFunc) ps_unicode_value,
|
| (PS_Unicodes_InitFunc) ps_unicodes_init,
|
| (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
|
| (PS_Unicodes_CharNextFunc) ps_unicodes_char_next,
|
| @@ -664,5 +607,3 @@ void FXFT_adobe_name_from_unicode(char* glyph_name, FT_UInt32 unicode)
|
|
|
|
|
| /* END */
|
| -#endif
|
| -
|
|
|