30#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
34#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
39#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
43#ifdef TT_CONFIG_OPTION_BDF
57#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
70#define FT_COMPONENT sfdriver
131 return FT_THROW( Invalid_Argument );
150 sfnt_service_sfnt_table,
158#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
192 if (
face->num_glyphs < 0 )
197 FT_TRACE0((
"Ignore glyph names for invalid GID 0x%08x - 0x%08lx\n",
200 for (
i = 0;
i < max_gid;
i++ )
218 sfnt_service_glyph_dict,
233 static const unsigned char sfnt_ps_map[16] =
253 if ( c < 0 || c >= 0x80 )
258 return sfnt_ps_map[
cc >> 3] & ( 1 << (
cc & 0x07 ) );
262#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
270 sfnt_is_alphanumeric(
int c )
279#define ROTL32( x, r ) ( x << r ) | ( x >> ( 32 - r ) )
283 fmix32( FT_UInt32
h )
296 murmur_hash_3_128(
const void*
key,
297 const unsigned int len,
302 const int nblocks = (
int)
len / 16;
309 const FT_UInt32 c1 = 0x239b961b;
310 const FT_UInt32 c2 = 0xab0e9789;
311 const FT_UInt32 c3 = 0x38b34ae5;
312 const FT_UInt32 c4 = 0xa1e38b93;
314 const FT_UInt32*
blocks = (
const FT_UInt32*)(
data + nblocks * 16 );
319 for(
i = -nblocks;
i;
i++ )
321 FT_UInt32 k1 =
blocks[
i * 4 + 0];
322 FT_UInt32 k2 =
blocks[
i * 4 + 1];
323 FT_UInt32 k3 =
blocks[
i * 4 + 2];
324 FT_UInt32 k4 =
blocks[
i * 4 + 3];
334 h1 = h1 * 5 + 0x561ccd1b;
343 h2 = h2 * 5 + 0x0bcaa747;
352 h3 = h3 * 5 + 0x96cd1c35;
361 h4 = h4 * 5 + 0x32ac3b17;
376 k4 ^= (FT_UInt32)
tail[14] << 16;
379 k4 ^= (FT_UInt32)
tail[13] << 8;
382 k4 ^= (FT_UInt32)
tail[12];
390 k3 ^= (FT_UInt32)
tail[11] << 24;
393 k3 ^= (FT_UInt32)
tail[10] << 16;
396 k3 ^= (FT_UInt32)
tail[9] << 8;
399 k3 ^= (FT_UInt32)
tail[8];
407 k2 ^= (FT_UInt32)
tail[7] << 24;
410 k2 ^= (FT_UInt32)
tail[6] << 16;
413 k2 ^= (FT_UInt32)
tail[5] << 8;
416 k2 ^= (FT_UInt32)
tail[4];
424 k1 ^= (FT_UInt32)
tail[3] << 24;
427 k1 ^= (FT_UInt32)
tail[2] << 16;
430 k1 ^= (FT_UInt32)
tail[1] << 8;
433 k1 ^= (FT_UInt32)
tail[0];
467 ((FT_UInt32*)
out)[0] = h1;
468 ((FT_UInt32*)
out)[1] = h2;
469 ((FT_UInt32*)
out)[2] = h3;
470 ((FT_UInt32*)
out)[3] = h4;
481#define IS_WIN( n ) ( (n)->platformID == 3 && \
482 ( (n)->encodingID == 1 || (n)->encodingID == 0 ) )
484#define IS_APPLE( n ) ( (n)->platformID == 1 && \
485 (n)->encodingID == 0 )
492 FT_Bool report_invalid_characters )
509 goto get_win_string_error;
520 if ( report_invalid_characters )
522 " Character 0x%X invalid in PS name string\n",
523 ((
unsigned)
p[0])*256 + (
unsigned)
p[1] ));
535 get_win_string_error:
538 entry->stringLength = 0;
539 entry->stringOffset = 0;
551 FT_Bool report_invalid_characters )
568 goto get_apple_string_error;
579 if ( report_invalid_characters )
581 " Character `%c' (0x%X) invalid in PS name string\n",
594 get_apple_string_error:
597 entry->stringOffset = 0;
598 entry->stringLength = 0;
617 for (
n = 0;
n <
face->num_names;
n++ )
622 if (
name->nameID ==
id &&
name->stringLength > 0 )
632 return ( *
win >= 0 ) || ( *apple >= 0 );
636#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
652#define MAX_VALUE_DESCRIPTOR_LEN ( 1 + 5 + 1 + 5 + 1 + 4 )
656#define MAX_PS_NAME_LEN 127
693 int_part = (
fixed >> 16 ) & 0xFFFF;
694 frac_part =
fixed & 0xFFFF;
698 while ( int_part > 0 )
700 *
q++ =
'0' + int_part % 10;
716 frac_part = frac_part * 10 + 5;
719 for (
i = 0;
i < 5;
i++ )
721 *
p++ =
'0' + (
char)( frac_part / 0x10000L );
723 frac_part %= 0x10000L;
753 if ( frac_part < 34480 * 10 &&
758 else if ( frac_part == 17232 * 10 &&
762 else if ( frac_part < 17232 * 10 &&
775 static const char hexdigits[16] =
777 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
778 '8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'
788 FT_Service_MultiMasters mm = (FT_Service_MultiMasters)
face->mm;
801 if ( !
face->var_postscript_prefix )
834 " Can't construct PS name prefix for font instances\n" ));
841 face->name_table.stream,
843 sfnt_is_alphanumeric,
845 if ( !
result && apple != -1 )
847 face->name_table.stream,
848 face->name_table.names + apple,
849 sfnt_is_alphanumeric,
855 " No valid PS name prefix for font instances found\n" ));
865 if (
len > MAX_PS_NAME_LEN - ( 1 + 32 + 3 ) )
867 len = MAX_PS_NAME_LEN - ( 1 + 32 + 3 );
871 " Shortening variation PS name prefix\n"
873 " to %d characters\n",
len ));
877 face->var_postscript_prefix_len =
len;
894 char* ps_name =
NULL;
899 ( psid > 255 && psid < 32768 ) )
914 char* subfamily_name;
920 if ( !subfamily_name )
923 " can't construct named instance PS name;\n"
925 " trying to construct normal instance PS name\n" ));
926 goto construct_instance_name;
957 construct_instance_name:
961 face->var_postscript_prefix_len +
962 num_coords * MAX_VALUE_DESCRIPTOR_LEN + 1 ) )
968 p +=
face->var_postscript_prefix_len;
970 for (
i = 0;
i < num_coords;
i++,
coords++, axis++ )
999 if (
p -
result > MAX_PS_NAME_LEN )
1004 FT_UInt32 seed = 123456789;
1024 for (
i = 0;
i < 4;
i++,
h-- )
1029 for (
j = 0;
j < 8;
j++ )
1031 *
p-- = hexdigits[
v & 0xF];
1050 if (
face->postscript_name )
1051 return face->postscript_name;
1053#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
1058 face->postscript_name = sfnt_get_var_ps_name(
face );
1059 return face->postscript_name;
1072 face->name_table.stream,
1076 if ( !
result && apple != -1 )
1078 face->name_table.stream,
1079 face->name_table.names + apple,
1090 sfnt_service_ps_name,
1100 tt_service_get_cmap_info,
1106#ifdef TT_CONFIG_OPTION_BDF
1110 const char* *acharset_encoding,
1111 const char* *acharset_registry )
1126 error = tt_face_find_bdf_prop(
face,
"CHARSET_ENCODING", &encoding );
1132 *acharset_encoding = encoding.
u.
atom;
1133 *acharset_registry =
registry.u.atom;
1159#if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
1168#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
1176#elif defined TT_CONFIG_OPTION_BDF
1204#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
1205#define PUT_EMBEDDED_BITMAPS( a ) a
1207#define PUT_EMBEDDED_BITMAPS( a ) NULL
1210#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
1211#define PUT_COLOR_LAYERS( a ) a
1213#define PUT_COLOR_LAYERS( a ) NULL
1216#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
1217#define PUT_PS_NAMES( a ) a
1219#define PUT_PS_NAMES( a ) NULL
1310 (
const void*)&sfnt_interface,
struct outqueuenode * tail
#define FT_CALLBACK_DEF(x)
static HINSTANCE instance
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define FT_IS_VARIATION(face)
#define FT_IS_NAMED_INSTANCE(face)
#define FT_TRACE0(varformat)
#define FT_TRACE1(varformat)
#define FT_ALLOC(ptr, size)
#define FT_STRCPYN(dst, src, size)
void(* FT_Module_Destructor)(FT_Module module)
FT_Error(* FT_Module_Constructor)(FT_Module module)
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
#define FT_DEFINE_MODULE( class_, flags_, size_, name_, version_, requires_, interface_, init_, done_, get_interface_)
#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1, serv_id_2, serv_data_2, serv_id_3, serv_data_3)
#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1, serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4, serv_data_4)
#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1, serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4, serv_data_4, serv_id_5, serv_data_5)
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLenum GLuint GLint GLenum face
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define TT_NAME_ID_FONT_FAMILY
static char memory[1024 *256]
static FT_Error sfnt_table_info(TT_Face face, FT_UInt idx, FT_ULong *tag, FT_ULong *offset, FT_ULong *length)
int(* char_type_func)(int c)
#define PUT_EMBEDDED_BITMAPS(a)
static char * get_win_string(FT_Memory memory, FT_Stream stream, TT_Name entry, char_type_func char_type, FT_Bool report_invalid_characters)
static const char * sfnt_get_ps_name(TT_Face face)
static char * get_apple_string(FT_Memory memory, FT_Stream stream, TT_Name entry, char_type_func char_type, FT_Bool report_invalid_characters)
static void * get_sfnt_table(TT_Face face, FT_Sfnt_Tag tag)
return ft_service_list_lookup(sfnt_services, module_interface)
static FT_Bool sfnt_get_name_id(TT_Face face, FT_UShort id, FT_Int *win, FT_Int *apple)
#define PUT_COLOR_LAYERS(a)
static int sfnt_is_postscript(int c)
TT_CMap_Info_GetFunc tt_get_cmap_info const char * module_interface
SFNT_Interface * SFNT_Service
#define FT_DEFINE_SFNT_INTERFACE( class_, goto_table_, init_face_, load_face_, done_face_, get_interface_, load_any_, load_head_, load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, load_name_, free_name_, load_kern_, load_gasp_, load_pclt_, load_bhed_, load_sbit_image_, get_psname_, free_psnames_, get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, set_sbit_strike_, load_strike_metrics_, load_cpal_, load_colr_, free_cpal_, free_colr_, set_palette_, get_colr_layer_, colr_blend_, get_metrics_, get_name_, get_name_id_)
tt_face_get_name(TT_Face face, FT_UShort nameid, FT_String **name)
sfnt_init_face(FT_Stream stream, TT_Face face, FT_Int face_instance_index, FT_Int num_params, FT_Parameter *params)
sfnt_load_face(FT_Stream stream, TT_Face face, FT_Int face_instance_index, FT_Int num_params, FT_Parameter *params)
sfnt_done_face(TT_Face face)
union BDF_PropertyRec_::@4525 u
TT_Get_Name_Func get_name
#define FT_SERVICE_ID_BDF
FT_Error(* FT_BDF_GetPropertyFunc)(FT_Face face, const char *prop_name, BDF_PropertyRec *aproperty)
FT_Error(* FT_BDF_GetCharsetIdFunc)(FT_Face face, const char **acharset_encoding, const char **acharset_registry)
#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_)
#define FT_SERVICE_ID_GLYPH_DICT
FT_UInt(* FT_GlyphDict_NameIndexFunc)(FT_Face face, const FT_String *glyph_name)
FT_Error(* FT_GlyphDict_GetNameFunc)(FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max)
#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_)
#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME
const char *(* FT_PsName_GetFunc)(FT_Face face)
#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_)
void *(* FT_SFNT_TableGetFunc)(FT_Face face, FT_Sfnt_Tag tag)
#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_)
FT_Error(* FT_SFNT_TableLoadFunc)(FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
#define FT_SERVICE_ID_SFNT_TABLE
FT_Error(* FT_SFNT_TableInfoFunc)(FT_Face face, FT_UInt idx, FT_ULong *tag, FT_ULong *offset, FT_ULong *length)
FT_Error(* TT_CMap_Info_GetFunc)(FT_CharMap charmap, TT_CMapInfo *cmap_info)
#define FT_SERVICE_ID_TT_CMAP
#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_)
tt_get_cmap_info(FT_CharMap charmap, TT_CMapInfo *cmap_info)
tt_face_free_colr(TT_Face face)
FT_BEGIN_HEADER tt_face_load_colr(TT_Face face, FT_Stream stream)
tt_face_get_colr_layer(TT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_UInt *acolor_index, FT_LayerIterator *iterator)
tt_face_colr_blend_layer(TT_Face face, FT_UInt color_index, FT_GlyphSlot dstSlot, FT_GlyphSlot srcSlot)
FT_BEGIN_HEADER tt_face_load_cpal(TT_Face face, FT_Stream stream)
tt_face_palette_set(TT_Face face, FT_UInt palette_index)
tt_face_free_cpal(TT_Face face)
tt_face_get_kerning(TT_Face face, FT_UInt left_glyph, FT_UInt right_glyph)
tt_face_load_kern(TT_Face face, FT_Stream stream)
tt_face_free_name(TT_Face face)
tt_face_load_post(TT_Face face, FT_Stream stream)
tt_face_load_pclt(TT_Face face, FT_Stream stream)
tt_face_load_gasp(TT_Face face, FT_Stream stream)
tt_face_load_font_dir(TT_Face face, FT_Stream stream)
tt_face_load_head(TT_Face face, FT_Stream stream)
tt_face_load_os2(TT_Face face, FT_Stream stream)
tt_face_load_maxp(TT_Face face, FT_Stream stream)
tt_face_load_any(TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
tt_face_goto_table(TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong *length)
tt_face_load_cmap(TT_Face face, FT_Stream stream)
tt_face_load_name(TT_Face face, FT_Stream stream)
tt_face_get_metrics(TT_Face face, FT_Bool vertical, FT_UInt gindex, FT_Short *abearing, FT_UShort *aadvance)
tt_face_load_hhea(TT_Face face, FT_Stream stream, FT_Bool vertical)
tt_face_load_hmtx(TT_Face face, FT_Stream stream, FT_Bool vertical)
#define TT_NAME_ID_TYPOGRAPHIC_FAMILY
#define TT_NAME_ID_VARIATIONS_PREFIX
#define TT_NAME_ID_PS_NAME
tt_face_free_ps_names(TT_Face face)
FT_BEGIN_HEADER tt_face_get_ps_name(TT_Face face, FT_UInt idx, FT_String **PSname)
tt_face_load_sbit_image(TT_Face face, FT_ULong strike_index, FT_UInt glyph_index, FT_UInt load_flags, FT_Stream stream, FT_Bitmap *map, TT_SBit_MetricsRec *metrics)
tt_face_set_sbit_strike(TT_Face face, FT_Size_Request req, FT_ULong *astrike_index)
tt_face_load_strike_metrics(TT_Face face, FT_ULong strike_index, FT_Size_Metrics *metrics)
FT_BEGIN_HEADER tt_face_load_sbit(TT_Face face, FT_Stream stream)
tt_face_free_sbit(TT_Face face)
enum FT_Sfnt_Tag_ FT_Sfnt_Tag
struct TT_FaceRec_ * TT_Face
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out