#include <freetype/internal/ftdebug.h>
#include <freetype/internal/sfnt.h>
#include <freetype/internal/ftobjs.h>
#include <freetype/ttnameid.h>
#include "sfdriver.h"
#include "ttload.h"
#include "sfobjs.h"
#include "sferrors.h"
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
#include "ttsbit.h"
#endif
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
#include "ttcolr.h"
#include "ttcpal.h"
#endif
#ifdef FT_CONFIG_OPTION_SVG
#include "ttsvg.h"
#endif
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.h"
#endif
#ifdef TT_CONFIG_OPTION_BDF
#include "ttbdf.h"
#include <freetype/internal/services/svbdf.h>
#endif
#include "ttcmap.h"
#include "ttkern.h"
#include "ttmtx.h"
#include <freetype/internal/services/svgldict.h>
#include <freetype/internal/services/svpostnm.h>
#include <freetype/internal/services/svsfnt.h>
#include <freetype/internal/services/svttcmap.h>
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include <freetype/ftmm.h>
#include <freetype/internal/services/svmm.h>
#endif
#undef FT_COMPONENT
#define FT_COMPONENT …
FT_CALLBACK_DEF( FT_Error )
sfnt_load_table( FT_Face face,
FT_ULong tag,
FT_Long offset,
FT_Byte* buffer,
FT_ULong* length )
{ … }
FT_CALLBACK_DEF( void* )
get_sfnt_table( FT_Face face,
FT_Sfnt_Tag tag )
{ … }
FT_CALLBACK_DEF( FT_Error )
sfnt_table_info( FT_Face face,
FT_UInt idx,
FT_ULong *tag,
FT_ULong *offset,
FT_ULong *length )
{ … }
FT_DEFINE_SERVICE_SFNT_TABLEREC(
sfnt_service_sfnt_table,
sfnt_load_table,
get_sfnt_table,
sfnt_table_info
)
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_CALLBACK_DEF( FT_Error )
sfnt_get_glyph_name( FT_Face face,
FT_UInt glyph_index,
FT_Pointer buffer,
FT_UInt buffer_max )
{ … }
FT_CALLBACK_DEF( FT_UInt )
sfnt_get_name_index( FT_Face face,
const FT_String* glyph_name )
{ … }
FT_DEFINE_SERVICE_GLYPHDICTREC(
sfnt_service_glyph_dict,
sfnt_get_glyph_name,
sfnt_get_name_index
)
#endif
static const unsigned char sfnt_ps_map[16] = …;
static int
sfnt_is_postscript( int c )
{ … }
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
static int
sfnt_is_alphanumeric( int c )
{ … }
#define ROTL32( x, r ) …
static FT_UInt32
fmix32( FT_UInt32 h )
{ … }
static void
murmur_hash_3_128( const void* key,
const unsigned int len,
FT_UInt32 seed,
void* out )
{ … }
#endif
char_type_func;
#define IS_WIN( n ) …
#define IS_APPLE( n ) …
static char*
get_win_string( FT_Memory memory,
FT_Stream stream,
TT_Name entry,
char_type_func char_type,
FT_Bool report_invalid_characters )
{ … }
static char*
get_apple_string( FT_Memory memory,
FT_Stream stream,
TT_Name entry,
char_type_func char_type,
FT_Bool report_invalid_characters )
{ … }
FT_CALLBACK_DEF( FT_Bool )
sfnt_get_name_id( TT_Face face,
FT_UShort id,
FT_Int *win,
FT_Int *apple )
{ … }
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#define MAX_VALUE_DESCRIPTOR_LEN …
#define MAX_PS_NAME_LEN …
static char*
fixed2float( FT_Int fixed,
char* buf )
{ … }
static const char hexdigits[16] = …;
static const char*
sfnt_get_var_ps_name( TT_Face face )
{ … }
#endif
FT_CALLBACK_DEF( const char* )
sfnt_get_ps_name( FT_Face face )
{ … }
FT_DEFINE_SERVICE_PSFONTNAMEREC(
sfnt_service_ps_name,
sfnt_get_ps_name
)
FT_DEFINE_SERVICE_TTCMAPSREC(
tt_service_get_cmap_info,
tt_get_cmap_info
)
#ifdef TT_CONFIG_OPTION_BDF
static FT_Error
sfnt_get_charset_id( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry )
{ … }
FT_DEFINE_SERVICE_BDFRec(
sfnt_service_bdf,
sfnt_get_charset_id,
tt_face_find_bdf_prop
)
#endif
#if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC5(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict,
FT_SERVICE_ID_BDF, &sfnt_service_bdf,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#elif defined TT_CONFIG_OPTION_BDF
FT_DEFINE_SERVICEDESCREC4(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_BDF, &sfnt_service_bdf,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#else
FT_DEFINE_SERVICEDESCREC3(
sfnt_services,
FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info )
#endif
FT_CALLBACK_DEF( FT_Module_Interface )
sfnt_get_interface( FT_Module module,
const char* module_interface )
{ … }
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
#define PUT_EMBEDDED_BITMAPS( a ) …
#else
#define PUT_EMBEDDED_BITMAPS …
#endif
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
#define PUT_COLOR_LAYERS( a ) …
#else
#define PUT_COLOR_LAYERS …
#endif
#ifdef FT_CONFIG_OPTION_SVG
#define PUT_SVG_SUPPORT( a ) …
#else
#define PUT_SVG_SUPPORT …
#endif
#define PUT_COLOR_LAYERS_V1( a ) …
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#define PUT_PS_NAMES( a ) …
#else
#define PUT_PS_NAMES …
#endif
FT_DEFINE_SFNT_INTERFACE(
sfnt_interface,
tt_face_goto_table,
sfnt_init_face,
sfnt_load_face,
sfnt_done_face,
sfnt_get_interface,
tt_face_load_any,
tt_face_load_head,
tt_face_load_hhea,
tt_face_load_cmap,
tt_face_load_maxp,
tt_face_load_os2,
tt_face_load_post,
tt_face_load_name,
tt_face_free_name,
tt_face_load_kern,
tt_face_load_gasp,
tt_face_load_pclt,
PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ),
PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ),
PUT_PS_NAMES( tt_face_get_ps_name ),
PUT_PS_NAMES( tt_face_free_ps_names ),
tt_face_get_kerning,
tt_face_load_font_dir,
tt_face_load_hmtx,
PUT_EMBEDDED_BITMAPS( tt_face_load_sbit ),
PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ),
PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ),
PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
PUT_COLOR_LAYERS( tt_face_load_cpal ),
PUT_COLOR_LAYERS( tt_face_load_colr ),
PUT_COLOR_LAYERS( tt_face_free_cpal ),
PUT_COLOR_LAYERS( tt_face_free_colr ),
PUT_COLOR_LAYERS( tt_face_palette_set ),
PUT_COLOR_LAYERS( tt_face_get_colr_layer ),
PUT_COLOR_LAYERS_V1( tt_face_get_colr_glyph_paint ),
PUT_COLOR_LAYERS_V1( tt_face_get_color_glyph_clipbox ),
PUT_COLOR_LAYERS_V1( tt_face_get_paint_layers ),
PUT_COLOR_LAYERS_V1( tt_face_get_colorline_stops ),
PUT_COLOR_LAYERS_V1( tt_face_get_paint ),
PUT_COLOR_LAYERS( tt_face_colr_blend_layer ),
tt_face_get_metrics,
tt_face_get_name,
sfnt_get_name_id,
PUT_SVG_SUPPORT( tt_face_load_svg ),
PUT_SVG_SUPPORT( tt_face_free_svg ),
PUT_SVG_SUPPORT( tt_face_load_svg_doc )
)
FT_DEFINE_MODULE(
sfnt_module_class,
0,
sizeof ( FT_ModuleRec ),
"sfnt",
0x10000L,
0x20000L,
(const void*)&sfnt_interface,
NULL,
NULL,
sfnt_get_interface
)