📄 ftobjs.h
字号:
/*************************************************************************/#define FT_DEBUG_HOOK_TRUETYPE 0#define FT_DEBUG_HOOK_TYPE1 1 /*************************************************************************/ /* */ /* <Struct> */ /* FT_LibraryRec */ /* */ /* <Description> */ /* The FreeType library class. This is the root of all FreeType */ /* data. Use FT_New_Library() to create a library object, and */ /* FT_Done_Library() to discard it and all child objects. */ /* */ /* <Fields> */ /* memory :: The library's memory object. Manages memory */ /* allocation */ /* */ /* generic :: Client data variable. Used to extend the */ /* Library class by higher levels and clients. */ /* */ /* num_drivers :: The number of drivers currently registered */ /* within this library. This is set to 0 for new */ /* libraries. New drivers are added through the */ /* FT_Add_Driver() API function. */ /* */ /* drivers :: A table used to store handles to the currently */ /* registered font drivers. Note that each driver */ /* contains a list of its opened faces. */ /* */ /* glyph_formats :: A table used to store glyph format descriptors */ /* for new image formats that may have been */ /* registered within the library */ /* */ /* raster_pool :: The raster object's render pool. This can */ /* ideally be changed dynamically at run-time. */ /* */ typedef void (*FT_DebugHook_Func)( void* arg ); typedef struct FT_LibraryRec_ { FT_Memory memory; /* library's memory object */ FT_Generic generic; FT_Int num_drivers; FT_Driver drivers[ FT_MAX_DRIVERS ]; /* driver objects */ FT_Glyph_Format glyph_formats[FT_MAX_GLYPH_FORMATS]; void* raster_pool; /* scan-line conversion render pool */ FT_DebugHook_Func debug_hooks[4]; } FT_LibraryRec; /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Library */ /* */ /* <Description> */ /* This function is used to create a new FreeType library instance */ /* from a given memory object. It is thus possible to use libraries */ /* with distinct memory allocators within the same program. */ /* */ /* <Input> */ /* memory :: A handle to the original memory object. */ /* */ /* <Output> */ /* library :: A handle to a new library object. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ /* <Note> */ /* This function is normally not called by client applications, */ /* unless they want to create a specific instance of FreeType which */ /* uses a specific memory allocator. */ /* */ EXPORT_DEF FT_Error FT_New_Library( FT_Memory memory, FT_Library* library ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_Library */ /* */ /* <Description> */ /* Discards a given library object. This closes all drivers and */ /* discards all face objects. */ /* */ /* <Input> */ /* library :: A handle to the target library. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ EXPORT_DEF FT_Error FT_Done_Library( FT_Library library ); EXPORT_DEF void FT_Set_Debug_Hook( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Add_Driver */ /* */ /* <Description> */ /* Registers a new driver in a given library object. This function */ /* takes only a pointer to a driver interface. It uses it to create */ /* the new driver, then sets up some important fields. */ /* */ /* <Input> */ /* library :: A handle to the target library object. */ /* */ /* driver_interface :: A pointer to a driver interface table. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ /* <Note> */ /* This function doesn't check whether the driver is already */ /* installed! */ /* */ EXPORT_DEF FT_Error FT_Add_Driver( FT_Library library, const FT_DriverInterface* driver_interface ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Remove_Driver */ /* */ /* <Description> */ /* Unregister a given driver. This closes the driver, which in turn */ /* destroys all faces, sizes, slots, etc. associated with it. */ /* */ /* This function also DESTROYS the driver object. */ /* */ /* <Input> */ /* driver :: A handle to target driver object. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ EXPORT_DEF FT_Error FT_Remove_Driver( FT_Driver driver ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Driver */ /* */ /* <Description> */ /* returns the handle of the driver responsible for a given format */ /* (or service) according to its `name'. */ /* */ /* <Input> */ /* library :: handle to library object. */ /* driver_name :: name of driver to look-up. */ /* */ /* <Return> */ /* handle to driver object. 0 otherwise */ /* */ EXPORT_DEF FT_Driver FT_Get_Driver( FT_Library library, char* driver_name );#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM /************************************************************************** * * <Function> * FT_New_Stream * * <Description> * Open a new stream from a given standard ASCII file path name * * <Input> * filepathname :: an ASCII string naming the file to be opened * * <Output> * astream :: the opened stream descriptor to be used by the library * * <Return> * Error code. 0 means success * * <Note> * This function must be implemented by the system-specific part * of the engine, i.e. `ftsystem.c'. * * This function should only fill the stream descriptor. Note that * the stream's `memory' field should be left to the caller. * **************************************************************************/ extern FT_Error FT_New_Stream( const char* filepathname, FT_Stream astream ); /************************************************************************** * * <Function> * FT_New_Memory * * <Description> * Returns a handle to a new memory object * * <Return> * Handle to the memory object. 0 means failure * * <Note> * This function must be implemented by the system-specific part * of the engine, i.e. `ftsystem.c'. * * It is only used by `ftinit' in order to implement the function * FT_Init_FreeType. * **************************************************************************/ extern FT_Memory FT_New_Memory( void );#endif/* Define default raster's interface. The default raster is located in `src/base/ftraster.c' *//* *//* Client applications can register new rasters through the FT_Set_Raster API.. *//* */#ifndef FT_NO_DEFAULT_RASTER extern FT_Raster_Interface ft_default_raster;#endif#endif /* FTOBJS_H *//* END */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -