21 #include FT_INTERNAL_DEBUG_H 22 #include FT_INTERNAL_CALC_H 23 #include FT_INTERNAL_STREAM_H 25 #include FT_TRUETYPE_IDS_H 26 #include FT_TRUETYPE_TAGS_H 27 #include FT_INTERNAL_SFNT_H 28 #include FT_CFF_DRIVER_H 45 #define FT_COMPONENT trace_cffobjs 89 funcs = cff_size_get_globals_funcs( size );
95 funcs->
destroy( internal->topfont );
97 for ( i = font->num_subfonts; i > 0; i-- )
98 funcs->
destroy( internal->subfonts[i - 1] );
120 for ( n = 0; n <
count; n++ )
124 for ( n = 0; n <
count; n++ )
128 for ( n = 0; n <
count; n++ )
132 for ( n = 0; n <
count; n++ )
143 for ( n = 0; n <
count; n++ )
147 for ( n = 0; n <
count; n++ )
171 FT_Memory memory = cffsize->face->memory;
179 cff_make_private_dict( &font->top_font, &priv );
180 error = funcs->
create( cffsize->face->memory, &priv,
181 &internal->topfont );
185 for ( i = font->num_subfonts; i > 0; i-- )
190 cff_make_private_dict( sub, &priv );
191 error = funcs->
create( cffsize->face->memory, &priv,
192 &internal->subfonts[i - 1] );
207 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS 221 funcs = cff_size_get_globals_funcs( cffsize );
229 FT_ULong top_upm = font->top_font.font_dict.units_per_em;
237 for (
i = font->num_subfonts;
i > 0;
i-- )
244 if ( top_upm != sub_upm )
256 x_scale, y_scale, 0, 0 );
274 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS 283 if ( sfnt->set_sbit_strike( cffface, req, &strike_index ) )
286 return cff_size_select( size, strike_index );
293 funcs = cff_size_get_globals_funcs( cffsize );
301 FT_ULong top_upm = font->top_font.font_dict.units_per_em;
309 for (
i = font->num_subfonts;
i > 0;
i-- )
316 if ( top_upm != sub_upm )
328 x_scale, y_scale, 0, 0 );
345 slot->internal->glyph_hints = 0;
370 slot->internal->glyph_hints = (
void*)funcs;
412 while ( continue_search )
414 if ( length >= 7 && name[6] ==
'+' )
416 for ( idx = 0; idx < 6; idx++ )
419 if ( !(
'A' <= name[idx] && name[idx] <=
'Z' ) )
423 if ( continue_search )
425 for ( idx = 7; idx <
length; idx++ )
426 name[idx - 7] = name[idx];
442 FT_Int32 family_name_length, style_name_length;
446 style_name_length = strlen( style_name );
448 if ( family_name_length > style_name_length )
453 for ( idx = 1; idx <= style_name_length; ++
idx )
456 style_name[style_name_length - idx] )
460 if ( idx > style_name_length )
463 idx = family_name_length - style_name_length - 1;
491 FT_Service_PsCMaps psnames;
502 FT_ERROR((
"cff_face_init: cannot access `sfnt' module\n" ));
510 library,
"pshinter" );
524 FT_TRACE2((
" not an OpenType/CFF font\n" ));
530 if ( face_index < 0 )
589 cffface->face_index = face_index;
604 " cannot open CFF & CEF fonts\n" 606 " without the `PSNames' module\n" ));
611 #ifdef FT_DEBUG_LEVEL_TRACE 620 for ( idx = 0; idx < cff->
num_strings + 390; idx++ )
647 if ( temp != 0x10000L )
714 if ( temp != 0x10000L )
732 char* style_name =
NULL;
748 cffface->bbox.xMax = ( dict->
font_bbox.
xMax + 0xFFFF ) >> 16;
749 cffface->bbox.yMax = ( dict->
font_bbox.
yMax + 0xFFFF ) >> 16;
753 cffface->ascender = (
FT_Short)( cffface->bbox.yMax );
754 cffface->descender = (
FT_Short)( cffface->bbox.yMin );
756 cffface->height = (
FT_Short)( ( cffface->units_per_EM * 12 ) / 10 );
757 if ( cffface->height < cffface->ascender - cffface->descender )
758 cffface->height = (
FT_Short)( cffface->ascender - cffface->descender );
760 cffface->underline_position =
762 cffface->underline_thickness =
767 if ( cffface->family_name )
772 char* family = cffface->family_name;
776 remove_subset_prefix( cffface->family_name );
788 if ( full && family )
793 if ( *fullp == *family )
801 if ( *fullp ==
' ' || *fullp ==
'-' )
808 if ( *family ==
' ' || *family ==
'-' )
814 if ( !*family && *fullp )
820 style_name = cff_strcpy( memory, fullp );
823 remove_style( cffface->family_name, style_name );
831 char *cid_font_name =
838 cffface->family_name = cff_strcpy( memory, cid_font_name );
842 cffface->style_name = style_name;
845 cffface->style_name = cff_strcpy( memory, (
char *)
"Regular" );
865 if ( face->kern_pairs )
869 cffface->face_flags =
flags;
893 if ( !
ft_strncmp( cffface->style_name,
"Bold", 4 ) ||
894 !
ft_strncmp( cffface->style_name,
"Black", 5 ) )
897 cffface->style_flags =
flags;
901 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES 927 for ( nn = 0; nn < (
FT_UInt)cffface->num_charmaps; nn++ )
929 cmap = cffface->charmaps[nn];
946 #ifdef FT_MAX_CHARMAP_CACHEABLE 947 if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE )
949 FT_ERROR((
"cff_face_init: no Unicode cmap is found, " 950 "and too many subtables (%d) to add synthesized cmap\n",
957 cmaprec.
face = cffface;
960 cmaprec.
encoding = FT_ENCODING_UNICODE;
962 nn = (
FT_UInt)cffface->num_charmaps;
972 if ( cffface->charmap ==
NULL && nn != (
FT_UInt)cffface->num_charmaps )
973 cffface->charmap = cffface->charmaps[nn];
976 #ifdef FT_MAX_CHARMAP_CACHEABLE
977 if ( nn > FT_MAX_CHARMAP_CACHEABLE )
979 FT_ERROR((
"cff_face_init: Unicode cmap is found, " 980 "but too many preceding subtables (%d) to access\n",
985 if ( encoding->
count > 0 )
990 cmaprec.
face = cffface;
993 if ( encoding->
offset == 0 )
996 cmaprec.
encoding = FT_ENCODING_ADOBE_STANDARD;
999 else if ( encoding->
offset == 1 )
1002 cmaprec.
encoding = FT_ENCODING_ADOBE_EXPERT;
1008 cmaprec.
encoding = FT_ENCODING_ADOBE_CUSTOM;
1033 memory = cffface->memory;
FT_UShort standard_width[1]
GLenum GLuint GLenum GLsizei length
PSH_Globals_SetScaleFunc set_scale
cff_font_done(CFF_Font font)
cff_face_init(FT_Stream stream, FT_Face cffface, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
TT_Init_Face_Func init_face
FT_DivFix(FT_Long a, FT_Long b)
cff_index_get_name(CFF_Font font, FT_UInt element)
SFNT_Interface * SFNT_Service
#define CFF_CMAP_UNICODE_CLASS_REC_GET
FT_BEGIN_HEADER typedef signed long FT_Pos
FT_Select_Metrics(FT_Face face, FT_ULong strike_index)
#define TT_ADOBE_ID_STANDARD
#define FT_MEM_ZERO(dest, count)
#define FT_FACE_FLAG_CID_KEYED
PSHinter_Interface * PSHinter_Service
FT_Fixed underline_position
cff_size_init(FT_Size cffsize)
#define FT_FACE_FLAG_SCALABLE
return FT_THROW(Missing_Property)
GLsizei GLsizei GLchar * source
struct CFF_FontRec_ * CFF_Font
CFF_SubFont subfonts[CFF_MAX_CID_FONTS]
PSHinter_Service pshinter
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
PSH_Globals_NewFunc create
FT_Fixed underline_thickness
struct FT_Size_InternalRec_ * FT_Size_Internal
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
#define TT_PLATFORM_MICROSOFT
FT_Byte num_family_other_blues
TT_Loader_GotoTableFunc goto_table
FT_UShort standard_height[1]
FT_Pos family_other_blues[10]
PSH_Globals_DestroyFunc destroy
return cff_index_get_sid_string(cff, sid)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
FT_Service_PsCMaps psnames
GLenum GLuint GLint GLenum face
TT_Done_Face_Func done_face
#define FT_ERROR(varformat)
cff_driver_done(FT_Module module)
#define FT_CFF_HINTING_FREETYPE
#define FT_STYLE_FLAG_BOLD
struct CFF_InternalRec_ * CFF_Internal
FT_Size_Internal internal
#define FT_TRACE4(varformat)
#define TT_ADOBE_ID_CUSTOM
CFF_FontRecDictRec font_dict
#define FT_FACE_FLAG_SFNT
#define FT_FACE_FLAG_FIXED_WIDTH
cff_driver_init(FT_Module module)
FT_Request_Metrics(FT_Face face, FT_Size_Request req)
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
#define TT_ADOBE_ID_EXPERT
#define FT_HAS_FIXED_SIZES(face)
#define FT_FACE_FLAG_HORIZONTAL
#define FT_TRACE2(varformat)
#define TT_PLATFORM_ADOBE
CFF_PrivateRec private_dict
cff_slot_init(FT_GlyphSlot slot)
struct CFF_SizeRec_ * CFF_Size
TT_Load_Face_Func load_face
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
TT_Load_Table_Func load_cmap
#define FT_FACE_FLAG_HINTER
FT_Vector_Transform_Scaled(FT_Vector *vector, const FT_Matrix *matrix, FT_Long scaling)
#define FT_STREAM_SEEK(position)
GLuint const GLchar * name
if(!abbox) return FT_THROW(Invalid_Argument)
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
#define CFF_CMAP_ENCODING_CLASS_REC_GET
GLenum const GLfloat * params
FT_Short family_blues[14]
GLdouble GLdouble GLdouble GLdouble top
typedefFT_BEGIN_HEADER struct CFF_DriverRec_ * CFF_Driver
cff_slot_done(FT_GlyphSlot slot)
FT_Matrix_Multiply_Scaled(const FT_Matrix *a, FT_Matrix *b, FT_Long scaling)
#define FT_FACE_FLAG_KERNING
FT_Short snap_heights[13]
FT_Get_Module(FT_Library library, const char *module_name)
cff_size_done(FT_Size cffsize)
#define TT_PLATFORM_APPLE_UNICODE
GLuint GLuint GLsizei count
CFF_IndexRec charstrings_index
FT_Get_Module_Interface(FT_Library library, const char *mod_name)
PSH_Globals_Funcs(* get_globals_funcs)(FT_Module module)
#define TT_MS_ID_UNICODE_CS
FT_Byte num_family_other_blues
cff_size_request(FT_Size size, FT_Size_Request req)
#define FT_STRDUP(dst, str)
FT_Short family_other_blues[10]
T1_FIELD_DICT_FONTDICT family_name
#define FT_STYLE_FLAG_ITALIC
cff_face_done(FT_Face cffface)
GLuint GLuint GLfloat weight
#define FT_FACE_FLAG_GLYPH_NAMES
cff_font_load(FT_Library library, FT_Stream stream, FT_Int face_index, CFF_Font font, FT_Bool pure_cff)
T2_Hints_Funcs(* get_t2_funcs)(FT_Module module)