ReactOS  0.4.14-dev-317-g96040ec
ftobjs.c File Reference
#include <ft2build.h>
Include dependency graph for ftobjs.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GRID_FIT_METRICS
 
#define FT_COMPONENT   trace_objs
 
#define FREETYPE_VER_FIXED
 

Functions

static FT_Error ft_open_face_internal (FT_Library library, const FT_Open_Args *args, FT_Long face_index, FT_Face *aface, FT_Bool test_mac_fonts)
 
 ft_service_list_lookup (FT_ServiceDesc service_descriptors, const char *service_id)
 
 ft_validator_init (FT_Validator valid, const FT_Byte *base, const FT_Byte *limit, FT_ValidationLevel level)
 
 ft_validator_run (FT_Validator valid)
 
 ft_validator_error (FT_Validator valid, FT_Error error)
 
 FT_Stream_New (FT_Library library, const FT_Open_Args *args, FT_Stream *astream)
 
 FT_Stream_Free (FT_Stream stream, FT_Int external)
 
static FT_Error ft_glyphslot_init (FT_GlyphSlot slot)
 
 ft_glyphslot_free_bitmap (FT_GlyphSlot slot)
 
 ft_glyphslot_preset_bitmap (FT_GlyphSlot slot, FT_Render_Mode mode, const FT_Vector *origin)
 
 ft_glyphslot_set_bitmap (FT_GlyphSlot slot, FT_Byte *buffer)
 
 ft_glyphslot_alloc_bitmap (FT_GlyphSlot slot, FT_ULong size)
 
static void ft_glyphslot_clear (FT_GlyphSlot slot)
 
static void ft_glyphslot_done (FT_GlyphSlot slot)
 
 FT_New_GlyphSlot (FT_Face face, FT_GlyphSlot *aslot)
 
 FT_Done_GlyphSlot (FT_GlyphSlot slot)
 
 FT_Set_Transform (FT_Face face, FT_Matrix *matrix, FT_Vector *delta)
 
static FT_Renderer ft_lookup_glyph_renderer (FT_GlyphSlot slot)
 
static void ft_glyphslot_grid_fit_metrics (FT_GlyphSlot slot, FT_Bool vertical)
 
 FT_Load_Glyph (FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
 
 FT_Load_Char (FT_Face face, FT_ULong char_code, FT_Int32 load_flags)
 
static void destroy_size (FT_Memory memory, FT_Size size, FT_Driver driver)
 
static void ft_cmap_done_internal (FT_CMap cmap)
 
static void destroy_charmaps (FT_Face face, FT_Memory memory)
 
static void destroy_face (FT_Memory memory, FT_Face face, FT_Driver driver)
 
static void Destroy_Driver (FT_Driver driver)
 
static FT_Error find_unicode_charmap (FT_Face face)
 
static FT_CharMap find_variant_selector_charmap (FT_Face face)
 
static FT_Error open_face (FT_Driver driver, FT_Stream *astream, FT_Bool external_stream, FT_Long face_index, FT_Int num_params, FT_Parameter *params, FT_Face *aface)
 
 FT_New_Face (FT_Library library, const char *pathname, FT_Long face_index, FT_Face *aface)
 
 FT_New_Memory_Face (FT_Library library, const FT_Byte *file_base, FT_Long file_size, FT_Long face_index, FT_Face *aface)
 
 FT_Open_Face (FT_Library library, const FT_Open_Args *args, FT_Long face_index, FT_Face *aface)
 
 FT_Attach_File (FT_Face face, const char *filepathname)
 
 FT_Attach_Stream (FT_Face face, FT_Open_Args *parameters)
 
 FT_Reference_Face (FT_Face face)
 
 FT_Done_Face (FT_Face face)
 
 FT_New_Size (FT_Face face, FT_Size *asize)
 
 FT_Done_Size (FT_Size size)
 
 FT_Match_Size (FT_Face face, FT_Size_Request req, FT_Bool ignore_width, FT_ULong *size_index)
 
 ft_synthesize_vertical_metrics (FT_Glyph_Metrics *metrics, FT_Pos advance)
 
static void ft_recompute_scaled_metrics (FT_Face face, FT_Size_Metrics *metrics)
 
 FT_Select_Metrics (FT_Face face, FT_ULong strike_index)
 
 FT_Request_Metrics (FT_Face face, FT_Size_Request req)
 
 FT_Select_Size (FT_Face face, FT_Int strike_index)
 
 FT_Request_Size (FT_Face face, FT_Size_Request req)
 
 FT_Set_Char_Size (FT_Face face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution)
 
 FT_Set_Pixel_Sizes (FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height)
 
 FT_Get_Kerning (FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning)
 
 FT_Get_Track_Kerning (FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed *akerning)
 
 FT_Select_Charmap (FT_Face face, FT_Encoding encoding)
 
 FT_Set_Charmap (FT_Face face, FT_CharMap charmap)
 
 FT_Get_Charmap_Index (FT_CharMap charmap)
 
 FT_CMap_Done (FT_CMap cmap)
 
 FT_CMap_New (FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
 
 FT_Get_Char_Index (FT_Face face, FT_ULong charcode)
 
 FT_Get_First_Char (FT_Face face, FT_UInt *agindex)
 
 FT_Get_Next_Char (FT_Face face, FT_ULong charcode, FT_UInt *agindex)
 
 FT_Face_Properties (FT_Face face, FT_UInt num_properties, FT_Parameter *properties)
 
 FT_Face_GetCharVariantIndex (FT_Face face, FT_ULong charcode, FT_ULong variantSelector)
 
 FT_Face_GetCharVariantIsDefault (FT_Face face, FT_ULong charcode, FT_ULong variantSelector)
 
 FT_Face_GetVariantSelectors (FT_Face face)
 
 FT_Face_GetVariantsOfChar (FT_Face face, FT_ULong charcode)
 
 FT_Face_GetCharsOfVariant (FT_Face face, FT_ULong variantSelector)
 
 FT_Get_Name_Index (FT_Face face, FT_String *glyph_name)
 
 FT_Get_Glyph_Name (FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max)
 
 FT_Get_Postscript_Name (FT_Face face)
 
 FT_Get_Sfnt_Table (FT_Face face, FT_Sfnt_Tag tag)
 
 FT_Load_Sfnt_Table (FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
 
 FT_Sfnt_Table_Info (FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length)
 
 FT_Get_CMap_Language_ID (FT_CharMap charmap)
 
 FT_Get_CMap_Format (FT_CharMap charmap)
 
 FT_Activate_Size (FT_Size size)
 
 FT_Lookup_Renderer (FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
 
static void ft_set_current_renderer (FT_Library library)
 
static FT_Error ft_add_renderer (FT_Module module)
 
static void ft_remove_renderer (FT_Module module)
 
 FT_Get_Renderer (FT_Library library, FT_Glyph_Format format)
 
 FT_Set_Renderer (FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter *parameters)
 
 FT_Render_Glyph_Internal (FT_Library library, FT_GlyphSlot slot, FT_Render_Mode render_mode)
 
 FT_Render_Glyph (FT_GlyphSlot slot, FT_Render_Mode render_mode)
 
static void Destroy_Module (FT_Module module)
 
 FT_Add_Module (FT_Library library, const FT_Module_Class *clazz)
 
 FT_Get_Module (FT_Library library, const char *module_name)
 
 FT_Get_Module_Interface (FT_Library library, const char *mod_name)
 
 ft_module_get_service (FT_Module module, const char *service_id, FT_Bool global)
 
 FT_Remove_Module (FT_Library library, FT_Module module)
 
static FT_Error ft_property_do (FT_Library library, const FT_String *module_name, const FT_String *property_name, void *value, FT_Bool set, FT_Bool value_is_string)
 
 FT_Property_Set (FT_Library library, const FT_String *module_name, const FT_String *property_name, const void *value)
 
 FT_Property_Get (FT_Library library, const FT_String *module_name, const FT_String *property_name, void *value)
 
 FT_Reference_Library (FT_Library library)
 
 FT_New_Library (FT_Memory memory, FT_Library *alibrary)
 
 FT_Library_Version (FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch)
 
 FT_Done_Library (FT_Library library)
 
 FT_Set_Debug_Hook (FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook)
 
 FT_Get_TrueType_Engine_Type (FT_Library library)
 
 FT_Get_SubGlyph_Info (FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform)
 

Macro Definition Documentation

◆ FREETYPE_VER_FIXED

#define FREETYPE_VER_FIXED
Value:
( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \
FREETYPE_MINOR )
signed long FT_Long
Definition: fttypes.h:242
#define FREETYPE_MAJOR
Definition: freetype.h:4553

◆ FT_COMPONENT

#define FT_COMPONENT   trace_objs

Definition at line 269 of file ftobjs.c.

◆ GRID_FIT_METRICS

#define GRID_FIT_METRICS

Definition at line 85 of file ftobjs.c.

Function Documentation

◆ destroy_charmaps()

static void destroy_charmaps ( FT_Face  face,
FT_Memory  memory 
)
static

Definition at line 1079 of file ftobjs.c.

1081  {
1082  FT_Int n;
1083 
1084 
1085  if ( !face )
1086  return;
1087 
1088  for ( n = 0; n < face->num_charmaps; n++ )
1089  {
1090  FT_CMap cmap = FT_CMAP( face->charmaps[n] );
1091 
1092 
1093  ft_cmap_done_internal( cmap );
1094 
1095  face->charmaps[n] = NULL;
1096  }
1097 
1098  FT_FREE( face->charmaps );
1099  face->num_charmaps = 0;
1100  }
signed int FT_Int
Definition: fttypes.h:220
GLdouble n
Definition: glext.h:7729
#define FT_CMAP(x)
Definition: ftobjs.h:159
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
static void ft_cmap_done_internal(FT_CMap cmap)
Definition: ftobjs.c:3553
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by destroy_face(), and open_face().

◆ Destroy_Driver()

static void Destroy_Driver ( FT_Driver  driver)
static

Definition at line 1156 of file ftobjs.c.

1157  {
1158  FT_List_Finalize( &driver->faces_list,
1160  driver->root.memory,
1161  driver );
1162  }
static void destroy_face(FT_Memory memory, FT_Face face, FT_Driver driver)
Definition: ftobjs.c:1105
FT_List_Finalize(FT_List list, FT_List_Destructor destroy, FT_Memory memory, void *user)
Definition: ftutil.c:413
void(* FT_List_Destructor)(FT_Memory memory, void *data, void *user)
Definition: ftlist.h:234
struct @1625::@1626 driver

Referenced by Destroy_Module().

◆ destroy_face()

static void destroy_face ( FT_Memory  memory,
FT_Face  face,
FT_Driver  driver 
)
static

Definition at line 1105 of file ftobjs.c.

1108  {
1109  FT_Driver_Class clazz = driver->clazz;
1110 
1111 
1112  /* discard auto-hinting data */
1113  if ( face->autohint.finalizer )
1114  face->autohint.finalizer( face->autohint.data );
1115 
1116  /* Discard glyph slots for this face. */
1117  /* Beware! FT_Done_GlyphSlot() changes the field `face->glyph' */
1118  while ( face->glyph )
1119  FT_Done_GlyphSlot( face->glyph );
1120 
1121  /* discard all sizes for this face */
1122  FT_List_Finalize( &face->sizes_list,
1124  memory,
1125  driver );
1126  face->size = NULL;
1127 
1128  /* now discard client data */
1129  if ( face->generic.finalizer )
1130  face->generic.finalizer( face );
1131 
1132  /* discard charmaps */
1134 
1135  /* finalize format-specific stuff */
1136  if ( clazz->done_face )
1137  clazz->done_face( face );
1138 
1139  /* close the stream for this face if needed */
1141  face->stream,
1142  ( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
1143 
1144  face->stream = NULL;
1145 
1146  /* get rid of it */
1147  if ( face->internal )
1148  {
1149  FT_FREE( face->internal );
1150  }
1151  FT_FREE( face );
1152  }
FT_List_Finalize(FT_List list, FT_List_Destructor destroy, FT_Memory memory, void *user)
Definition: ftutil.c:413
void(* FT_List_Destructor)(FT_Memory memory, void *data, void *user)
Definition: ftlist.h:234
static char memory[1024 *256]
Definition: process.c:116
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
static void destroy_charmaps(FT_Face face, FT_Memory memory)
Definition: ftobjs.c:1079
#define FT_FACE_FLAG_EXTERNAL_STREAM
Definition: freetype.h:1248
FT_Done_GlyphSlot(FT_GlyphSlot slot)
Definition: ftobjs.c:612
FT_Stream_Free(FT_Stream stream, FT_Int external)
Definition: ftobjs.c:246
static void destroy_size(FT_Memory memory, FT_Size size, FT_Driver driver)
Definition: ftobjs.c:1057
struct @1625::@1626 driver
FT_Face_DoneFunc done_face
Definition: ftdrv.h:166
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by Destroy_Driver(), FT_Done_Face(), and ft_open_face_internal().

◆ Destroy_Module()

static void Destroy_Module ( FT_Module  module)
static

Definition at line 4694 of file ftobjs.c.

4695  {
4696  FT_Memory memory = module->memory;
4697  FT_Module_Class* clazz = module->clazz;
4698  FT_Library library = module->library;
4699 
4700 
4701  if ( library && library->auto_hinter == module )
4703 
4704  /* if the module is a renderer */
4705  if ( FT_MODULE_IS_RENDERER( module ) )
4707 
4708  /* if the module is a font driver, add some steps */
4709  if ( FT_MODULE_IS_DRIVER( module ) )
4711 
4712  /* finalize the module object */
4713  if ( clazz->module_done )
4714  clazz->module_done( module );
4715 
4716  /* discard it */
4717  FT_FREE( module );
4718  }
static void ft_remove_renderer(FT_Module module)
Definition: ftobjs.c:4380
#define FT_DRIVER(x)
Definition: ftobjs.h:799
FT_Library library
Definition: cffdrivr.c:654
static char memory[1024 *256]
Definition: process.c:116
FT_Module auto_hinter
Definition: ftobjs.h:929
smooth NULL
Definition: ftsmooth.c:416
#define FT_MODULE_IS_DRIVER(x)
Definition: ftobjs.h:550
#define FT_FREE(ptr)
Definition: ftmemory.h:329
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
static void Destroy_Driver(FT_Driver driver)
Definition: ftobjs.c:1156
#define FT_MODULE_IS_RENDERER(x)
Definition: ftobjs.h:553
FT_Module_Destructor module_done
Definition: ftmodapi.h:228

Referenced by FT_Done_Library(), and FT_Remove_Module().

◆ destroy_size()

static void destroy_size ( FT_Memory  memory,
FT_Size  size,
FT_Driver  driver 
)
static

Definition at line 1057 of file ftobjs.c.

1060  {
1061  /* finalize client-specific data */
1062  if ( size->generic.finalizer )
1063  size->generic.finalizer( size );
1064 
1065  /* finalize format-specific stuff */
1066  if ( driver->clazz->done_size )
1067  driver->clazz->done_size( size );
1068 
1069  FT_FREE( size->internal );
1070  FT_FREE( size );
1071  }
#define FT_FREE(ptr)
Definition: ftmemory.h:329
GLsizeiptr size
Definition: glext.h:5919
struct @1625::@1626 driver

Referenced by destroy_face(), and FT_Done_Size().

◆ find_unicode_charmap()

static FT_Error find_unicode_charmap ( FT_Face  face)
static

Definition at line 1180 of file ftobjs.c.

1181  {
1182  FT_CharMap* first;
1183  FT_CharMap* cur;
1184 
1185 
1186  /* caller should have already checked that `face' is valid */
1187  FT_ASSERT( face );
1188 
1189  first = face->charmaps;
1190 
1191  if ( !first )
1192  return FT_THROW( Invalid_CharMap_Handle );
1193 
1194  /*
1195  * The original TrueType specification(s) only specified charmap
1196  * formats that are capable of mapping 8 or 16 bit character codes to
1197  * glyph indices.
1198  *
1199  * However, recent updates to the Apple and OpenType specifications
1200  * introduced new formats that are capable of mapping 32-bit character
1201  * codes as well. And these are already used on some fonts, mainly to
1202  * map non-BMP Asian ideographs as defined in Unicode.
1203  *
1204  * For compatibility purposes, these fonts generally come with
1205  * *several* Unicode charmaps:
1206  *
1207  * - One of them in the "old" 16-bit format, that cannot access
1208  * all glyphs in the font.
1209  *
1210  * - Another one in the "new" 32-bit format, that can access all
1211  * the glyphs.
1212  *
1213  * This function has been written to always favor a 32-bit charmap
1214  * when found. Otherwise, a 16-bit one is returned when found.
1215  */
1216 
1217  /* Since the `interesting' table, with IDs (3,10), is normally the */
1218  /* last one, we loop backwards. This loses with type1 fonts with */
1219  /* non-BMP characters (<.0001%), this wins with .ttf with non-BMP */
1220  /* chars (.01% ?), and this is the same about 99.99% of the time! */
1221 
1222  cur = first + face->num_charmaps; /* points after the last one */
1223 
1224  for ( ; --cur >= first; )
1225  {
1226  if ( cur[0]->encoding == FT_ENCODING_UNICODE )
1227  {
1228  /* XXX If some new encodings to represent UCS-4 are added, */
1229  /* they should be added here. */
1230  if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT &&
1231  cur[0]->encoding_id == TT_MS_ID_UCS_4 ) ||
1232  ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
1233  cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) )
1234  {
1235  face->charmap = cur[0];
1236  return FT_Err_Ok;
1237  }
1238  }
1239  }
1240 
1241  /* We do not have any UCS-4 charmap. */
1242  /* Do the loop again and search for UCS-2 charmaps. */
1243  cur = first + face->num_charmaps;
1244 
1245  for ( ; --cur >= first; )
1246  {
1247  if ( cur[0]->encoding == FT_ENCODING_UNICODE )
1248  {
1249  face->charmap = cur[0];
1250  return FT_Err_Ok;
1251  }
1252  }
1253 
1254  return FT_THROW( Invalid_CharMap_Handle );
1255  }
const GLint * first
Definition: glext.h:5794
return FT_Err_Ok
Definition: ftbbox.c:511
#define TT_PLATFORM_MICROSOFT
Definition: font.c:1174
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
#define TT_PLATFORM_APPLE_UNICODE
Definition: font.c:1172
#define TT_MS_ID_UCS_4
Definition: ttnameid.h:255
#define TT_APPLE_ID_UNICODE_32
Definition: ttnameid.h:132
ed encoding
Definition: write.c:2839
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FT_Select_Charmap(), and open_face().

◆ find_variant_selector_charmap()

static FT_CharMap find_variant_selector_charmap ( FT_Face  face)
static

Definition at line 1268 of file ftobjs.c.

1269  {
1270  FT_CharMap* first;
1271  FT_CharMap* end;
1272  FT_CharMap* cur;
1273 
1274 
1275  /* caller should have already checked that `face' is valid */
1276  FT_ASSERT( face );
1277 
1278  first = face->charmaps;
1279 
1280  if ( !first )
1281  return NULL;
1282 
1283  end = first + face->num_charmaps; /* points after the last one */
1284 
1285  for ( cur = first; cur < end; cur++ )
1286  {
1287  if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
1288  cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR &&
1289  FT_Get_CMap_Format( cur[0] ) == 14 )
1290  return cur[0];
1291  }
1292 
1293  return NULL;
1294  }
const GLint * first
Definition: glext.h:5794
GLuint GLuint end
Definition: gl.h:1545
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
#define TT_PLATFORM_APPLE_UNICODE
Definition: font.c:1172
smooth NULL
Definition: ftsmooth.c:416
#define TT_APPLE_ID_VARIANT_SELECTOR
Definition: ttnameid.h:133
FT_Get_CMap_Format(FT_CharMap charmap)
Definition: ftobjs.c:4206
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FT_Face_GetCharsOfVariant(), FT_Face_GetCharVariantIndex(), FT_Face_GetCharVariantIsDefault(), FT_Face_GetVariantSelectors(), and FT_Face_GetVariantsOfChar().

◆ FT_Activate_Size()

FT_Activate_Size ( FT_Size  size)

Definition at line 4230 of file ftobjs.c.

4231  {
4232  FT_Face face;
4233 
4234 
4235  if ( !size )
4236  return FT_THROW( Invalid_Size_Handle );
4237 
4238  face = size->face;
4239  if ( !face || !face->driver )
4240  return FT_THROW( Invalid_Face_Handle );
4241 
4242  /* we don't need anything more complex than that; all size objects */
4243  /* are already listed by the face */
4244  face->size = size;
4245 
4246  return FT_Err_Ok;
4247  }
WORD face[3]
Definition: mesh.c:4747
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_THROW(e)
Definition: ftdebug.h:213
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by ftc_scaler_lookup_size(), ftc_size_node_compare(), T42_Size_Init(), T42_Size_Request(), and T42_Size_Select().

◆ FT_Add_Module()

FT_Add_Module ( FT_Library  library,
const FT_Module_Class clazz 
)

Definition at line 4724 of file ftobjs.c.

4726  {
4727  FT_Error error;
4728  FT_Memory memory;
4729  FT_Module module = NULL;
4730  FT_UInt nn;
4731 
4732 
4733 #define FREETYPE_VER_FIXED ( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \
4734  FREETYPE_MINOR )
4735 
4736  if ( !library )
4737  return FT_THROW( Invalid_Library_Handle );
4738 
4739  if ( !clazz )
4740  return FT_THROW( Invalid_Argument );
4741 
4742  /* check FreeType version */
4743  if ( clazz->module_requires > FREETYPE_VER_FIXED )
4744  return FT_THROW( Invalid_Version );
4745 
4746  /* look for a module with the same name in the library's table */
4747  for ( nn = 0; nn < library->num_modules; nn++ )
4748  {
4749  module = library->modules[nn];
4750  if ( ft_strcmp( module->clazz->module_name, clazz->module_name ) == 0 )
4751  {
4752  /* this installed module has the same name, compare their versions */
4753  if ( clazz->module_version <= module->clazz->module_version )
4754  return FT_THROW( Lower_Module_Version );
4755 
4756  /* remove the module from our list, then exit the loop to replace */
4757  /* it by our new version.. */
4759  break;
4760  }
4761  }
4762 
4763  memory = library->memory;
4764  error = FT_Err_Ok;
4765 
4767  {
4768  error = FT_THROW( Too_Many_Drivers );
4769  goto Exit;
4770  }
4771 
4772  /* allocate module object */
4773  if ( FT_ALLOC( module, clazz->module_size ) )
4774  goto Exit;
4775 
4776  /* base initialization */
4777  module->library = library;
4778  module->memory = memory;
4779  module->clazz = (FT_Module_Class*)clazz;
4780 
4781  /* check whether the module is a renderer - this must be performed */
4782  /* before the normal module initialization */
4783  if ( FT_MODULE_IS_RENDERER( module ) )
4784  {
4785  /* add to the renderers list */
4787  if ( error )
4788  goto Fail;
4789  }
4790 
4791  /* is the module a auto-hinter? */
4792  if ( FT_MODULE_IS_HINTER( module ) )
4794 
4795  /* if the module is a font driver */
4796  if ( FT_MODULE_IS_DRIVER( module ) )
4797  {
4799 
4800 
4801  driver->clazz = (FT_Driver_Class)module->clazz;
4802  }
4803 
4804  if ( clazz->module_init )
4805  {
4806  error = clazz->module_init( module );
4807  if ( error )
4808  goto Fail;
4809  }
4810 
4811  /* add module to the library's table */
4813 
4814  Exit:
4815  return error;
4816 
4817  Fail:
4818  if ( FT_MODULE_IS_RENDERER( module ) )
4819  {
4820  FT_Renderer renderer = FT_RENDERER( module );
4821 
4822 
4823  if ( renderer->clazz &&
4824  renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
4825  renderer->raster )
4826  renderer->clazz->raster_class->raster_done( renderer->raster );
4827  }
4828 
4829  FT_FREE( module );
4830  goto Exit;
4831  }
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
#define FREETYPE_VER_FIXED
int FT_Error
Definition: fttypes.h:300
#define FT_DRIVER(x)
Definition: ftobjs.h:799
HMODULE module
Definition: main.cpp:47
FT_Memory memory
Definition: ftobjs.h:918
#define error(str)
Definition: mkdosfs.c:1605
struct FT_Driver_ClassRec_ * FT_Driver_Class
FT_Library library
Definition: cffdrivr.c:654
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
FT_Module_Constructor module_init
Definition: ftmodapi.h:227
FT_Module auto_hinter
Definition: ftobjs.h:929
FT_Renderer_Class * clazz
Definition: ftobjs.h:774
FT_Glyph_Format glyph_format
Definition: ftrender.h:149
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_Raster_Funcs * raster_class
Definition: ftrender.h:156
FT_Raster_DoneFunc raster_done
Definition: ftimage.h:1188
smooth NULL
Definition: ftsmooth.c:416
#define FT_MODULE_IS_DRIVER(x)
Definition: ftobjs.h:550
#define FT_FREE(ptr)
Definition: ftmemory.h:329
FT_Fixed module_requires
Definition: ftmodapi.h:223
FT_UInt num_modules
Definition: ftobjs.h:924
#define FT_MAX_MODULES
Definition: ftoption.h:376
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
Definition: ftsmooth.c:416
static void Exit(void)
Definition: sock.c:1331
FT_Long module_size
Definition: ftmodapi.h:220
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_Module modules[FT_MAX_MODULES]
Definition: ftobjs.h:925
Definition: hiveinit.c:368
static FT_Error ft_add_renderer(FT_Module module)
Definition: ftobjs.c:4332
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_RENDERER(x)
Definition: ftobjs.h:765
#define FT_MODULE_IS_RENDERER(x)
Definition: ftobjs.h:553
const FT_String * module_name
Definition: ftmodapi.h:221
#define FT_MODULE_IS_HINTER(x)
Definition: ftobjs.h:556
FT_Fixed module_version
Definition: ftmodapi.h:222
struct @1625::@1626 driver
FT_Raster raster
Definition: ftobjs.h:778
#define ft_strcmp
Definition: ftstdlib.h:86
FT_Remove_Module(FT_Library library, FT_Module module)
Definition: ftobjs.c:4927

Referenced by FT_Add_Default_Modules().

◆ ft_add_renderer()

static FT_Error ft_add_renderer ( FT_Module  module)
static

Definition at line 4332 of file ftobjs.c.

4333  {
4334  FT_Library library = module->library;
4336  FT_Error error;
4337  FT_ListNode node = NULL;
4338 
4339 
4340  if ( FT_NEW( node ) )
4341  goto Exit;
4342 
4343  {
4345  FT_Renderer_Class* clazz = (FT_Renderer_Class*)module->clazz;
4346 
4347 
4348  render->clazz = clazz;
4349  render->glyph_format = clazz->glyph_format;
4350 
4351  /* allocate raster object if needed */
4352  if ( clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
4353  clazz->raster_class->raster_new )
4354  {
4355  error = clazz->raster_class->raster_new( memory, &render->raster );
4356  if ( error )
4357  goto Fail;
4358 
4359  render->raster_render = clazz->raster_class->raster_render;
4360  render->render = clazz->render_glyph;
4361  }
4362 
4363  /* add to list */
4364  node->data = module;
4366 
4368  }
4369 
4370  Fail:
4371  if ( error )
4372  FT_FREE( node );
4373 
4374  Exit:
4375  return error;
4376  }
int FT_Error
Definition: fttypes.h:300
HMODULE module
Definition: main.cpp:47
FT_Memory memory
Definition: ftobjs.h:918
#define error(str)
Definition: mkdosfs.c:1605
FT_Library library
Definition: cffdrivr.c:654
static char memory[1024 *256]
Definition: process.c:116
GLvoid * data
Definition: dlist.c:359
FT_Glyph_Format glyph_format
Definition: ftrender.h:149
FT_Raster_Funcs * raster_class
Definition: ftrender.h:156
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
Definition: ftsmooth.c:416
if(!(yy_init))
Definition: macro.lex.yy.c:714
static void Exit(void)
Definition: sock.c:1331
static void render(void)
Definition: ssstars.c:272
FT_Renderer_RenderFunc render_glyph
Definition: ftrender.h:151
FT_Raster_NewFunc raster_new
Definition: ftimage.h:1184
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_List_Add(FT_List list, FT_ListNode node)
Definition: ftutil.c:269
Definition: hiveinit.c:368
FT_Raster_RenderFunc raster_render
Definition: ftimage.h:1187
#define FT_RENDERER(x)
Definition: ftobjs.h:765
#define FT_NEW(ptr)
Definition: ftmemory.h:331
FT_ListRec renderers
Definition: ftobjs.h:927
static void ft_set_current_renderer(FT_Library library)
Definition: ftobjs.c:4321
Definition: dlist.c:348

Referenced by FT_Add_Module().

◆ FT_Attach_File()

FT_Attach_File ( FT_Face  face,
const char filepathname 
)

Definition at line 2641 of file ftobjs.c.

2643  {
2645 
2646 
2647  /* test for valid `face' delayed to `FT_Attach_Stream' */
2648 
2649  if ( !filepathname )
2650  return FT_THROW( Invalid_Argument );
2651 
2652  open.stream = NULL;
2653  open.flags = FT_OPEN_PATHNAME;
2654  open.pathname = (char*)filepathname;
2655 
2656  return FT_Attach_Stream( face, &open );
2657  }
#define FT_OPEN_PATHNAME
Definition: freetype.h:2036
#define open
Definition: acwin.h:95
FT_Attach_Stream(FT_Face face, FT_Open_Args *parameters)
Definition: ftobjs.c:2663
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
TCHAR filepathname[1000]
Definition: main.cpp:52
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Attach_Stream()

FT_Attach_Stream ( FT_Face  face,
FT_Open_Args parameters 
)

Definition at line 2663 of file ftobjs.c.

2665  {
2666  FT_Stream stream;
2667  FT_Error error;
2668  FT_Driver driver;
2669 
2670  FT_Driver_Class clazz;
2671 
2672 
2673  /* test for valid `parameters' delayed to `FT_Stream_New' */
2674 
2675  if ( !face )
2676  return FT_THROW( Invalid_Face_Handle );
2677 
2678  driver = face->driver;
2679  if ( !driver )
2680  return FT_THROW( Invalid_Driver_Handle );
2681 
2682  error = FT_Stream_New( driver->root.library, parameters, &stream );
2683  if ( error )
2684  goto Exit;
2685 
2686  /* we implement FT_Attach_Stream in each driver through the */
2687  /* `attach_file' interface */
2688 
2689  error = FT_ERR( Unimplemented_Feature );
2690  clazz = driver->clazz;
2691  if ( clazz->attach_file )
2692  error = clazz->attach_file( face, stream );
2693 
2694  /* close the attached stream */
2696  (FT_Bool)( parameters->stream &&
2697  ( parameters->flags & FT_OPEN_STREAM ) ) );
2698 
2699  Exit:
2700  return error;
2701  }
int FT_Error
Definition: fttypes.h:300
FT_Stream stream
Definition: freetype.h:2141
#define error(str)
Definition: mkdosfs.c:1605
#define FT_OPEN_STREAM
Definition: freetype.h:2035
FT_UInt flags
Definition: freetype.h:2137
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_ERR(e)
Definition: fttypes.h:586
static void Exit(void)
Definition: sock.c:1331
FT_Face_AttachFunc attach_file
Definition: ftdrv.h:177
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
FT_Stream_Free(FT_Stream stream, FT_Int external)
Definition: ftobjs.c:246
struct @1625::@1626 driver
FT_Stream_New(FT_Library library, const FT_Open_Args *args, FT_Stream *astream)
Definition: ftobjs.c:178
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FT_Attach_File().

◆ FT_CMap_Done()

FT_CMap_Done ( FT_CMap  cmap)

Definition at line 3568 of file ftobjs.c.

3569  {
3570  if ( cmap )
3571  {
3572  FT_Face face = cmap->charmap.face;
3574  FT_Error error;
3575  FT_Int i, j;
3576 
3577 
3578  for ( i = 0; i < face->num_charmaps; i++ )
3579  {
3580  if ( (FT_CMap)face->charmaps[i] == cmap )
3581  {
3582  FT_CharMap last_charmap = face->charmaps[face->num_charmaps - 1];
3583 
3584 
3585  if ( FT_RENEW_ARRAY( face->charmaps,
3586  face->num_charmaps,
3587  face->num_charmaps - 1 ) )
3588  return;
3589 
3590  /* remove it from our list of charmaps */
3591  for ( j = i + 1; j < face->num_charmaps; j++ )
3592  {
3593  if ( j == face->num_charmaps - 1 )
3594  face->charmaps[j - 1] = last_charmap;
3595  else
3596  face->charmaps[j - 1] = face->charmaps[j];
3597  }
3598 
3599  face->num_charmaps--;
3600 
3601  if ( (FT_CMap)face->charmap == cmap )
3602  face->charmap = NULL;
3603 
3604  ft_cmap_done_internal( cmap );
3605 
3606  break;
3607  }
3608  }
3609  }
3610  }
int FT_Error
Definition: fttypes.h:300
FT_Face face
Definition: freetype.h:842
FT_CharMapRec charmap
Definition: ftobjs.h:153
#define error(str)
Definition: mkdosfs.c:1605
signed int FT_Int
Definition: fttypes.h:220
static char memory[1024 *256]
Definition: process.c:116
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
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
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
Definition: glfuncs.h:250
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
Definition: ftmemory.h:336
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
static void ft_cmap_done_internal(FT_CMap cmap)
Definition: ftobjs.c:3553
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ ft_cmap_done_internal()

static void ft_cmap_done_internal ( FT_CMap  cmap)
static

Definition at line 3553 of file ftobjs.c.

3554  {
3555  FT_CMap_Class clazz = cmap->clazz;
3556  FT_Face face = cmap->charmap.face;
3558 
3559 
3560  if ( clazz->done )
3561  clazz->done( cmap );
3562 
3563  FT_FREE( cmap );
3564  }
FT_Face face
Definition: freetype.h:842
FT_CharMapRec charmap
Definition: ftobjs.h:153
FT_CMap_DoneFunc done
Definition: ftobjs.h:215
static char memory[1024 *256]
Definition: process.c:116
#define FT_FREE(ptr)
Definition: ftmemory.h:329
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

Referenced by destroy_charmaps(), FT_CMap_Done(), and FT_CMap_New().

◆ FT_CMap_New()

FT_CMap_New ( FT_CMap_Class  clazz,
FT_Pointer  init_data,
FT_CharMap  charmap,
FT_CMap acmap 
)

Definition at line 3614 of file ftobjs.c.

3618  {
3620  FT_Face face;
3621  FT_Memory memory;
3622  FT_CMap cmap = NULL;
3623 
3624 
3625  if ( !clazz || !charmap || !charmap->face )
3626  return FT_THROW( Invalid_Argument );
3627 
3628  face = charmap->face;
3629  memory = FT_FACE_MEMORY( face );
3630 
3631  if ( !FT_ALLOC( cmap, clazz->size ) )
3632  {
3633  cmap->charmap = *charmap;
3634  cmap->clazz = clazz;
3635 
3636  if ( clazz->init )
3637  {
3638  error = clazz->init( cmap, init_data );
3639  if ( error )
3640  goto Fail;
3641  }
3642 
3643  /* add it to our list of charmaps */
3644  if ( FT_RENEW_ARRAY( face->charmaps,
3645  face->num_charmaps,
3646  face->num_charmaps + 1 ) )
3647  goto Fail;
3648 
3649  face->charmaps[face->num_charmaps++] = (FT_CharMap)cmap;
3650  }
3651 
3652  Exit:
3653  if ( acmap )
3654  *acmap = cmap;
3655 
3656  return error;
3657 
3658  Fail:
3659  ft_cmap_done_internal( cmap );
3660  cmap = NULL;
3661  goto Exit;
3662  }
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
int FT_Error
Definition: fttypes.h:300
FT_Face face
Definition: freetype.h:842
FT_CharMapRec charmap
Definition: ftobjs.h:153
#define error(str)
Definition: mkdosfs.c:1605
FT_ULong size
Definition: ftobjs.h:212
FT_CMap_InitFunc init
Definition: ftobjs.h:214
WORD face[3]
Definition: mesh.c:4747
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
static void Exit(void)
Definition: sock.c:1331
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
Definition: ftmemory.h:336
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
Definition: hiveinit.c:368
static void ft_cmap_done_internal(FT_CMap cmap)
Definition: ftobjs.c:3553
struct FT_CharMapRec_ * FT_CharMap
Definition: freetype.h:588
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

Referenced by BDF_Face_Init(), cff_face_init(), FNT_Face_Init(), PCF_Face_Init(), pfr_face_init(), sfnt_load_face(), T1_Face_Init(), T42_Face_Init(), and tt_face_build_cmaps().

◆ FT_Done_Face()

FT_Done_Face ( FT_Face  face)

Definition at line 2721 of file ftobjs.c.

2722  {
2723  FT_Error error;
2724  FT_Driver driver;
2725  FT_Memory memory;
2726  FT_ListNode node;
2727 
2728 
2729  error = FT_ERR( Invalid_Face_Handle );
2730  if ( face && face->driver )
2731  {
2732  face->internal->refcount--;
2733  if ( face->internal->refcount > 0 )
2734  error = FT_Err_Ok;
2735  else
2736  {
2737  driver = face->driver;
2738  memory = driver->root.memory;
2739 
2740  /* find face in driver's list */
2741  node = FT_List_Find( &driver->faces_list, face );
2742  if ( node )
2743  {
2744  /* remove face object from the driver's list */
2745  FT_List_Remove( &driver->faces_list, node );
2746  FT_FREE( node );
2747 
2748  /* now destroy the object proper */
2750  error = FT_Err_Ok;
2751  }
2752  }
2753  }
2754 
2755  return error;
2756  }
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
static void destroy_face(FT_Memory memory, FT_Face face, FT_Driver driver)
Definition: ftobjs.c:1105
FT_List_Remove(FT_List list, FT_ListNode node)
Definition: ftutil.c:321
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
struct node node
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FT_ERR(e)
Definition: fttypes.h:586
FT_BEGIN_HEADER FT_List_Find(FT_List list, void *data)
Definition: ftutil.c:244
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
struct @1625::@1626 driver
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
Definition: dlist.c:348

Referenced by ExecuteTest(), FT_Done_Library(), ft_open_face_internal(), ftc_face_node_done(), FtfdQueryFont(), FtfdUnloadFontFile(), IntGdiLoadFontsFromMemory(), SharedFace_Release(), T42_Face_Done(), and TestFace().

◆ FT_Done_GlyphSlot()

FT_Done_GlyphSlot ( FT_GlyphSlot  slot)

Definition at line 612 of file ftobjs.c.

613  {
614  if ( slot )
615  {
616  FT_Driver driver = slot->face->driver;
617  FT_Memory memory = driver->root.memory;
618  FT_GlyphSlot prev;
619  FT_GlyphSlot cur;
620 
621 
622  /* Remove slot from its parent face's list */
623  prev = NULL;
624  cur = slot->face->glyph;
625 
626  while ( cur )
627  {
628  if ( cur == slot )
629  {
630  if ( !prev )
631  slot->face->glyph = cur->next;
632  else
633  prev->next = cur->next;
634 
635  /* finalize client-specific data */
636  if ( slot->generic.finalizer )
637  slot->generic.finalizer( slot );
638 
640  FT_FREE( slot );
641  break;
642  }
643  prev = cur;
644  cur = cur->next;
645  }
646  }
647  }
static void ft_glyphslot_done(FT_GlyphSlot slot)
Definition: ftobjs.c:528
static char memory[1024 *256]
Definition: process.c:116
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_GlyphSlot next
Definition: freetype.h:1912
Definition: vfat.h:184
struct @1625::@1626 driver

Referenced by destroy_face(), and T42_GlyphSlot_Done().

◆ FT_Done_Library()

FT_Done_Library ( FT_Library  library)

Definition at line 5220 of file ftobjs.c.

5221  {
5222  FT_Memory memory;
5223 
5224 
5225  if ( !library )
5226  return FT_THROW( Invalid_Library_Handle );
5227 
5228  library->refcount--;
5229  if ( library->refcount > 0 )
5230  goto Exit;
5231 
5232  memory = library->memory;
5233 
5234  /*
5235  * Close all faces in the library. If we don't do this, we can have
5236  * some subtle memory leaks.
5237  *
5238  * Example:
5239  *
5240  * - the cff font driver uses the pshinter module in cff_size_done
5241  * - if the pshinter module is destroyed before the cff font driver,
5242  * opened FT_Face objects managed by the driver are not properly
5243  * destroyed, resulting in a memory leak
5244  *
5245  * Some faces are dependent on other faces, like Type42 faces that
5246  * depend on TrueType faces synthesized internally.
5247  *
5248  * The order of drivers should be specified in driver_name[].
5249  */
5250  {
5251  FT_UInt m, n;
5252  const char* driver_name[] = { "type42", NULL };
5253 
5254 
5255  for ( m = 0;
5256  m < sizeof ( driver_name ) / sizeof ( driver_name[0] );
5257  m++ )
5258  {
5259  for ( n = 0; n < library->num_modules; n++ )
5260  {
5262  const char* module_name = module->clazz->module_name;
5263  FT_List faces;
5264 
5265 
5266  if ( driver_name[m] &&
5267  ft_strcmp( module_name, driver_name[m] ) != 0 )
5268  continue;
5269 
5270  if ( ( module->clazz->module_flags & FT_MODULE_FONT_DRIVER ) == 0 )
5271  continue;
5272 
5273  FT_TRACE7(( "FT_Done_Library: close faces for %s\n", module_name ));
5274 
5275  faces = &FT_DRIVER( module )->faces_list;
5276  while ( faces->head )
5277  {
5278  FT_Done_Face( FT_FACE( faces->head->data ) );
5279  if ( faces->head )
5280  FT_TRACE0(( "FT_Done_Library: failed to free some faces\n" ));
5281  }
5282  }
5283  }
5284  }
5285 
5286  /* Close all other modules in the library */
5287 #if 1
5288  /* XXX Modules are removed in the reversed order so that */
5289  /* type42 module is removed before truetype module. This */
5290  /* avoids double free in some occasions. It is a hack. */
5291  while ( library->num_modules > 0 )
5294 #else
5295  {
5296  FT_UInt n;
5297 
5298 
5299  for ( n = 0; n < library->num_modules; n++ )
5300  {
5302 
5303 
5304  if ( module )
5305  {
5307  library->modules[n] = NULL;
5308  }
5309  }
5310  }
5311 #endif
5312 
5313 #ifdef FT_CONFIG_OPTION_PIC
5314  /* Destroy pic container contents */
5315  ft_pic_container_destroy( library );
5316 #endif
5317 
5318  FT_FREE( library );
5319 
5320  Exit:
5321  return FT_Err_Ok;
5322  }
#define FT_DRIVER(x)
Definition: ftobjs.h:799
FT_Memory memory
Definition: ftobjs.h:918
static LPCWSTR LPCWSTR module_name
Definition: db.cpp:168
GLdouble n
Definition: glext.h:7729
void * data
Definition: fttypes.h:548
FT_ListNode head
Definition: fttypes.h:569
FT_Done_Face(FT_Face face)
Definition: ftobjs.c:2721
FT_Library library
Definition: cffdrivr.c:654
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
const GLfloat * m
Definition: glext.h:10848
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
static void Destroy_Module(FT_Module module)
Definition: ftobjs.c:4694
#define FT_TRACE0(varformat)
Definition: ftdebug.h:157
FT_UInt num_modules
Definition: ftobjs.h:924
static void Exit(void)
Definition: sock.c:1331
#define FT_TRACE7(varformat)
Definition: ftdebug.h:164
#define FT_MODULE_FONT_DRIVER
Definition: ftmodapi.h:110
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_Module modules[FT_MAX_MODULES]
Definition: ftobjs.h:925
#define FT_FACE(x)
Definition: ftobjs.h:630
unsigned int FT_UInt
Definition: fttypes.h:231
FT_Int refcount
Definition: ftobjs.h:942
#define ft_strcmp
Definition: ftstdlib.h:86
FT_Remove_Module(FT_Library library, FT_Module module)
Definition: ftobjs.c:4927

Referenced by FT_Done_FreeType().

◆ FT_Done_Size()

FT_Done_Size ( FT_Size  size)

Definition at line 2827 of file ftobjs.c.

2828  {
2829  FT_Error error;
2830  FT_Driver driver;
2831  FT_Memory memory;
2832  FT_Face face;
2833  FT_ListNode node;
2834 
2835 
2836  if ( !size )
2837  return FT_THROW( Invalid_Size_Handle );
2838 
2839  face = size->face;
2840  if ( !face )
2841  return FT_THROW( Invalid_Face_Handle );
2842 
2843  driver = face->driver;
2844  if ( !driver )
2845  return FT_THROW( Invalid_Driver_Handle );
2846 
2847  memory = driver->root.memory;
2848 
2849  error = FT_Err_Ok;
2850  node = FT_List_Find( &face->sizes_list, size );
2851  if ( node )
2852  {
2853  FT_List_Remove( &face->sizes_list, node );
2854  FT_FREE( node );
2855 
2856  if ( face->size == size )
2857  {
2858  face->size = NULL;
2859  if ( face->sizes_list.head )
2860  face->size = (FT_Size)(face->sizes_list.head->data);
2861  }
2862 
2864  }
2865  else
2866  error = FT_THROW( Invalid_Size_Handle );
2867 
2868  return error;
2869  }
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
FT_List_Remove(FT_List list, FT_ListNode node)
Definition: ftutil.c:321
WORD face[3]
Definition: mesh.c:4747
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
struct node node
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
GLsizeiptr size
Definition: glext.h:5919
FT_BEGIN_HEADER FT_List_Find(FT_List list, void *data)
Definition: ftutil.c:244
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
static void destroy_size(FT_Memory memory, FT_Size size, FT_Driver driver)
Definition: ftobjs.c:1057
struct FT_SizeRec_ * FT_Size
Definition: freetype.h:534
struct @1625::@1626 driver
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
Definition: dlist.c:348

Referenced by ftc_face_node_init(), ftc_scaler_lookup_size(), ftc_size_node_done(), ftc_size_node_reset(), T42_Face_Init(), and T42_Size_Done().

◆ FT_Face_GetCharsOfVariant()

FT_Face_GetCharsOfVariant ( FT_Face  face,
FT_ULong  variantSelector 
)

Definition at line 3984 of file ftobjs.c.

3986  {
3987  FT_UInt32 *result = NULL;
3988 
3989 
3990  if ( face )
3991  {
3993 
3994 
3995  if ( charmap )
3996  {
3997  FT_CMap vcmap = FT_CMAP( charmap );
3999 
4000 
4001  if ( variantSelector > 0xFFFFFFFFUL )
4002  {
4003  FT_TRACE1(( "FT_Get_Char_Index: too large variantSelector" ));
4004  FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
4005  }
4006 
4007  result = vcmap->clazz->variantchar_list( vcmap, memory,
4008  (FT_UInt32)variantSelector );
4009  }
4010  }
4011 
4012  return result;
4013  }
static FT_CharMap find_variant_selector_charmap(FT_Face face)
Definition: ftobjs.c:1268
static char memory[1024 *256]
Definition: process.c:116
#define FT_CMAP(x)
Definition: ftobjs.h:159
#define FT_TRACE1(varformat)
Definition: ftdebug.h:158
smooth NULL
Definition: ftsmooth.c:416
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_VariantCharListFunc variantchar_list
Definition: ftobjs.h:226
FT_CMap_Class clazz
Definition: ftobjs.h:154

◆ FT_Face_GetCharVariantIndex()

FT_Face_GetCharVariantIndex ( FT_Face  face,
FT_ULong  charcode,
FT_ULong  variantSelector 
)

Definition at line 3834 of file ftobjs.c.

3837  {
3838  FT_UInt result = 0;
3839 
3840 
3841  if ( face &&
3842  face->charmap &&
3843  face->charmap->encoding == FT_ENCODING_UNICODE )
3844  {
3846  FT_CMap ucmap = FT_CMAP( face->charmap );
3847 
3848 
3849  if ( charmap )
3850  {
3851  FT_CMap vcmap = FT_CMAP( charmap );
3852 
3853 
3854  if ( charcode > 0xFFFFFFFFUL )
3855  {
3856  FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
3857  " too large charcode" ));
3858  FT_TRACE1(( " 0x%x is truncated\n", charcode ));
3859  }
3860  if ( variantSelector > 0xFFFFFFFFUL )
3861  {
3862  FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
3863  " too large variantSelector" ));
3864  FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
3865  }
3866 
3867  result = vcmap->clazz->char_var_index( vcmap, ucmap,
3868  (FT_UInt32)charcode,
3869  (FT_UInt32)variantSelector );
3870  }
3871  }
3872 
3873  return result;
3874  }
static FT_CharMap find_variant_selector_charmap(FT_Face face)
Definition: ftobjs.c:1268
#define FT_CMAP(x)
Definition: ftobjs.h:159
#define FT_TRACE1(varformat)
Definition: ftdebug.h:158
FT_CMap_CharVarIndexFunc char_var_index
Definition: ftobjs.h:222
unsigned int FT_UInt
Definition: fttypes.h:231
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

◆ FT_Face_GetCharVariantIsDefault()

FT_Face_GetCharVariantIsDefault ( FT_Face  face,
FT_ULong  charcode,
FT_ULong  variantSelector 
)

Definition at line 3880 of file ftobjs.c.

3883  {
3884  FT_Int result = -1;
3885 
3886 
3887  if ( face )
3888  {
3890 
3891 
3892  if ( charmap )
3893  {
3894  FT_CMap vcmap = FT_CMAP( charmap );
3895 
3896 
3897  if ( charcode > 0xFFFFFFFFUL )
3898  {
3899  FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
3900  " too large charcode" ));
3901  FT_TRACE1(( " 0x%x is truncated\n", charcode ));
3902  }
3903  if ( variantSelector > 0xFFFFFFFFUL )
3904  {
3905  FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
3906  " too large variantSelector" ));
3907  FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
3908  }
3909 
3910  result = vcmap->clazz->char_var_default( vcmap,
3911  (FT_UInt32)charcode,
3912  (FT_UInt32)variantSelector );
3913  }
3914  }
3915 
3916  return result;
3917  }
static FT_CharMap find_variant_selector_charmap(FT_Face face)
Definition: ftobjs.c:1268
signed int FT_Int
Definition: fttypes.h:220
#define FT_CMAP(x)
Definition: ftobjs.h:159
#define FT_TRACE1(varformat)
Definition: ftdebug.h:158
FT_CMap_CharVarIsDefaultFunc char_var_default
Definition: ftobjs.h:223
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

◆ FT_Face_GetVariantSelectors()

FT_Face_GetVariantSelectors ( FT_Face  face)

Definition at line 3923 of file ftobjs.c.

3924  {
3925  FT_UInt32 *result = NULL;
3926 
3927 
3928  if ( face )
3929  {
3931 
3932 
3933  if ( charmap )
3934  {
3935  FT_CMap vcmap = FT_CMAP( charmap );
3937 
3938 
3939  result = vcmap->clazz->variant_list( vcmap, memory );
3940  }
3941  }
3942 
3943  return result;
3944  }
static FT_CharMap find_variant_selector_charmap(FT_Face face)
Definition: ftobjs.c:1268
static char memory[1024 *256]
Definition: process.c:116
#define FT_CMAP(x)
Definition: ftobjs.h:159
smooth NULL
Definition: ftsmooth.c:416
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
FT_CMap_VariantListFunc variant_list
Definition: ftobjs.h:224
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

◆ FT_Face_GetVariantsOfChar()

FT_Face_GetVariantsOfChar ( FT_Face  face,
FT_ULong  charcode 
)

Definition at line 3950 of file ftobjs.c.

3952  {
3953  FT_UInt32 *result = NULL;
3954 
3955 
3956  if ( face )
3957  {
3959 
3960 
3961  if ( charmap )
3962  {
3963  FT_CMap vcmap = FT_CMAP( charmap );
3965 
3966 
3967  if ( charcode > 0xFFFFFFFFUL )
3968  {
3969  FT_TRACE1(( "FT_Face_GetVariantsOfChar: too large charcode" ));
3970  FT_TRACE1(( " 0x%x is truncated\n", charcode ));
3971  }
3972 
3973  result = vcmap->clazz->charvariant_list( vcmap, memory,
3974  (FT_UInt32)charcode );
3975  }
3976  }
3977  return result;
3978  }
static FT_CharMap find_variant_selector_charmap(FT_Face face)
Definition: ftobjs.c:1268
static char memory[1024 *256]
Definition: process.c:116
#define FT_CMAP(x)
Definition: ftobjs.h:159
#define FT_TRACE1(varformat)
Definition: ftdebug.h:158
smooth NULL
Definition: ftsmooth.c:416
FT_CMap_CharVariantListFunc charvariant_list
Definition: ftobjs.h:225
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

◆ FT_Face_Properties()

FT_Face_Properties ( FT_Face  face,
FT_UInt  num_properties,
FT_Parameter properties 
)

Definition at line 3755 of file ftobjs.c.

3758  {
3760 
3761 
3762  if ( num_properties > 0 && !properties )
3763  {
3764  error = FT_THROW( Invalid_Argument );
3765  goto Exit;
3766  }
3767 
3768  for ( ; num_properties > 0; num_properties-- )
3769  {
3770  if ( properties->tag == FT_PARAM_TAG_STEM_DARKENING )
3771  {
3772  if ( properties->data )
3773  {
3774  if ( *( (FT_Bool*)properties->data ) == TRUE )
3775  face->internal->no_stem_darkening = FALSE;
3776  else
3777  face->internal->no_stem_darkening = TRUE;
3778  }
3779  else
3780  {
3781  /* use module default */
3782  face->internal->no_stem_darkening = -1;
3783  }
3784  }
3785  else if ( properties->tag == FT_PARAM_TAG_LCD_FILTER_WEIGHTS )
3786  {
3787 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
3788  if ( properties->data )
3789  {
3790  ft_memcpy( face->internal->lcd_weights,
3791  properties->data,
3793  face->internal->lcd_filter_func = ft_lcd_filter_fir;
3794  }
3795 #else
3796  error = FT_THROW( Unimplemented_Feature );
3797  goto Exit;
3798 #endif
3799  }
3800  else if ( properties->tag == FT_PARAM_TAG_RANDOM_SEED )
3801  {
3802  if ( properties->data )
3803  {
3804  face->internal->random_seed = *( (FT_Int32*)properties->data );
3805  if ( face->internal->random_seed < 0 )
3806  face->internal->random_seed = 0;
3807  }
3808  else
3809  {
3810  /* use module default */
3811  face->internal->random_seed = -1;
3812  }
3813  }
3814  else
3815  {
3816  error = FT_THROW( Invalid_Argument );
3817  goto Exit;
3818  }
3819 
3820  if ( error )
3821  break;
3822 
3823  properties++;
3824  }
3825 
3826  Exit:
3827  return error;
3828  }
int FT_Error
Definition: fttypes.h:300
#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS
Definition: ftparams.h:132
#define TRUE
Definition: types.h:120
#define error(str)
Definition: mkdosfs.c:1605
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_LCD_FILTER_FIVE_TAPS
Definition: ftlcdfil.h:296
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
#define FT_THROW(e)
Definition: ftdebug.h:213
static void Exit(void)
Definition: sock.c:1331
#define FT_PARAM_TAG_STEM_DARKENING
Definition: ftparams.h:175
FT_Pointer data
Definition: freetype.h:2071
#define FT_PARAM_TAG_RANDOM_SEED
Definition: ftparams.h:151
FT_ULong tag
Definition: freetype.h:2070
#define ft_memcpy
Definition: ftstdlib.h:82
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Get_Char_Index()

FT_Get_Char_Index ( FT_Face  face,
FT_ULong  charcode 
)

Definition at line 3668 of file ftobjs.c.

3670  {
3671  FT_UInt result = 0;
3672 
3673 
3674  if ( face && face->charmap )
3675  {
3676  FT_CMap cmap = FT_CMAP( face->charmap );
3677 
3678 
3679  if ( charcode > 0xFFFFFFFFUL )
3680  {
3681  FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
3682  FT_TRACE1(( " 0x%x is truncated\n", charcode ));
3683  }
3684 
3685  result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );
3686  if ( result >= (FT_UInt)face->num_glyphs )
3687  result = 0;
3688  }
3689 
3690  return result;
3691  }
#define FT_CMAP(x)
Definition: ftobjs.h:159
#define FT_TRACE1(varformat)
Definition: ftdebug.h:158
unsigned int FT_UInt
Definition: fttypes.h:231
FT_CMap_CharIndexFunc char_index
Definition: ftobjs.h:216
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

Referenced by af_face_globals_compute_style_coverage(), af_shaper_get_cluster(), FT_Get_First_Char(), FT_Load_Char(), FTC_CMapCache_Lookup(), get_glyph_index(), get_glyph_index_symbol(), and T1_Read_PFM().

◆ FT_Get_Charmap_Index()

FT_Get_Charmap_Index ( FT_CharMap  charmap)

Definition at line 3534 of file ftobjs.c.

3535  {
3536  FT_Int i;
3537 
3538 
3539  if ( !charmap || !charmap->face )
3540  return -1;
3541 
3542  for ( i = 0; i < charmap->face->num_charmaps; i++ )
3543  if ( charmap->face->charmaps[i] == charmap )
3544  break;
3545 
3546  FT_ASSERT( i < charmap->face->num_charmaps );
3547 
3548  return i;
3549  }
FT_Face face
Definition: freetype.h:842
FT_CharMap * charmaps
Definition: freetype.h:1085
signed int FT_Int
Definition: fttypes.h:220
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
Definition: glfuncs.h:248
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
FT_Int num_charmaps
Definition: freetype.h:1084
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Get_CMap_Format()

FT_Get_CMap_Format ( FT_CharMap  charmap)

Definition at line 4206 of file ftobjs.c.

4207  {
4208  FT_Service_TTCMaps service;
4209  FT_Face face;
4211 
4212 
4213  if ( !charmap || !charmap->face )
4214  return -1;
4215 
4216  face = charmap->face;
4217  FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
4218  if ( !service )
4219  return -1;
4220  if ( service->get_cmap_info( charmap, &cmap_info ))
4221  return -1;
4222 
4223  return cmap_info.format;
4224  }
FT_Face face
Definition: freetype.h:842
WORD face[3]
Definition: mesh.c:4747
TT_CMapInfo * cmap_info
Definition: cffdrivr.c:649
FT_Long format
Definition: svttcmap.h:61
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:75
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by find_variant_selector_charmap(), and FT_Set_Charmap().

◆ FT_Get_CMap_Language_ID()

FT_Get_CMap_Language_ID ( FT_CharMap  charmap)

Definition at line 4182 of file ftobjs.c.

4183  {
4184  FT_Service_TTCMaps service;
4185  FT_Face face;
4187 
4188 
4189  if ( !charmap || !charmap->face )
4190  return 0;
4191 
4192  face = charmap->face;
4193  FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
4194  if ( !service )
4195  return 0;
4196  if ( service->get_cmap_info( charmap, &cmap_info ))
4197  return 0;
4198 
4199  return cmap_info.language;
4200  }
FT_Face face
Definition: freetype.h:842
WORD face[3]
Definition: mesh.c:4747
TT_CMapInfo * cmap_info
Definition: cffdrivr.c:649
FT_ULong language
Definition: svttcmap.h:60
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:75
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Get_First_Char()

FT_Get_First_Char ( FT_Face  face,
FT_UInt agindex 
)

Definition at line 3697 of file ftobjs.c.

3699  {
3700  FT_ULong result = 0;
3701  FT_UInt gindex = 0;
3702 
3703 
3704  /* only do something if we have a charmap, and we have glyphs at all */
3705  if ( face && face->charmap && face->num_glyphs )
3706  {
3707  gindex = FT_Get_Char_Index( face, 0 );
3708  if ( gindex == 0 )
3709  result = FT_Get_Next_Char( face, 0, &gindex );
3710  }
3711 
3712  if ( agindex )
3713  *agindex = gindex;
3714 
3715  return result;
3716  }
unsigned long FT_ULong
Definition: fttypes.h:253
FT_Get_Next_Char(FT_Face face, FT_ULong charcode, FT_UInt *agindex)
Definition: ftobjs.c:3722
unsigned int FT_UInt
Definition: fttypes.h:231
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
Definition: ftobjs.c:3668
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FontFamilyFillInfo(), FtfdQueryFontTree(), ftGdiGetKerningPairs(), ftGdiGetTextCharsetInfo(), and ftGetFontUnicodeRanges().

◆ FT_Get_Glyph_Name()

FT_Get_Glyph_Name ( FT_Face  face,
FT_UInt  glyph_index,
FT_Pointer  buffer,
FT_UInt  buffer_max 
)

Definition at line 4047 of file ftobjs.c.

4051  {
4052  FT_Error error;
4053  FT_Service_GlyphDict service;
4054 
4055 
4056  if ( !face )
4057  return FT_THROW( Invalid_Face_Handle );
4058 
4059  if ( !buffer || buffer_max == 0 )
4060  return FT_THROW( Invalid_Argument );
4061 
4062  /* clean up buffer */
4063  ((FT_Byte*)buffer)[0] = '\0';
4064 
4065  if ( (FT_Long)glyph_index >= face->num_glyphs )
4066  return FT_THROW( Invalid_Glyph_Index );
4067 
4068  if ( !FT_HAS_GLYPH_NAMES( face ) )
4069  return FT_THROW( Invalid_Argument );
4070 
4071  FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT );
4072  if ( service && service->get_name )
4073  error = service->get_name( face, glyph_index, buffer, buffer_max );
4074  else
4075  error = FT_THROW( Invalid_Argument );
4076 
4077  return error;
4078  }
int FT_Error
Definition: fttypes.h:300
signed long FT_Long
Definition: fttypes.h:242
#define error(str)
Definition: mkdosfs.c:1605
GLuint buffer
Definition: glext.h:5915
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:950
#define FT_HAS_GLYPH_NAMES(face)
Definition: freetype.h:1387
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by tt_check_single_notdef().

◆ FT_Get_Kerning()

FT_Get_Kerning ( FT_Face  face,
FT_UInt  left_glyph,
FT_UInt  right_glyph,
FT_UInt  kern_mode,
FT_Vector akerning 
)

Definition at line 3347 of file ftobjs.c.

3352  {
3354  FT_Driver driver;
3355 
3356 
3357  if ( !face )
3358  return FT_THROW( Invalid_Face_Handle );
3359 
3360  if ( !akerning )
3361  return FT_THROW( Invalid_Argument );
3362 
3363  driver = face->driver;
3364 
3365  akerning->x = 0;
3366  akerning->y = 0;
3367 
3368  if ( driver->clazz->get_kerning )
3369  {
3370  error = driver->clazz->get_kerning( face,
3371  left_glyph,
3372  right_glyph,
3373  akerning );
3374  if ( !error )
3375  {
3376  if ( kern_mode != FT_KERNING_UNSCALED )
3377  {
3378  akerning->x = FT_MulFix( akerning->x, face->size->metrics.x_scale );
3379  akerning->y = FT_MulFix( akerning->y, face->size->metrics.y_scale );
3380 
3381  if ( kern_mode != FT_KERNING_UNFITTED )
3382  {
3383  FT_Pos orig_x = akerning->x;
3384  FT_Pos orig_y = akerning->y;
3385 
3386 
3387  /* we scale down kerning values for small ppem values */
3388  /* to avoid that rounding makes them too big. */
3389  /* `25' has been determined heuristically. */
3390  if ( face->size->metrics.x_ppem < 25 )
3391  akerning->x = FT_MulDiv( orig_x,
3392  face->size->metrics.x_ppem, 25 );
3393  if ( face->size->metrics.y_ppem < 25 )
3394  akerning->y = FT_MulDiv( orig_y,
3395  face->size->metrics.y_ppem, 25 );
3396 
3397  akerning->x = FT_PIX_ROUND( akerning->x );
3398  akerning->y = FT_PIX_ROUND( akerning->y );
3399 
3400 #ifdef FT_DEBUG_LEVEL_TRACE
3401  {
3402  FT_Pos orig_x_rounded = FT_PIX_ROUND( orig_x );
3403  FT_Pos orig_y_rounded = FT_PIX_ROUND( orig_y );
3404 
3405 
3406  if ( akerning->x != orig_x_rounded ||
3407  akerning->y != orig_y_rounded )
3408  FT_TRACE5(( "FT_Get_Kerning: horizontal kerning"
3409  " (%d, %d) scaled down to (%d, %d) pixels\n",
3410  orig_x_rounded / 64, orig_y_rounded / 64,
3411  akerning->x / 64, akerning->y / 64 ));
3412  }
3413 #endif
3414  }
3415  }
3416  }
3417  }
3418 
3419  return error;
3420  }
int FT_Error
Definition: fttypes.h:300
FT_Pos y
Definition: ftimage.h:77
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
FT_UInt FT_UInt right_glyph
Definition: ttdriver.c:201
#define error(str)
Definition: mkdosfs.c:1605
FT_Pos x
Definition: ftimage.h:76
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:416
FT_UInt left_glyph
Definition: ttdriver.c:201
FT_MulFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:509
#define FT_TRACE5(varformat)
Definition: ftdebug.h:162
struct @1625::@1626 driver
#define FT_PIX_ROUND(x)
Definition: ftobjs.h:93
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FT_Get_PFR_Kerning(), ftGdiGetKerningPairs(), IntExtTextOutW(), and TextIntGetTextExtentPoint().

◆ FT_Get_Module()

FT_Get_Module ( FT_Library  library,
const char module_name 
)

Definition at line 4837 of file ftobjs.c.

4839  {
4840  FT_Module result = NULL;
4841  FT_Module* cur;
4842  FT_Module* limit;
4843 
4844 
4845  if ( !library || !module_name )
4846  return result;
4847 
4848  cur = library->modules;
4849  limit = cur + library->num_modules;
4850 
4851  for ( ; cur < limit; cur++ )
4852  if ( ft_strcmp( cur[0]->clazz->module_name, module_name ) == 0 )
4853  {
4854  result = cur[0];
4855  break;
4856  }
4857 
4858  return result;
4859  }
static LPCWSTR LPCWSTR module_name
Definition: db.cpp:168
FT_Library library
Definition: cffdrivr.c:654
GLint limit
Definition: glext.h:10326
smooth NULL
Definition: ftsmooth.c:416
FT_UInt num_modules
Definition: ftobjs.h:924
FT_Module modules[FT_MAX_MODULES]
Definition: ftobjs.h:925
GLuint64EXT * result
Definition: glext.h:11304
#define ft_strcmp
Definition: ftstdlib.h:86

Referenced by cff_get_glyph_name(), cff_get_interface(), cff_get_name_index(), cff_size_get_globals_funcs(), cff_slot_init(), cid_size_get_globals_funcs(), cid_slot_init(), FT_DEFINE_SERVICE_PSINFOREC(), FT_Get_Module_Interface(), FT_Get_TrueType_Engine_Type(), if(), sfnt_init_face(), T1_GlyphSlot_Init(), T1_Size_Get_Globals_Funcs(), T42_Driver_Init(), T42_Face_Init(), and tt_get_interface().

◆ FT_Get_Module_Interface()

FT_Get_Module_Interface ( FT_Library  library,
const char mod_name 
)

Definition at line 4865 of file ftobjs.c.

4867  {
4868  FT_Module module;
4869 
4870 
4871  /* test for valid `library' delayed to FT_Get_Module() */
4872 
4873  module = FT_Get_Module( library, mod_name );
4874 
4875  return module ? module->clazz->module_interface : 0;
4876  }
HMODULE module
Definition: main.cpp:47
FT_Library library
Definition: cffdrivr.c:654
FT_Get_Module(FT_Library library, const char *module_name)
Definition: ftobjs.c:4837

Referenced by cff_face_init(), cff_parser_run(), cid_face_init(), parse_afm(), sfnt_init_face(), T1_Face_Init(), T42_Face_Init(), and tt_face_init().

◆ FT_Get_Name_Index()

FT_Get_Name_Index ( FT_Face  face,
FT_String glyph_name 
)

Definition at line 4019 of file ftobjs.c.

4021  {
4022  FT_UInt result = 0;
4023 
4024 
4025  if ( face &&
4026  FT_HAS_GLYPH_NAMES( face ) &&
4027  glyph_name )
4028  {
4029  FT_Service_GlyphDict service;
4030 
4031 
4033  service,
4034  GLYPH_DICT );
4035 
4036  if ( service && service->name_index )
4037  result = service->name_index( face, glyph_name );
4038  }
4039 
4040  return result;
4041  }
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:950
#define FT_HAS_GLYPH_NAMES(face)
Definition: freetype.h:1387
unsigned int FT_UInt
Definition: fttypes.h:231
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Get_Next_Char()

FT_Get_Next_Char ( FT_Face  face,
FT_ULong  charcode,
FT_UInt agindex 
)

Definition at line 3722 of file ftobjs.c.

3725  {
3726  FT_ULong result = 0;
3727  FT_UInt gindex = 0;
3728 
3729 
3730  if ( face && face->charmap && face->num_glyphs )
3731  {
3732  FT_UInt32 code = (FT_UInt32)charcode;
3733  FT_CMap cmap = FT_CMAP( face->charmap );
3734 
3735 
3736  do
3737  {
3738  gindex = cmap->clazz->char_next( cmap, &code );
3739 
3740  } while ( gindex >= (FT_UInt)face->num_glyphs );
3741 
3742  result = ( gindex == 0 ) ? 0 : code;
3743  }
3744 
3745  if ( agindex )
3746  *agindex = gindex;
3747 
3748  return result;
3749  }
unsigned long FT_ULong
Definition: fttypes.h:253
FT_CMap_CharNextFunc char_next
Definition: ftobjs.h:217
#define FT_CMAP(x)
Definition: ftobjs.h:159
unsigned int FT_UInt
Definition: fttypes.h:231
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_CMap_Class clazz
Definition: ftobjs.h:154

Referenced by af_face_globals_compute_style_coverage(), FT_Get_First_Char(), FtfdQueryFontTree(), ftGdiGetKerningPairs(), and ftGetFontUnicodeRanges().

◆ FT_Get_Postscript_Name()

FT_Get_Postscript_Name ( FT_Face  face)

Definition at line 4084 of file ftobjs.c.

4085  {
4086  const char* result = NULL;
4087 
4088 
4089  if ( !face )
4090  goto Exit;
4091 
4092  if ( !result )
4093  {
4094  FT_Service_PsFontName service;
4095 
4096 
4098  service,
4099  POSTSCRIPT_FONT_NAME );
4100 
4101  if ( service && service->get_ps_font_name )
4102  result = service->get_ps_font_name( face );
4103  }
4104 
4105  Exit:
4106  return result;
4107  }
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:950
smooth NULL
Definition: ftsmooth.c:416
static void Exit(void)
Definition: sock.c:1331
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Get_Renderer()

FT_Get_Renderer ( FT_Library  library,
FT_Glyph_Format  format 
)

Definition at line 4416 of file ftobjs.c.

4418  {
4419  /* test for valid `library' delayed to `FT_Lookup_Renderer' */
4420 
4421  return FT_Lookup_Renderer( library, format, 0 );
4422  }
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
Definition: ftobjs.c:4264
FT_Library library
Definition: cffdrivr.c:654
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546

◆ FT_Get_Sfnt_Table()

FT_Get_Sfnt_Table ( FT_Face  face,
FT_Sfnt_Tag  tag 
)

Definition at line 4113 of file ftobjs.c.

4115  {
4116  void* table = NULL;
4117  FT_Service_SFNT_Table service;
4118 
4119 
4120  if ( face && FT_IS_SFNT( face ) )
4121  {
4122  FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
4123  if ( service )
4124  table = service->get_table( face, tag );
4125  }
4126 
4127  return table;
4128  }
Definition: ecma_167.h:138
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
smooth NULL
Definition: ftsmooth.c:416
#define FT_IS_SFNT(face)
Definition: freetype.h:1331
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:75
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FontFamilyFillInfo(), FT_Get_FSType_Flags(), ftGdiGetTextCharsetInfo(), ftGdiGetTextMetricsW(), IntFontType(), IntGdiLoadFontsFromMemory(), IntGetOutlineTextMetrics(), IntRequestFontSize(), IntWidthMatrix(), and NtGdiGetGlyphIndicesW().

◆ FT_Get_SubGlyph_Info()

FT_Get_SubGlyph_Info ( FT_GlyphSlot  glyph,
FT_UInt  sub_index,
FT_Int p_index,
FT_UInt p_flags,
FT_Int p_arg1,
FT_Int p_arg2,
FT_Matrix p_transform 
)

Definition at line 5373 of file ftobjs.c.

5380  {
5381  FT_Error error = FT_ERR( Invalid_Argument );
5382 
5383 
5384  if ( glyph &&
5385  glyph->subglyphs &&
5386  glyph->format == FT_GLYPH_FORMAT_COMPOSITE &&
5387  sub_index < glyph->num_subglyphs )
5388  {
5389  FT_SubGlyph subg = glyph->subglyphs + sub_index;
5390 
5391 
5392  *p_index = subg->index;
5393  *p_flags = subg->flags;
5394  *p_arg1 = subg->arg1;
5395  *p_arg2 = subg->arg2;
5396  *p_transform = subg->transform;
5397 
5398  error = FT_Err_Ok;
5399  }
5400 
5401  return error;
5402  }
FT_Int arg2
Definition: ftgloadr.h:44
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
FT_Matrix transform
Definition: ftgloadr.h:45
FT_Int arg1
Definition: ftgloadr.h:43
return FT_Err_Ok
Definition: ftbbox.c:511
FT_Int index
Definition: ftgloadr.h:41
#define FT_ERR(e)
Definition: fttypes.h:586
FT_Glyph_Format format
Definition: freetype.h:1921
FT_UShort flags
Definition: ftgloadr.h:42
FT_SubGlyph subglyphs
Definition: freetype.h:1930

◆ FT_Get_Track_Kerning()

FT_Get_Track_Kerning ( FT_Face  face,
FT_Fixed  point_size,
FT_Int  degree,
FT_Fixed akerning 
)

Definition at line 3426 of file ftobjs.c.

3430  {
3431  FT_Service_Kerning service;
3433 
3434 
3435  if ( !face )
3436  return FT_THROW( Invalid_Face_Handle );
3437 
3438  if ( !akerning )
3439  return FT_THROW( Invalid_Argument );
3440 
3441  FT_FACE_FIND_SERVICE( face, service, KERNING );
3442  if ( !service )
3443  return FT_THROW( Unimplemented_Feature );
3444 
3445  error = service->get_track( face,
3446  point_size,
3447  degree,
3448  akerning );
3449 
3450  return error;
3451  }
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:75
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Get_TrueType_Engine_Type()

FT_Get_TrueType_Engine_Type ( FT_Library  library)

Definition at line 5342 of file ftobjs.c.

5343  {
5345 
5346 
5347  if ( library )
5348  {
5349  FT_Module module = FT_Get_Module( library, "truetype" );
5350 
5351 
5352  if ( module )
5353  {
5354  FT_Service_TrueTypeEngine service;
5355 
5356 
5357  service = (FT_Service_TrueTypeEngine)
5360  0 );
5361  if ( service )
5362  result = service->engine_type;
5363  }
5364  }
5365 
5366  return result;
5367  }
FT_SERVICE_ID_TRUETYPE_ENGINE
Definition: ttdriver.c:560
ft_module_get_service(FT_Module module, const char *service_id, FT_Bool global)
Definition: ftobjs.c:4880
FT_Library library
Definition: cffdrivr.c:654
enum FT_TrueTypeEngineType_ FT_TrueTypeEngineType
FT_Get_Module(FT_Library library, const char *module_name)
Definition: ftobjs.c:4837
GLuint64EXT * result
Definition: glext.h:11304

◆ ft_glyphslot_alloc_bitmap()

ft_glyphslot_alloc_bitmap ( FT_GlyphSlot  slot,
FT_ULong  size 
)

Definition at line 478 of file ftobjs.c.

480  {
481  FT_Memory memory = FT_FACE_MEMORY( slot->face );
482  FT_Error error;
483 
484 
485  if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
486  FT_FREE( slot->bitmap.buffer );
487  else
488  slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
489 
490  (void)FT_ALLOC( slot->bitmap.buffer, size );
491  return error;
492  }
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
int FT_Error
Definition: fttypes.h:300
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:116
#define FT_GLYPH_OWN_BITMAP
Definition: ftobjs.h:463
#define FT_FREE(ptr)
Definition: ftmemory.h:329
GLsizeiptr size
Definition: glext.h:5919
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
Definition: vfat.h:184
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636

Referenced by PCF_Glyph_Load().

◆ ft_glyphslot_clear()

static void ft_glyphslot_clear ( FT_GlyphSlot  slot)
static

Definition at line 496 of file ftobjs.c.

497  {
498  /* free bitmap if needed */
500 
501  /* clear all public fields in the glyph slot */
502  FT_ZERO( &slot->metrics );
503  FT_ZERO( &slot->outline );
504 
505  slot->bitmap.width = 0;
506  slot->bitmap.rows = 0;
507  slot->bitmap.pitch = 0;
508  slot->bitmap.pixel_mode = 0;
509  /* `slot->bitmap.buffer' has been handled by ft_glyphslot_free_bitmap */
510 
511  slot->bitmap_left = 0;
512  slot->bitmap_top = 0;
513  slot->num_subglyphs = 0;
514  slot->subglyphs = NULL;
515  slot->control_data = NULL;
516  slot->control_len = 0;
517  slot->other = NULL;
518  slot->format = FT_GLYPH_FORMAT_NONE;
519 
520  slot->linearHoriAdvance = 0;
521  slot->linearVertAdvance = 0;
522  slot->lsb_delta = 0;
523  slot->rsb_delta = 0;
524  }
smooth NULL
Definition: ftsmooth.c:416
#define FT_ZERO(p)
Definition: ftmemory.h:237
ft_glyphslot_free_bitmap(FT_GlyphSlot slot)
Definition: ftobjs.c:314
Definition: vfat.h:184

Referenced by FT_Load_Glyph().

◆ ft_glyphslot_done()

static void ft_glyphslot_done ( FT_GlyphSlot  slot)
static

Definition at line 528 of file ftobjs.c.

529  {
530  FT_Driver driver = slot->face->driver;
531  FT_Driver_Class clazz = driver->clazz;
532  FT_Memory memory = driver->root.memory;
533 
534 
535  if ( clazz->done_slot )
536  clazz->done_slot( slot );
537 
538  /* free bitmap buffer if needed */
540 
541  /* slot->internal might be NULL in out-of-memory situations */
542  if ( slot->internal )
543  {
544  /* free glyph loader */
546  {
547  FT_GlyphLoader_Done( slot->internal->loader );
548  slot->internal->loader = NULL;
549  }
550 
551  FT_FREE( slot->internal );
552  }
553  }
static char memory[1024 *256]
Definition: process.c:116
#define FT_DRIVER_USES_OUTLINES(x)
Definition: ftobjs.h:565
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
FT_GlyphLoader_Done(FT_GlyphLoader loader)
Definition: ftgloadr.c:128
ft_glyphslot_free_bitmap(FT_GlyphSlot slot)
Definition: ftobjs.c:314
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
Definition: vfat.h:184
FT_Slot_DoneFunc done_slot
Definition: ftdrv.h:172
struct @1625::@1626 driver

Referenced by FT_Done_GlyphSlot(), and FT_New_GlyphSlot().

◆ ft_glyphslot_free_bitmap()

ft_glyphslot_free_bitmap ( FT_GlyphSlot  slot)

Definition at line 314 of file ftobjs.c.

315  {
316  if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
317  {
318  FT_Memory memory = FT_FACE_MEMORY( slot->face );
319 
320 
321  FT_FREE( slot->bitmap.buffer );
322  slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
323  }
324  else
325  {
326  /* assume that the bitmap buffer was stolen or not */
327  /* allocated from the heap */
328  slot->bitmap.buffer = NULL;
329  }
330  }
static char memory[1024 *256]
Definition: process.c:116
#define FT_GLYPH_OWN_BITMAP
Definition: ftobjs.h:463
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
Definition: vfat.h:184
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636

Referenced by ft_glyphslot_clear(), ft_glyphslot_done(), ft_glyphslot_set_bitmap(), and t42_glyphslot_clear().

◆ ft_glyphslot_grid_fit_metrics()

static void ft_glyphslot_grid_fit_metrics ( FT_GlyphSlot  slot,
FT_Bool  vertical 
)
static

Definition at line 707 of file ftobjs.c.

709  {
710  FT_Glyph_Metrics* metrics = &slot->metrics;
712 
713 
714  if ( vertical )
715  {
716  metrics->horiBearingX = FT_PIX_FLOOR( metrics->horiBearingX );
717  metrics->horiBearingY = FT_PIX_CEIL_LONG( metrics->horiBearingY );
718 
719  right = FT_PIX_CEIL_LONG( ADD_LONG( metrics->vertBearingX,
720  metrics->width ) );
721  bottom = FT_PIX_CEIL_LONG( ADD_LONG( metrics->vertBearingY,
722  metrics->height ) );
723 
724  metrics->vertBearingX = FT_PIX_FLOOR( metrics->vertBearingX );
725  metrics->vertBearingY = FT_PIX_FLOOR( metrics->vertBearingY );
726 
727  metrics->width = SUB_LONG( right,
728  metrics->vertBearingX );
729  metrics->height = SUB_LONG( bottom,
730  metrics->vertBearingY );
731  }
732  else
733  {
734  metrics->vertBearingX = FT_PIX_FLOOR( metrics->vertBearingX );
735  metrics->vertBearingY = FT_PIX_FLOOR( metrics->vertBearingY );
736 
737  right = FT_PIX_CEIL_LONG( ADD_LONG( metrics->horiBearingX,
738  metrics->width ) );
739  bottom = FT_PIX_FLOOR( SUB_LONG( metrics->horiBearingY,
740  metrics->height ) );
741 
742  metrics->horiBearingX = FT_PIX_FLOOR( metrics->horiBearingX );
743  metrics->horiBearingY = FT_PIX_CEIL_LONG( metrics->horiBearingY );
744 
745  metrics->width = SUB_LONG( right,
746  metrics->horiBearingX );
747  metrics->height = SUB_LONG( metrics->horiBearingY,
748  bottom );
749  }
750 
751  metrics->horiAdvance = FT_PIX_ROUND_LONG( metrics->horiAdvance );
752  metrics->vertAdvance = FT_PIX_ROUND_LONG( metrics->vertAdvance );
753  }
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
#define ADD_LONG(a, b)
Definition: ftcalc.h:420
#define FT_PIX_FLOOR(x)
Definition: ftobjs.h:92
GLint GLint bottom
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define FT_PIX_ROUND_LONG(x)
Definition: ftobjs.h:102
Definition: vfat.h:184
#define FT_PIX_CEIL_LONG(x)
Definition: ftobjs.h:103
FT_BEGIN_HEADER struct FT_Glyph_Metrics_ FT_Glyph_Metrics
#define SUB_LONG(a, b)
Definition: ftcalc.h:422

Referenced by FT_Load_Glyph().

◆ ft_glyphslot_init()

static FT_Error ft_glyphslot_init ( FT_GlyphSlot  slot)
static

Definition at line 286 of file ftobjs.c.

287  {
288  FT_Driver driver = slot->face->driver;
289  FT_Driver_Class clazz = driver->clazz;
290  FT_Memory memory = driver->root.memory;
292  FT_Slot_Internal internal = NULL;
293 
294 
295  slot->library = driver->root.library;
296 
297  if ( FT_NEW( internal ) )
298  goto Exit;
299 
300  slot->internal = internal;
301 
303  error = FT_GlyphLoader_New( memory, &internal->loader );
304 
305  if ( !error && clazz->init_slot )
306  error = clazz->init_slot( slot );
307 
308  Exit:
309  return error;
310  }
int FT_Error
Definition: fttypes.h:300
FT_Slot_InitFunc init_slot
Definition: ftdrv.h:171
#define error(str)
Definition: mkdosfs.c:1605
FT_GlyphLoader_New(FT_Memory memory, FT_GlyphLoader *aloader)
Definition: ftgloadr.c:70
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
#define FT_DRIVER_USES_OUTLINES(x)
Definition: ftobjs.h:565
smooth NULL
Definition: ftsmooth.c:416
static void Exit(void)
Definition: sock.c:1331
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
Definition: vfat.h:184
ios_base &_STLP_CALL internal(ios_base &__s)
Definition: _ios_base.h:311
#define FT_NEW(ptr)
Definition: ftmemory.h:331
struct @1625::@1626 driver

Referenced by FT_New_GlyphSlot().

◆ ft_glyphslot_preset_bitmap()

ft_glyphslot_preset_bitmap ( FT_GlyphSlot  slot,
FT_Render_Mode  mode,
const FT_Vector origin 
)

Definition at line 334 of file ftobjs.c.

337  {
338  FT_Outline* outline = &slot->outline;
339  FT_Bitmap* bitmap = &slot->bitmap;
340 
341  FT_Pixel_Mode pixel_mode;
342 
343  FT_BBox cbox;
344  FT_Pos x_shift = 0;
345  FT_Pos y_shift = 0;
346  FT_Pos x_left, y_top;
347  FT_Pos width, height, pitch;
348 
349 
350  if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
351  return;
352 
353  if ( origin )
354  {
355  x_shift = origin->x;
356  y_shift = origin->y;
357  }
358 
359  /* compute the control box, and grid-fit it, */
360  /* taking into account the origin shift */
361  FT_Outline_Get_CBox( outline, &cbox );
362 
363  cbox.xMin += x_shift;
364  cbox.yMin += y_shift;
365  cbox.xMax += x_shift;
366  cbox.yMax += y_shift;
367 
368  switch ( mode )
369  {
370  case FT_RENDER_MODE_MONO:
371  pixel_mode = FT_PIXEL_MODE_MONO;
372 #if 1
373  /* undocumented but confirmed: bbox values get rounded */
374  /* unless the rounded box can collapse for a narrow glyph */
375  if ( cbox.xMax - cbox.xMin < 64 )
376  {
377  cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
378  cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
379  }
380  else
381  {
382  cbox.xMin = FT_PIX_ROUND_LONG( cbox.xMin );
383  cbox.xMax = FT_PIX_ROUND_LONG( cbox.xMax );
384  }
385 
386  if ( cbox.yMax - cbox.yMin < 64 )
387  {
388  cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
389  cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
390  }
391  else
392  {
393  cbox.yMin = FT_PIX_ROUND_LONG( cbox.yMin );
394  cbox.yMax = FT_PIX_ROUND_LONG( cbox.yMax );
395  }
396 #else
397  cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
398  cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
399  cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
400  cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
401 #endif
402  break;
403 
404  case FT_RENDER_MODE_LCD:
405  pixel_mode = FT_PIXEL_MODE_LCD;
406  ft_lcd_padding( &cbox.xMin, &cbox.xMax, slot );
407  goto Round;
408 
410  pixel_mode = FT_PIXEL_MODE_LCD_V;
411  ft_lcd_padding( &cbox.yMin, &cbox.yMax, slot );
412  goto Round;
413 
416  default:
417  pixel_mode = FT_PIXEL_MODE_GRAY;
418  Round:
419  cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
420  cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
421  cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
422  cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
423  }
424 
425  x_shift = SUB_LONG( x_shift, cbox.xMin );
426  y_shift = SUB_LONG( y_shift, cbox.yMin );
427 
428  x_left = cbox.xMin >> 6;
429  y_top = cbox.yMax >> 6;
430 
431  width = ( (FT_ULong)cbox.xMax - (FT_ULong)cbox.xMin ) >> 6;
432  height = ( (FT_ULong)cbox.yMax - (FT_ULong)cbox.yMin ) >> 6;
433 
434  switch ( pixel_mode )
435  {
436  case FT_PIXEL_MODE_MONO:
437  pitch = ( ( width + 15 ) >> 4 ) << 1;
438  break;
439 
440  case FT_PIXEL_MODE_LCD:
441  width *= 3;
442  pitch = FT_PAD_CEIL( width, 4 );
443  break;
444 
445  case FT_PIXEL_MODE_LCD_V:
446  height *= 3;
447  /* fall through */
448 
449  case FT_PIXEL_MODE_GRAY:
450  default:
451  pitch = width;
452  }
453 
454  slot->bitmap_left = (FT_Int)x_left;
455  slot->bitmap_top = (FT_Int)y_top;
456 
457  bitmap->pixel_mode = (unsigned char)pixel_mode;
458  bitmap->num_grays = 256;
459  bitmap->width = (unsigned int)width;
460  bitmap->rows = (unsigned int)height;
461  bitmap->pitch = pitch;
462  }
GLint GLint GLsizei width
Definition: gl.h:1546
unsigned long FT_ULong
Definition: fttypes.h:253
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
ft_lcd_padding(FT_Pos *Min, FT_Pos *Max, FT_GlyphSlot slot)
Definition: ftlcdfil.c:348
uint32 width
Definition: uimain.c:91
signed int FT_Int
Definition: fttypes.h:220
voidpf uLong int origin
Definition: ioapi.h:142
#define FT_GLYPH_OWN_BITMAP
Definition: ftobjs.h:463
enum FT_Pixel_Mode_ FT_Pixel_Mode
#define FT_PAD_CEIL(x, n)
Definition: ftobjs.h:90
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
Definition: ftoutln.c:478
FT_Pos yMax
Definition: ftimage.h:118
unsigned char
Definition: typeof.h:29
#define FT_PIX_FLOOR(x)
Definition: ftobjs.h:92
Definition: uimain.c:88
FT_Pos xMin
Definition: ftimage.h:117
FT_Pos xMax
Definition: ftimage.h:118
#define FT_PIX_ROUND_LONG(x)
Definition: ftobjs.h:102
GLenum mode
Definition: glext.h:6217
Definition: mesh.c:5329
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
Definition: vfat.h:184
#define FT_PIX_CEIL_LONG(x)
Definition: ftobjs.h:103
FT_Pos yMin
Definition: ftimage.h:117
#define SUB_LONG(a, b)
Definition: ftcalc.h:422
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by FT_Load_Glyph(), ft_raster1_render(), and ft_smooth_render_generic().

◆ ft_glyphslot_set_bitmap()

ft_glyphslot_set_bitmap ( FT_GlyphSlot  slot,
FT_Byte buffer 
)

Definition at line 466 of file ftobjs.c.

468  {
470 
471  slot->bitmap.buffer = buffer;
472 
473  FT_ASSERT( (slot->internal->flags & FT_GLYPH_OWN_BITMAP) == 0 );
474  }
GLuint buffer
Definition: glext.h:5915
#define FT_GLYPH_OWN_BITMAP
Definition: ftobjs.h:463
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
ft_glyphslot_free_bitmap(FT_GlyphSlot slot)
Definition: ftobjs.c:314
Definition: vfat.h:184

Referenced by BDF_Glyph_Load().

◆ FT_Library_Version()

FT_Library_Version ( FT_Library  library,
FT_Int amajor,
FT_Int aminor,
FT_Int apatch 
)

Definition at line 5189 of file ftobjs.c.

5193  {
5194  FT_Int major = 0;
5195  FT_Int minor = 0;
5196  FT_Int patch = 0;
5197 
5198 
5199  if ( library )
5200  {
5203  patch = library->version_patch;
5204  }
5205 
5206  if ( amajor )
5207  *amajor = major;
5208 
5209  if ( aminor )
5210  *aminor = minor;
5211 
5212  if ( apatch )
5213  *apatch = patch;
5214  }
signed int FT_Int
Definition: fttypes.h:220
FT_Library library
Definition: cffdrivr.c:654
FT_Int version_patch
Definition: ftobjs.h:922
FT_Int version_major
Definition: ftobjs.h:920
FT_Int version_minor
Definition: ftobjs.h:921
#define major(rdev)
Definition: propsheet.cpp:916
#define minor(rdev)
Definition: propsheet.cpp:917

◆ FT_Load_Char()

FT_Load_Char ( FT_Face  face,
FT_ULong  char_code,
FT_Int32  load_flags 
)

Definition at line 1037 of file ftobjs.c.

1040  {
1041  FT_UInt glyph_index;
1042 
1043 
1044  if ( !face )
1045  return FT_THROW( Invalid_Face_Handle );
1046 
1047  glyph_index = (FT_UInt)char_code;
1048  if ( face->charmap )
1049  glyph_index = FT_Get_Char_Index( face, char_code );
1050 
1051  return FT_Load_Glyph( face, glyph_index, load_flags );
1052  }
#define FT_THROW(e)
Definition: ftdebug.h:213
unsigned int FT_UInt
Definition: fttypes.h:231
FT_Load_Glyph(FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ftobjs.c:760
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
Definition: ftobjs.c:3668
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

◆ FT_Load_Glyph()

FT_Load_Glyph ( FT_Face  face,
FT_UInt  glyph_index,
FT_Int32  load_flags 
)

Definition at line 760 of file ftobjs.c.

763  {
764  FT_Error error;
768  FT_Bool autohint = FALSE;
769  FT_Module hinter;
770  TT_Face ttface = (TT_Face)face;
771 
772 
773  if ( !face || !face->size || !face->glyph )
774  return FT_THROW( Invalid_Face_Handle );
775 
776  /* The validity test for `glyph_index' is performed by the */
777  /* font drivers. */
778 
779  slot = face->glyph;
781 
782  driver = face->driver;
783  library = driver->root.library;
784  hinter = library->auto_hinter;
785 
786  /* resolve load flags dependencies */
787 
788  if ( load_flags & FT_LOAD_NO_RECURSE )
789  load_flags |= FT_LOAD_NO_SCALE |
791 
792  if ( load_flags & FT_LOAD_NO_SCALE )
793  {
794  load_flags |= FT_LOAD_NO_HINTING |
796 
797  load_flags &= ~FT_LOAD_RENDER;
798  }
799 
800  if ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY )
801  load_flags &= ~FT_LOAD_RENDER;
802 
803  /*
804  * Determine whether we need to auto-hint or not.
805  * The general rules are:
806  *
807  * - Do only auto-hinting if we have
808  *
809  * - a hinter module,
810  * - a scalable font format dealing with outlines,
811  * - not a tricky font, and
812  * - no transforms except simple slants and/or rotations by
813  * integer multiples of 90 degrees.
814  *
815  * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
816  * have a native font hinter.
817  *
818  * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't
819  * any hinting bytecode in the TrueType/OpenType font.
820  *
821  * - Exception: The font is `tricky' and requires the native hinter to
822  * load properly.
823  */
824 
825  if ( hinter &&
826  !( load_flags & FT_LOAD_NO_HINTING ) &&
827  !( load_flags & FT_LOAD_NO_AUTOHINT ) &&
830  !FT_IS_TRICKY( face ) &&
831  ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) ||
832  ( face->internal->transform_matrix.yx == 0 &&
833  face->internal->transform_matrix.xx != 0 ) ||
834  ( face->internal->transform_matrix.xx == 0 &&
835  face->internal->transform_matrix.yx != 0 ) ) )
836  {
837  if ( ( load_flags & FT_LOAD_FORCE_AUTOHINT ) ||
839  autohint = TRUE;
840  else
841  {
842  FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
843  FT_Bool is_light_type1;
844 
845 
846  /* only the new Adobe engine (for both CFF and Type 1) is `light'; */
847  /* we use `strstr' to catch both `Type 1' and `CID Type 1' */
848  is_light_type1 =
849  ft_strstr( FT_Get_Font_Format( face ), "Type 1" ) != NULL &&
850  ((PS_Driver)driver)->hinting_engine == FT_HINTING_ADOBE;
851 
852  /* the check for `num_locations' assures that we actually */
853  /* test for instructions in a TTF and not in a CFF-based OTF */
854  /* */
855  /* since `maxSizeOfInstructions' might be unreliable, we */
856  /* check the size of the `fpgm' and `prep' tables, too -- */
857  /* the assumption is that there don't exist real TTFs where */
858  /* both `fpgm' and `prep' tables are missing */
859  if ( ( mode == FT_RENDER_MODE_LIGHT &&
861  !is_light_type1 ) ) ||
862  ( FT_IS_SFNT( face ) &&
863  ttface->num_locations &&
864  ttface->max_profile.maxSizeOfInstructions == 0 &&
865  ttface->font_program_size == 0 &&
866  ttface->cvt_program_size == 0 ) )
867  autohint = TRUE;
868  }
869  }
870 
871  if ( autohint )
872  {
873  FT_AutoHinter_Interface hinting;
874 
875 
876  /* try to load embedded bitmaps first if available */
877  /* */
878  /* XXX: This is really a temporary hack that should disappear */
879  /* promptly with FreeType 2.1! */
880  /* */
881  if ( FT_HAS_FIXED_SIZES( face ) &&
882  ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
883  {
884  error = driver->clazz->load_glyph( slot, face->size,
885  glyph_index,
886  load_flags | FT_LOAD_SBITS_ONLY );
887 
888  if ( !error && slot->format == FT_GLYPH_FORMAT_BITMAP )
889  goto Load_Ok;
890  }
891 
892  {
893  FT_Face_Internal internal = face->internal;
894  FT_Int transform_flags = internal->transform_flags;
895 
896 
897  /* since the auto-hinter calls FT_Load_Glyph by itself, */
898  /* make sure that glyphs aren't transformed */
899  internal->transform_flags = 0;
900 
901  /* load auto-hinted outline */
902  hinting = (FT_AutoHinter_Interface)hinter->clazz->module_interface;
903 
904  error = hinting->load_glyph( (FT_AutoHinter)hinter,
905  slot, face->size,
906  glyph_index, load_flags );
907 
908  internal->transform_flags = transform_flags;
909  }
910  }
911  else
912  {
913  error = driver->clazz->load_glyph( slot,
914  face->size,
915  glyph_index,
916  load_flags );
917  if ( error )
918  goto Exit;
919 
920  if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
921  {
922  /* check that the loaded outline is correct */
923  error = FT_Outline_Check( &slot->outline );
924  if ( error )
925  goto Exit;
926 
927 #ifdef GRID_FIT_METRICS
928  if ( !( load_flags & FT_LOAD_NO_HINTING ) )
930  FT_BOOL( load_flags & FT_LOAD_VERTICAL_LAYOUT ) );
931 #endif
932  }
933  }
934 
935  Load_Ok:
936  /* compute the advance */
937  if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
938  {
939  slot->advance.x = 0;
940  slot->advance.y = slot->metrics.vertAdvance;
941  }
942  else
943  {
944  slot->advance.x = slot->metrics.horiAdvance;
945  slot->advance.y = 0;
946  }
947 
948  /* compute the linear advance in 16.16 pixels */
949  if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&
950  FT_IS_SCALABLE( face ) )
951  {
952  FT_Size_Metrics* metrics = &face->size->metrics;
953 
954 
955  /* it's tricky! */
956  slot->linearHoriAdvance = FT_MulDiv( slot->linearHoriAdvance,
957  metrics->x_scale, 64 );
958 
959  slot->linearVertAdvance = FT_MulDiv( slot->linearVertAdvance,
960  metrics->y_scale, 64 );
961  }
962 
963  if ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) == 0 )
964  {
965  FT_Face_Internal internal = face->internal;
966 
967 
968  /* now, transform the glyph image if needed */
969  if ( internal->transform_flags )
970  {
971  /* get renderer */
973 
974 
975  if ( renderer )
976  error = renderer->clazz->transform_glyph(
977  renderer, slot,
978  &internal->transform_matrix,
979  &internal->transform_delta );
980  else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
981  {
982  /* apply `standard' transformation if no renderer is available */
983  if ( internal->transform_flags & 1 )
984  FT_Outline_Transform( &slot->outline,
985  &internal->transform_matrix );
986 
987  if ( internal->transform_flags & 2 )
988  FT_Outline_Translate( &slot->outline,
989  internal->transform_delta.x,
990  internal->transform_delta.y );
991  }
992 
993  /* transform advance */
994  FT_Vector_Transform( &slot->advance, &internal->transform_matrix );
995  }
996  }
997 
998  /* do we need to render the image or preset the bitmap now? */
999  if ( !error &&
1000  ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
1001  slot->format != FT_GLYPH_FORMAT_BITMAP &&
1002  slot->format != FT_GLYPH_FORMAT_COMPOSITE )
1003  {
1004  FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
1005 
1006 
1007  if ( mode == FT_RENDER_MODE_NORMAL &&
1008  load_flags & FT_LOAD_MONOCHROME )
1010 
1011  if ( load_flags & FT_LOAD_RENDER )
1013  else
1015  }
1016 
1017  FT_TRACE5(( "FT_Load_Glyph: index %d, flags %x\n",
1018  glyph_index, load_flags ));
1019  FT_TRACE5(( " x advance: %f\n", slot->advance.x / 64.0 ));
1020  FT_TRACE5(( " y advance: %f\n", slot->advance.y / 64.0 ));
1021  FT_TRACE5(( " linear x advance: %f\n",
1022  slot->linearHoriAdvance / 65536.0 ));
1023  FT_TRACE5(( " linear y advance: %f\n",
1024  slot->linearVertAdvance / 65536.0 ));
1025  FT_TRACE5(( " bitmap %dx%d, mode %d\n",
1026  slot->bitmap.width, slot->bitmap.rows,
1027  slot->bitmap.pixel_mode ));
1028 
1029  Exit:
1030  return error;
1031  }
#define FT_DRIVER_HINTS_LIGHTLY(x)
Definition: ftobjs.h:571
FT_Int transform_flags
Definition: ftobjs.h:408
int FT_Error
Definition: fttypes.h:300
#define FT_LOAD_VERTICAL_LAYOUT
Definition: freetype.h:3013
#define TRUE
Definition: types.h:120
#define FT_LOAD_SBITS_ONLY
Definition: freetype.h:3032
#define ft_strstr
Definition: ftstdlib.h:92
#define error(str)
Definition: mkdosfs.c:1605
struct _slot slot
Definition: vfat.h:196
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
signed int FT_Int
Definition: fttypes.h:220
enum FT_Render_Mode_ FT_Render_Mode
#define FT_LOAD_NO_HINTING
Definition: freetype.h:3010
#define FT_DRIVER_HAS_HINTER(x)
Definition: ftobjs.h:568
#define FT_LOAD_NO_RECURSE
Definition: freetype.h:3018
static FT_Renderer ft_lookup_glyph_renderer(FT_GlyphSlot slot)
Definition: ftobjs.c:4306
static void ft_glyphslot_grid_fit_metrics(FT_GlyphSlot slot, FT_Bool vertical)
Definition: ftobjs.c:707
FT_Library library
Definition: cffdrivr.c:654
#define FT_DRIVER_USES_OUTLINES(x)
Definition: ftobjs.h:565
FT_BEGIN_HEADER struct PS_DriverRec_ * PS_Driver
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
#define FT_LOAD_LINEAR_DESIGN
Definition: freetype.h:3021
#define FT_LOAD_NO_SCALE
Definition: freetype.h:3009
FT_Module auto_hinter
Definition: ftobjs.h:929
FT_Renderer_Class * clazz
Definition: ftobjs.h:774
TT_MaxProfile max_profile
Definition: tttypes.h:1404
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_HINTING_ADOBE
Definition: ftdriver.h:346
#define FT_LOAD_RENDER
Definition: freetype.h:3011
FT_AutoHinter_GlyphLoadFunc load_glyph
Definition: autohint.h:195
FT_ULong cvt_program_size
Definition: tttypes.h:1479
smooth NULL
Definition: ftsmooth.c:416
#define FT_LOAD_FORCE_AUTOHINT
Definition: freetype.h:3014
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
Definition: ftoutln.c:711
FT_Render_Glyph(FT_GlyphSlot slot, FT_Render_Mode render_mode)
Definition: ftobjs.c:4650
struct TT_FaceRec_ * TT_Face
Definition: tttypes.h:973
#define FT_DRIVER_IS_SCALABLE(x)
Definition: ftobjs.h:562
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:416
#define FT_HAS_FIXED_SIZES(face)
Definition: freetype.h:1361
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
Definition: ftsmooth.c:416
#define FT_IS_TRICKY(face)
Definition: freetype.h:1474
static void Exit(void)
Definition: sock.c:1331
const void * module_interface
Definition: ftmodapi.h:225
struct FT_AutoHinter_InterfaceRec_ * FT_AutoHinter_Interface
#define FT_IS_SFNT(face)
Definition: freetype.h:1331
#define FT_LOAD_MONOCHROME
Definition: freetype.h:3020
#define FT_BOOL(x)
Definition: fttypes.h:578
GLenum mode
Definition: glext.h:6217
ft_glyphslot_preset_bitmap(FT_GlyphSlot slot, FT_Render_Mode mode, const FT_Vector *origin)
Definition: ftobjs.c:334
FT_Outline_Check(FT_Outline *outline)
Definition: ftoutln.c:357
Definition: vfat.h:184
FT_UShort maxSizeOfInstructions
Definition: tttables.h:581
FT_Vector_Transform(FT_Vector *vec, const FT_Matrix *matrix)
Definition: ftoutln.c:688
#define FT_TRACE5(varformat)
Definition: ftdebug.h:162
typedefFT_BEGIN_HEADER struct FT_AutoHinterRec_ * FT_AutoHinter
Definition: autohint.h:80
#define FT_LOAD_NO_AUTOHINT
Definition: freetype.h:3022
FT_Renderer_TransformFunc transform_glyph
Definition: ftrender.h:152
ios_base &_STLP_CALL internal(ios_base &__s)
Definition: _ios_base.h:311
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
Definition: ftoutln.c:528
FT_ULong num_locations
Definition: tttypes.h:1523
FT_ULong font_program_size
Definition: tttypes.h:1475
#define FT_LOAD_NO_BITMAP
Definition: freetype.h:3012
struct @1625::@1626 driver
#define FT_LOAD_IGNORE_TRANSFORM
Definition: freetype.h:3019
#define FT_IS_SCALABLE(face)
Definition: freetype.h:1312
FT_Module_Class * clazz
Definition: ftobjs.h:535
#define FT_LOAD_BITMAP_METRICS_ONLY
Definition: freetype.h:3026
static void ft_glyphslot_clear(FT_GlyphSlot slot)
Definition: ftobjs.c:496
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_BEGIN_HEADER FT_Get_Font_Format(FT_Face face)
Definition: ftfntfmt.c:28
#define FT_LOAD_TARGET_MODE(x)
Definition: freetype.h:3137

Referenced by af_latin_metrics_init_blues(), af_latin_metrics_init_widths(), af_loader_load_glyph(), FT_Get_Advances(), FT_Load_Char(), ftc_basic_family_load_bitmap(), ftc_basic_family_load_glyph(), ftGdiGetGlyphOutline(), gxv_ctlPoint_validate(), gxv_prop_zero_advance_validate(), IntExtTextOutW(), NtGdiGetCharABCWidthsW(), NtGdiGetCharWidthW(), TestFace(), and TextIntGetTextExtentPoint().

◆ FT_Load_Sfnt_Table()

FT_Load_Sfnt_Table ( FT_Face  face,
FT_ULong  tag,
FT_Long  offset,
FT_Byte buffer,
FT_ULong length 
)

Definition at line 4134 of file ftobjs.c.

4139  {
4140  FT_Service_SFNT_Table service;
4141 
4142 
4143  if ( !face || !FT_IS_SFNT( face ) )
4144  return FT_THROW( Invalid_Face_Handle );
4145 
4146  FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
4147  if ( !service )
4148  return FT_THROW( Unimplemented_Feature );
4149 
4150  return service->load_table( face, tag, offset, buffer, length );
4151  }
GLintptr offset
Definition: glext.h:5920
Definition: ecma_167.h:138
GLuint buffer
Definition: glext.h:5915
#define FT_THROW(e)
Definition: ftdebug.h:213
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define FT_IS_SFNT(face)
Definition: freetype.h:1331
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:75
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by ftGdiGetFontData(), gxv_load_table(), IntFontType(), and otv_load_table().

◆ ft_lookup_glyph_renderer()

static FT_Renderer ft_lookup_glyph_renderer ( FT_GlyphSlot  slot)
static

Definition at line 4306 of file ftobjs.c.

4307  {
4308  FT_Face face = slot->face;
4311 
4312 
4313  if ( !result || result->glyph_format != slot->format )
4314  result = FT_Lookup_Renderer( library, slot->format, 0 );
4315 
4316  return result;
4317  }
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
Definition: ftobjs.c:4264
FT_Library library
Definition: cffdrivr.c:654
FT_Renderer cur_renderer
Definition: ftobjs.h:928
Definition: vfat.h:184
#define FT_FACE_LIBRARY(x)
Definition: ftobjs.h:635
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FT_Load_Glyph().

◆ FT_Lookup_Renderer()

FT_Lookup_Renderer ( FT_Library  library,
FT_Glyph_Format  format,
FT_ListNode node 
)

Definition at line 4264 of file ftobjs.c.

4267  {
4268  FT_ListNode cur;
4270 
4271 
4272  if ( !library )
4273  goto Exit;
4274 
4275  cur = library->renderers.head;
4276 
4277  if ( node )
4278  {
4279  if ( *node )
4280  cur = (*node)->next;
4281  *node = NULL;
4282  }
4283 
4284  while ( cur )
4285  {
4286  FT_Renderer renderer = FT_RENDERER( cur->data );
4287 
4288 
4289  if ( renderer->glyph_format == format )
4290  {
4291  if ( node )
4292  *node = cur;
4293 
4294  result = renderer;
4295  break;
4296  }
4297  cur = cur->next;
4298  }
4299 
4300  Exit:
4301  return result;
4302  }
FT_ListNode next
Definition: fttypes.h:547
void * data
Definition: fttypes.h:548
FT_Glyph_Format glyph_format
Definition: ftobjs.h:775
FT_ListNode head
Definition: fttypes.h:569
FT_Library library
Definition: cffdrivr.c:654
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
static void Exit(void)
Definition: sock.c:1331
#define FT_RENDERER(x)
Definition: ftobjs.h:765
FT_ListRec renderers
Definition: ftobjs.h:927
GLuint64EXT * result
Definition: glext.h:11304
Definition: dlist.c:348

Referenced by FT_Get_Glyph(), FT_Get_Renderer(), ft_lookup_glyph_renderer(), FT_Outline_Render(), FT_Render_Glyph_Internal(), and ft_set_current_renderer().

◆ FT_Match_Size()

FT_Match_Size ( FT_Face  face,
FT_Size_Request  req,
FT_Bool  ignore_width,
FT_ULong size_index 
)

Definition at line 2875 of file ftobjs.c.

2879  {
2880  FT_Int i;
2881  FT_Long w, h;
2882 
2883 
2884  if ( !FT_HAS_FIXED_SIZES( face ) )
2885  return FT_THROW( Invalid_Face_Handle );
2886 
2887  /* FT_Bitmap_Size doesn't provide enough info... */
2888  if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )
2889  return FT_THROW( Unimplemented_Feature );
2890 
2891  w = FT_REQUEST_WIDTH ( req );
2892  h = FT_REQUEST_HEIGHT( req );
2893 
2894  if ( req->width && !req->height )
2895  h = w;
2896  else if ( !req->width && req->height )
2897  w = h;
2898 
2899  w = FT_PIX_ROUND( w );
2900  h = FT_PIX_ROUND( h );
2901 
2902  if ( !w || !h )
2903  return FT_THROW( Invalid_Pixel_Size );
2904 
2905  for ( i = 0; i < face->num_fixed_sizes; i++ )
2906  {
2907  FT_Bitmap_Size* bsize = face->available_sizes + i;
2908 
2909 
2910  if ( h != FT_PIX_ROUND( bsize->y_ppem ) )
2911  continue;
2912 
2913  if ( w == FT_PIX_ROUND( bsize->x_ppem ) || ignore_width )
2914  {
2915  FT_TRACE3(( "FT_Match_Size: bitmap strike %d matches\n", i ));
2916 
2917  if ( size_index )
2918  *size_index = (FT_ULong)i;
2919 
2920  return FT_Err_Ok;
2921  }
2922  }
2923 
2924  FT_TRACE3(( "FT_Match_Size: no matching bitmap strike\n" ));
2925 
2926  return FT_THROW( Invalid_Pixel_Size );
2927  }
signed long FT_Long
Definition: fttypes.h:242
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
unsigned long FT_ULong
Definition: fttypes.h:253
FT_Pos x_ppem
Definition: freetype.h:378
signed int FT_Int
Definition: fttypes.h:220
#define FT_REQUEST_HEIGHT(req)
Definition: ftobjs.h:694
return FT_Err_Ok
Definition: ftbbox.c:511
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
Definition: glfuncs.h:248
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_REQUEST_WIDTH(req)
Definition: ftobjs.h:689
FT_Size_Request_Type type
Definition: freetype.h:2619
#define FT_HAS_FIXED_SIZES(face)
Definition: freetype.h:1361
FT_Pos y_ppem
Definition: freetype.h:379
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
#define FT_PIX_ROUND(x)
Definition: ftobjs.h:93
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by FT_Request_Size().

◆ ft_module_get_service()

ft_module_get_service ( FT_Module  module,
const char service_id,
FT_Bool  global 
)

Definition at line 4880 of file ftobjs.c.

4883  {
4885 
4886 
4887  if ( module )
4888  {
4889  FT_ASSERT( module->clazz && module->clazz->get_interface );
4890 
4891  /* first, look for the service in the module */
4892  if ( module->clazz->get_interface )
4893  result = module->clazz->get_interface( module, service_id );
4894 
4895  if ( global && !result )
4896  {
4897  /* we didn't find it, look in all other modules then */
4898  FT_Library library = module->library;
4899  FT_Module* cur = library->modules;
4900  FT_Module* limit = cur + library->num_modules;
4901 
4902 
4903  for ( ; cur < limit; cur++ )
4904  {
4905  if ( cur[0] != module )
4906  {
4907  FT_ASSERT( cur[0]->clazz );
4908 
4909  if ( cur[0]->clazz->get_interface )
4910  {
4911  result = cur[0]->clazz->get_interface( cur[0], service_id );
4912  if ( result )
4913  break;
4914  }
4915  }
4916  }
4917  }
4918  }
4919 
4920  return result;
4921  }
FT_Library library
Definition: cffdrivr.c:654
GLint limit
Definition: glext.h:10326
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
smooth NULL
Definition: ftsmooth.c:416
FT_UInt num_modules
Definition: ftobjs.h:924
FT_Module modules[FT_MAX_MODULES]
Definition: ftobjs.h:925
FT_Module_Requester get_interface
Definition: ftmodapi.h:229
GLuint64EXT * result
Definition: glext.h:11304
FT_Module_Class * clazz
Definition: ftobjs.h:535

Referenced by cff_get_glyph_name(), cff_get_name_index(), FT_DEFINE_SERVICE_PSINFOREC(), FT_Get_TrueType_Engine_Type(), if(), and sfnt_init_face().

◆ FT_New_Face()

FT_New_Face ( FT_Library  library,
const char pathname,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 1406 of file ftobjs.c.

1410  {
1412 
1413 
1414  /* test for valid `library' and `aface' delayed to `FT_Open_Face' */
1415  if ( !pathname )
1416  return FT_THROW( Invalid_Argument );
1417 
1418  args.flags = FT_OPEN_PATHNAME;
1419  args.pathname = (char*)pathname;
1420  args.stream = NULL;
1421 
1422  return ft_open_face_internal( library, &args, face_index, aface, 1 );
1423  }
#define FT_OPEN_PATHNAME
Definition: freetype.h:2036
static FT_Error ft_open_face_internal(FT_Library library, const FT_Open_Args *args, FT_Long face_index, FT_Face *aface, FT_Bool test_mac_fonts)
Definition: ftobjs.c:2327
char pathname[512]
Definition: util.h:13
FT_Library library
Definition: cffdrivr.c:654
Definition: match.c:390
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
#define args
Definition: format.c:66

Referenced by ExecuteTest().

◆ FT_New_GlyphSlot()

FT_New_GlyphSlot ( FT_Face  face,
FT_GlyphSlot aslot 
)

Definition at line 559 of file ftobjs.c.

561  {
562  FT_Error error;
564  FT_Driver_Class clazz;
567 
568 
569  if ( !face )
570  return FT_THROW( Invalid_Face_Handle );
571 
572  if ( !face->driver )
573  return FT_THROW( Invalid_Argument );
574 
575  driver = face->driver;
576  clazz = driver->clazz;
577  memory = driver->root.memory;
578 
579  FT_TRACE4(( "FT_New_GlyphSlot: Creating new slot object\n" ));
580  if ( !FT_ALLOC( slot, clazz->slot_object_size ) )
581  {
582  slot->face = face;
583 
585  if ( error )
586  {
588  FT_FREE( slot );
589  goto Exit;
590  }
591 
592  slot->next = face->glyph;
593  face->glyph = slot;
594 
595  if ( aslot )
596  *aslot = slot;
597  }
598  else if ( aslot )
599  *aslot = NULL;
600 
601 
602  Exit:
603  FT_TRACE4(( "FT_New_GlyphSlot: Return 0x%x\n", error ));
604 
605  return error;
606  }
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
int FT_Error
Definition: fttypes.h:300
static void ft_glyphslot_done(FT_GlyphSlot slot)
Definition: ftobjs.c:528
#define error(str)
Definition: mkdosfs.c:1605
struct _slot slot
Definition: vfat.h:196
FT_Long slot_object_size
Definition: ftdrv.h:163
WORD face[3]
Definition: mesh.c:4747
static char memory[1024 *256]
Definition: process.c:116
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
static void Exit(void)
Definition: sock.c:1331
static FT_Error ft_glyphslot_init(FT_GlyphSlot slot)
Definition: ftobjs.c:286
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
Definition: vfat.h:184
struct @1625::@1626 driver
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by ft_open_face_internal(), and T42_GlyphSlot_Init().

◆ FT_New_Library()

FT_New_Library ( FT_Memory  memory,
FT_Library alibrary 
)

Definition at line 5138 of file ftobjs.c.

5140  {
5142  FT_Error error;
5143 
5144 
5145  if ( !memory || !alibrary )
5146  return FT_THROW( Invalid_Argument );
5147 
5148 #ifdef FT_DEBUG_LEVEL_ERROR
5149  /* init debugging support */
5150  ft_debug_init();
5151 #endif
5152 
5153  /* first of all, allocate the library object */
5154  if ( FT_NEW( library ) )
5155  return error;
5156 
5157  library->memory = memory;
5158 
5159 #ifdef FT_CONFIG_OPTION_PIC
5160  /* initialize position independent code containers */
5161  error = ft_pic_container_init( library );
5162  if ( error )
5163  goto Fail;
5164 #endif
5165 
5169 
5170  library->refcount = 1;
5171 
5172  /* That's ok now */
5173  *alibrary = library;
5174 
5175  return FT_Err_Ok;
5176 
5177 #ifdef FT_CONFIG_OPTION_PIC
5178  Fail:
5179  ft_pic_container_destroy( library );
5180  FT_FREE( library );
5181  return error;
5182 #endif
5183  }
#define FREETYPE_MINOR
Definition: freetype.h:4554
int FT_Error
Definition: fttypes.h:300
FT_Memory memory
Definition: ftobjs.h:918
#define error(str)
Definition: mkdosfs.c:1605
FT_Library library
Definition: cffdrivr.c:654
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
FT_Int version_patch
Definition: ftobjs.h:922
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_Int version_major
Definition: ftobjs.h:920
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FREETYPE_PATCH
Definition: freetype.h:4555
FT_Int version_minor
Definition: ftobjs.h:921
#define FREETYPE_MAJOR
Definition: freetype.h:4553
Definition: hiveinit.c:368
ft_debug_init(void)
Definition: ftdebug.c:241
#define FT_NEW(ptr)
Definition: ftmemory.h:331
FT_Int refcount
Definition: ftobjs.h:942

Referenced by FT_Init_FreeType().

◆ FT_New_Memory_Face()

FT_New_Memory_Face ( FT_Library  library,
const FT_Byte file_base,
FT_Long  file_size,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 1431 of file ftobjs.c.

1436  {
1438 
1439 
1440  /* test for valid `library' and `face' delayed to `FT_Open_Face' */
1441  if ( !file_base )
1442  return FT_THROW( Invalid_Argument );
1443 
1444  args.flags = FT_OPEN_MEMORY;
1445  args.memory_base = file_base;
1446  args.memory_size = file_size;
1447  args.stream = NULL;
1448 
1449  return ft_open_face_internal( library, &args, face_index, aface, 1 );
1450  }
static FT_Error ft_open_face_internal(FT_Library library, const FT_Open_Args *args, FT_Long face_index, FT_Face *aface, FT_Bool test_mac_fonts)
Definition: ftobjs.c:2327
#define FT_OPEN_MEMORY
Definition: freetype.h:2034
FT_Library library
Definition: cffdrivr.c:654
Definition: match.c:390
#define FT_THROW(e)
Definition: ftdebug.h:213
smooth NULL
Definition: ftsmooth.c:416
#define args
Definition: format.c:66
#define file_size(inode)
Definition: reiserfs_fs.h:1869

Referenced by FtfdLoadFontFile(), FtfdQueryFont(), FtfdQueryFontTree(), and IntGdiLoadFontsFromMemory().

◆ FT_New_Size()

FT_New_Size ( FT_Face  face,
FT_Size asize 
)

Definition at line 2762 of file ftobjs.c.

2764  {
2765  FT_Error error;
2766  FT_Memory memory;
2767  FT_Driver driver;
2768  FT_Driver_Class clazz;
2769 
2770  FT_Size size = NULL;
2771  FT_ListNode node = NULL;
2772 
2773  FT_Size_Internal internal = NULL;
2774 
2775 
2776  if ( !face )
2777  return FT_THROW( Invalid_Face_Handle );
2778 
2779  if ( !asize )
2780  return FT_THROW( Invalid_Argument );
2781 
2782  if ( !face->driver )
2783  return FT_THROW( Invalid_Driver_Handle );
2784 
2785  *asize = NULL;
2786 
2787  driver = face->driver;
2788  clazz = driver->clazz;
2789  memory = face->memory;
2790 
2791  /* Allocate new size object and perform basic initialisation */
2792  if ( FT_ALLOC( size, clazz->size_object_size ) || FT_NEW( node ) )
2793  goto Exit;
2794 
2795  size->face = face;
2796 
2797  if ( FT_NEW( internal ) )
2798  goto Exit;
2799 
2800  size->internal = internal;
2801 
2802  if ( clazz->init_size )
2803  error = clazz->init_size( size );
2804 
2805  /* in case of success, add to the face's list */
2806  if ( !error )
2807  {
2808  *asize = size;
2809  node->data = size;
2810  FT_List_Add( &face->sizes_list, node );
2811  }
2812 
2813  Exit:
2814  if ( error )
2815  {
2816  FT_FREE( node );
2817  FT_FREE( size );
2818  }
2819 
2820  return error;
2821  }
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
WORD face[3]
Definition: mesh.c:4747
static char memory[1024 *256]
Definition: process.c:116
GLvoid * data
Definition: dlist.c:359
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_Long size_object_size
Definition: ftdrv.h:162
smooth NULL
Definition: ftsmooth.c:416
#define FT_FREE(ptr)
Definition: ftmemory.h:329
GLsizeiptr size
Definition: glext.h:5919
static void Exit(void)
Definition: sock.c:1331
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_List_Add(FT_List list, FT_ListNode node)
Definition: ftutil.c:269
#define FT_NEW(ptr)
Definition: ftmemory.h:331
struct @1625::@1626 driver
FT_Size_InitFunc init_size
Definition: ftdrv.h:168
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
Definition: dlist.c:348

Referenced by ft_open_face_internal(), ftc_scaler_lookup_size(), and T42_Size_Init().

◆ FT_Open_Face()

FT_Open_Face ( FT_Library  library,
const FT_Open_Args args,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 2317 of file ftobjs.c.

2321  {
2322  return ft_open_face_internal( library, args, face_index, aface, 1 );
2323  }
static FT_Error ft_open_face_internal(FT_Library library, const FT_Open_Args *args, FT_Long face_index, FT_Face *aface, FT_Bool test_mac_fonts)
Definition: ftobjs.c:2327
FT_Library library
Definition: cffdrivr.c:654
Definition: match.c:390

Referenced by T42_Face_Init().

◆ ft_open_face_internal()

static FT_Error ft_open_face_internal ( FT_Library  library,
const FT_Open_Args args,
FT_Long  face_index,
FT_Face aface,
FT_Bool  test_mac_fonts 
)
static

Definition at line 2327 of file ftobjs.c.

2332  {
2333  FT_Error error;
2334  FT_Driver driver = NULL;
2335  FT_Memory memory = NULL;
2336  FT_Stream stream = NULL;
2337  FT_Face face = NULL;
2338  FT_ListNode node = NULL;
2339  FT_Bool external_stream;
2340  FT_Module* cur;
2341  FT_Module* limit;
2342 
2343 #ifndef FT_CONFIG_OPTION_MAC_FONTS
2344  FT_UNUSED( test_mac_fonts );
2345 #endif
2346 
2347 
2348 #ifdef FT_DEBUG_LEVEL_TRACE
2349  FT_TRACE3(( "FT_Open_Face: " ));
2350  if ( face_index < 0 )
2351  FT_TRACE3(( "Requesting number of faces and named instances\n"));
2352  else
2353  {
2354  FT_TRACE3(( "Requesting face %ld", face_index & 0xFFFFL ));
2355  if ( face_index & 0x7FFF0000L )
2356  FT_TRACE3(( ", named instance %ld", face_index >> 16 ));
2357  FT_TRACE3(( "\n" ));
2358  }
2359 #endif
2360 
2361  /* test for valid `library' delayed to `FT_Stream_New' */
2362 
2363  if ( ( !aface && face_index >= 0 ) || !args )
2364  return FT_THROW( Invalid_Argument );
2365 
2366  external_stream = FT_BOOL( ( args->flags & FT_OPEN_STREAM ) &&
2367  args->stream );
2368 
2369  /* create input stream */
2371  if ( error )
2372  goto Fail3;
2373 
2374  memory = library->memory;
2375 
2376  /* If the font driver is specified in the `args' structure, use */
2377  /* it. Otherwise, we scan the list of registered drivers. */
2378  if ( ( args->flags & FT_OPEN_DRIVER ) && args->driver )
2379  {
2380  driver = FT_DRIVER( args->driver );
2381 
2382  /* not all modules are drivers, so check... */
2383  if ( FT_MODULE_IS_DRIVER( driver ) )
2384  {
2385  FT_Int num_params = 0;
2387 
2388 
2389  if ( args->flags & FT_OPEN_PARAMS )
2390  {
2391  num_params = args->num_params;
2392  params = args->params;
2393  }
2394 
2395  error = open_face( driver, &stream, external_stream, face_index,
2396  num_params, params, &face );
2397  if ( !error )
2398  goto Success;
2399  }
2400  else
2401  error = FT_THROW( Invalid_Handle );
2402 
2403  FT_Stream_Free( stream, external_stream );
2404  goto Fail;
2405  }
2406  else
2407  {
2408  error = FT_ERR( Missing_Module );
2409 
2410  /* check each font driver for an appropriate format */
2411  cur = library->modules;
2412  limit = cur + library->num_modules;
2413 
2414  for ( ; cur < limit; cur++ )
2415  {
2416  /* not all modules are font drivers, so check... */
2417  if ( FT_MODULE_IS_DRIVER( cur[0] ) )
2418  {
2419  FT_Int num_params = 0;
2421 
2422 
2423  driver = FT_DRIVER( cur[0] );
2424 
2425  if ( args->flags & FT_OPEN_PARAMS )
2426  {
2427  num_params = args->num_params;
2428  params = args->params;
2429  }
2430 
2431  error = open_face( driver, &stream, external_stream, face_index,
2432  num_params, params, &face );
2433  if ( !error )
2434  goto Success;
2435 
2436 #ifdef FT_CONFIG_OPTION_MAC_FONTS
2437  if ( test_mac_fonts &&
2438  ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
2439  FT_ERR_EQ( error, Table_Missing ) )
2440  {
2441  /* TrueType but essential tables are missing */
2442  error = FT_Stream_Seek( stream, 0 );
2443  if ( error )
2444  break;
2445 
2446  error = open_face_PS_from_sfnt_stream( library,
2447  stream,
2448  face_index,
2449  num_params,
2450  params,
2451  aface );
2452  if ( !error )
2453  {
2454  FT_Stream_Free( stream, external_stream );
2455  return error;
2456  }
2457  }
2458 #endif
2459 
2460  if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
2461  goto Fail3;
2462  }
2463  }
2464 
2465  Fail3:
2466  /* If we are on the mac, and we get an */
2467  /* FT_Err_Invalid_Stream_Operation it may be because we have an */
2468  /* empty data fork, so we need to check the resource fork. */
2469  if ( FT_ERR_NEQ( error, Cannot_Open_Stream ) &&
2470  FT_ERR_NEQ( error, Unknown_File_Format ) &&
2471  FT_ERR_NEQ( error, Invalid_Stream_Operation ) )
2472  goto Fail2;
2473 
2474 #if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )
2475  if ( test_mac_fonts )
2476  {
2477  error = load_mac_face( library, stream, face_index, aface, args );
2478  if ( !error )
2479  {
2480  /* We don't want to go to Success here. We've already done */
2481  /* that. On the other hand, if we succeeded we still need to */
2482  /* close this stream (we opened a different stream which */
2483  /* extracted the interesting information out of this stream */
2484  /* here. That stream will still be open and the face will */
2485  /* point to it). */
2486  FT_Stream_Free( stream, external_stream );
2487  return error;
2488  }
2489  }
2490 
2491  if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
2492  goto Fail2;
2493 #endif /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */
2494 
2495  /* no driver is able to handle this format */
2496  error = FT_THROW( Unknown_File_Format );
2497 
2498  Fail2:
2499  FT_Stream_Free( stream, external_stream );
2500  goto Fail;
2501  }
2502 
2503  Success:
2504  FT_TRACE4(( "FT_Open_Face: New face object, adding to list\n" ));
2505 
2506  /* add the face object to its driver's list */
2507  if ( FT_NEW( node ) )
2508  goto Fail;
2509 
2510  node->data = face;
2511  /* don't assume driver is the same as face->driver, so use */
2512  /* face->driver instead. */
2513  FT_List_Add( &face->driver->faces_list, node );
2514 
2515  /* now allocate a glyph slot object for the face */
2516  FT_TRACE4(( "FT_Open_Face: Creating glyph slot\n" ));
2517 
2518  if ( face_index >= 0 )
2519  {
2521  if ( error )
2522  goto Fail;
2523 
2524  /* finally, allocate a size object for the face */
2525  {
2526  FT_Size size;
2527 
2528 
2529  FT_TRACE4(( "FT_Open_Face: Creating size object\n" ));
2530 
2531  error = FT_New_Size( face, &size );
2532  if ( error )
2533  goto Fail;
2534 
2535  face->size = size;
2536  }
2537  }
2538 
2539  /* some checks */
2540 
2541  if ( FT_IS_SCALABLE( face ) )
2542  {
2543  if ( face->height < 0 )
2544  face->height = (FT_Short)-face->height;
2545 
2546  if ( !FT_HAS_VERTICAL( face ) )
2547  face->max_advance_height = (FT_Short)face->height;
2548  }
2549 
2550  if ( FT_HAS_FIXED_SIZES( face ) )
2551  {
2552  FT_Int i;
2553 
2554 
2555  for ( i = 0; i < face->num_fixed_sizes; i++ )
2556  {
2557  FT_Bitmap_Size* bsize = face->available_sizes + i;
2558 
2559 
2560  if ( bsize->height < 0 )
2561  bsize->height = -bsize->height;
2562  if ( bsize->x_ppem < 0 )
2563  bsize->x_ppem = -bsize->x_ppem;
2564  if ( bsize->y_ppem < 0 )
2565  bsize->y_ppem = -bsize->y_ppem;
2566 
2567  /* check whether negation actually has worked */
2568  if ( bsize->height < 0 || bsize->x_ppem < 0 || bsize->y_ppem < 0 )
2569  {
2570  FT_TRACE0(( "FT_Open_Face:"
2571  " Invalid bitmap dimensions for strike %d,"
2572  " now disabled\n", i ));
2573  bsize->width = 0;
2574  bsize->height = 0;
2575  bsize->size = 0;
2576  bsize->x_ppem = 0;
2577  bsize->y_ppem = 0;
2578  }
2579  }
2580  }
2581 
2582  /* initialize internal face data */
2583  {
2584  FT_Face_Internal internal = face->internal;
2585 
2586 
2587  internal->transform_matrix.xx = 0x10000L;
2588  internal->transform_matrix.xy = 0;
2589  internal->transform_matrix.yx = 0;
2590  internal->transform_matrix.yy = 0x10000L;
2591 
2592  internal->transform_delta.x = 0;
2593  internal->transform_delta.y = 0;
2594 
2595  internal->refcount = 1;
2596 
2597  internal->no_stem_darkening = -1;
2598 
2599 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
2600  /* Per-face filtering can only be set up by FT_Face_Properties */
2601  internal->lcd_filter_func = NULL;
2602 #endif
2603  }
2604 
2605  if ( aface )
2606  *aface = face;
2607  else
2608  FT_Done_Face( face );
2609 
2610  goto Exit;
2611 
2612  Fail:
2613  if ( node )
2614  FT_Done_Face( face ); /* face must be in the driver's list */
2615  else if ( face )
2617 
2618  Exit:
2619 #ifdef FT_DEBUG_LEVEL_TRACE
2620  if ( !error && face_index < 0 )
2621  {
2622  FT_TRACE3(( "FT_Open_Face: The font has %ld face%s\n"
2623  " and %ld named instance%s for face %ld\n",
2624  face->num_faces,
2625  face->num_faces == 1 ? "" : "s",
2626  face->style_flags >> 16,
2627  ( face->style_flags >> 16 ) == 1 ? "" : "s",
2628  -face_index - 1 ));
2629  }
2630 #endif
2631 
2632  FT_TRACE4(( "FT_Open_Face: Return 0x%x\n", error ));
2633 
2634  return error;
2635  }
int FT_Error
Definition: fttypes.h:300
#define FT_DRIVER(x)
Definition: ftobjs.h:799
FT_Stream_Seek(FT_Stream stream, FT_ULong pos)
Definition: ftstream.c:57
FT_Pos x_ppem
Definition: freetype.h:378
FT_Memory memory
Definition: ftobjs.h:918
#define error(str)
Definition: mkdosfs.c:1605
signed int FT_Int
Definition: fttypes.h:220
FT_New_GlyphSlot(FT_Face face, FT_GlyphSlot *aslot)
Definition: ftobjs.c:559
static void destroy_face(FT_Memory memory, FT_Face face, FT_Driver driver)
Definition: ftobjs.c:1105
#define FT_OPEN_PARAMS
Definition: freetype.h:2038
FT_Done_Face(FT_Face face)
Definition: ftobjs.c:2721
WORD face[3]
Definition: mesh.c:4747
FT_Library library
Definition: cffdrivr.c:654
#define FT_OPEN_STREAM
Definition: freetype.h:2035
Definition: match.c:390
static char memory[1024 *256]
Definition: process.c:116
GLvoid * data
Definition: dlist.c:359
GLint limit
Definition: glext.h:10326
#define FT_OPEN_DRIVER
Definition: freetype.h:2037
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
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
Definition: glfuncs.h:248
FT_Fixed xx
Definition: fttypes.h:387
static FT_Error open_face(FT_Driver driver, FT_Stream *astream, FT_Bool external_stream, FT_Long face_index, FT_Int num_params, FT_Parameter *params, FT_Face *aface)
Definition: ftobjs.c:1306
GLenum const GLfloat * params
Definition: glext.h:5645
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
smooth NULL
Definition: ftsmooth.c:416
#define FT_MODULE_IS_DRIVER(x)
Definition: ftobjs.h:550
#define FT_ERR(e)
Definition: fttypes.h:586
FT_New_Size(FT_Face face, FT_Size *asize)
Definition: ftobjs.c:2762
#define FT_TRACE0(varformat)
Definition: ftdebug.h:157
FT_UInt num_modules
Definition: ftobjs.h:924
GLsizeiptr size
Definition: glext.h:5919
#define FT_HAS_FIXED_SIZES(face)
Definition: freetype.h:1361
if(!(yy_init))
Definition: macro.lex.yy.c:714
static void Exit(void)
Definition: sock.c:1331
#define FT_ERR_EQ(x, e)
Definition: fttypes.h:591
FT_Pos y_ppem
Definition: freetype.h:379
FT_Short width
Definition: freetype.h:374
#define FT_ERR_NEQ(x, e)
Definition: fttypes.h:593
static const WCHAR L[]
Definition: oid.c:1250
Definition: parse.h:22
signed short FT_Short
Definition: fttypes.h:198
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_List_Add(FT_List list, FT_ListNode node)
Definition: ftutil.c:269
#define FT_BOOL(x)
Definition: fttypes.h:578
FT_Module modules[FT_MAX_MODULES]
Definition: ftobjs.h:925
#define FT_HAS_VERTICAL(face)
Definition: freetype.h:1283
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
Definition: hiveinit.c:368
FT_Stream_Free(FT_Stream stream, FT_Int external)
Definition: ftobjs.c:246
FT_Matrix transform_matrix
Definition: ftobjs.h:406
#define FT_NEW(ptr)
Definition: ftmemory.h:331
struct @1625::@1626 driver
#define FT_IS_SCALABLE(face)
Definition: freetype.h:1312
FT_Stream_New(FT_Library library, const FT_Open_Args *args, FT_Stream *astream)
Definition: ftobjs.c:178
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
FT_Short height
Definition: freetype.h:373
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define ft_strcmp
Definition: ftstdlib.h:86
Definition: dlist.c:348

Referenced by FT_New_Face(), FT_New_Memory_Face(), and FT_Open_Face().

◆ ft_property_do()

static FT_Error ft_property_do ( FT_Library  library,
const FT_String module_name,
const FT_String property_name,
void value,
FT_Bool  set,
FT_Bool  value_is_string 
)
static

Definition at line 4967 of file ftobjs.c.

4973  {
4974  FT_Module* cur;
4975  FT_Module* limit;
4977 
4978  FT_Service_Properties service;
4979 
4980 #ifdef FT_DEBUG_LEVEL_ERROR
4981  const FT_String* set_name = "FT_Property_Set";
4982  const FT_String* get_name = "FT_Property_Get";
4983  const FT_String* func_name = set ? set_name : get_name;
4984 #endif
4985 
4986  FT_Bool missing_func;
4987 
4988 
4989  if ( !library )
4990  return FT_THROW( Invalid_Library_Handle );
4991 
4992  if ( !module_name || !property_name || !value )
4993  return FT_THROW( Invalid_Argument );
4994 
4995  cur = library->modules;
4996  limit = cur + library->num_modules;
4997 
4998  /* search module */
4999  for ( ; cur < limit; cur++ )
5000  if ( !ft_strcmp( cur[0]->clazz->module_name, module_name ) )
5001  break;
5002 
5003  if ( cur == limit )
5004  {
5005  FT_ERROR(( "%s: can't find module `%s'\n",
5006  func_name, module_name ));
5007  return FT_THROW( Missing_Module );
5008  }
5009 
5010  /* check whether we have a service interface */
5011  if ( !cur[0]->clazz->get_interface )
5012  {
5013  FT_ERROR(( "%s: module `%s' doesn't support properties\n",
5014  func_name, module_name ));
5015  return FT_THROW( Unimplemented_Feature );
5016  }
5017 
5018  /* search property service */
5019  interface = cur[0]->clazz->get_interface( cur[0],
5021  if ( !interface )
5022  {
5023  FT_ERROR(( "%s: module `%s' doesn't support properties\n",
5024  func_name, module_name ));
5025  return FT_THROW( Unimplemented_Feature );
5026  }
5027 
5028  service = (FT_Service_Properties)interface;
5029 
5030  if ( set )
5031  missing_func = (FT_Bool)( !service->set_property );
5032  else
5033  missing_func = (FT_Bool)( !service->get_property );
5034 
5035  if ( missing_func )
5036  {
5037  FT_ERROR(( "%s: property service of module `%s' is broken\n",
5038  func_name, module_name ));
5039  return FT_THROW( Unimplemented_Feature );
5040  }
5041 
5042  return set ? service->set_property( cur[0],
5043  property_name,
5044  value,
5045  value_is_string )
5046  : service->get_property( cur[0],
5047  property_name,