Hash :
b1677a87
Author :
Date :
2000-05-29T20:37:41
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
#include <freetype/internal/sfnt.h>
#include <freetype/internal/ftobjs.h>
#include <sfdriver.h>
#include <ttload.h>
#include <ttsbit.h>
#include <ttpost.h>
#include <ttcmap.h>
#include <sfobjs.h>
static
void* get_sfnt_table( TT_Face face, FT_Sfnt_Tag tag )
{
void* table;
switch (tag)
{
case ft_sfnt_head: table = &face->header; break;
case ft_sfnt_hhea: table = &face->horizontal; break;
case ft_sfnt_vhea: table = (face->vertical_info ? &face->vertical : 0 ); break;
case ft_sfnt_os2: table = (face->os2.version == 0xFFFF ? 0 : &face->os2 ); break;
case ft_sfnt_post: table = &face->postscript; break;
case ft_sfnt_maxp: table = &face->max_profile; break;
case ft_sfnt_pclt: table = face->pclt.Version ? &face->pclt : 0 ; break;
default:
table = 0;
}
return table;
}
static
FTDriver_Interface SFNT_Get_Interface( FT_Driver driver,
const char* interface )
{
UNUSED(driver);
if (strcmp(interface,"get_sfnt")==0)
return (FTDriver_Interface)get_sfnt_table;
return 0;
}
static const SFNT_Interface sfnt_interface =
{
TT_Goto_Table,
SFNT_Init_Face,
SFNT_Load_Face,
SFNT_Done_Face,
SFNT_Get_Interface,
TT_Load_Any,
TT_Load_SFNT_Header,
TT_Load_Directory,
TT_Load_Header,
TT_Load_Metrics_Header,
TT_Load_CMap,
TT_Load_MaxProfile,
TT_Load_OS2,
TT_Load_PostScript,
TT_Load_Names,
TT_Free_Names,
TT_Load_Hdmx,
TT_Free_Hdmx,
TT_Load_Kern,
TT_Load_Gasp,
TT_Load_PCLT,
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* see `ttsbit.h' */
TT_Load_SBit_Strikes,
TT_Load_SBit_Image,
TT_Free_SBit_Strikes,
#else
0,
0,
0,
#endif
/* see `ttpost.h' */
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
TT_Get_PS_Name,
TT_Free_Post_Names,
#else
0,
0,
#endif
/* see `ttcmap.h' */
TT_CharMap_Load,
TT_CharMap_Free,
};
const FT_DriverInterface sfnt_driver_interface =
{
sizeof(FT_DriverRec),
0,
0,
0,
"sfnt", /* driver name */
1, /* driver version */
2, /* driver requires FreeType 2 or above */
(void*)&sfnt_interface,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0,
};