2000-06-05 07:26:15 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* sfdriver.c */
|
|
|
|
/* */
|
|
|
|
/* High-level SFNT driver interface (body). */
|
|
|
|
/* */
|
|
|
|
/* Copyright 1996-2000 by */
|
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2000-05-11 20:23:52 +02:00
|
|
|
#include <freetype/internal/sfnt.h>
|
2000-05-26 19:13:23 +02:00
|
|
|
#include <freetype/internal/ftobjs.h>
|
1999-12-17 00:11:37 +01:00
|
|
|
#include <sfdriver.h>
|
|
|
|
#include <ttload.h>
|
|
|
|
#include <ttsbit.h>
|
|
|
|
#include <ttpost.h>
|
|
|
|
#include <ttcmap.h>
|
2000-05-27 00:13:17 +02:00
|
|
|
#include <sfobjs.h>
|
|
|
|
|
2000-06-05 07:26:15 +02:00
|
|
|
|
2000-05-27 00:13:17 +02:00
|
|
|
static
|
2000-06-05 07:26:15 +02:00
|
|
|
void* get_sfnt_table( TT_Face face,
|
|
|
|
FT_Sfnt_Tag tag )
|
2000-05-27 00:13:17 +02:00
|
|
|
{
|
|
|
|
void* table;
|
|
|
|
|
2000-06-05 07:26:15 +02:00
|
|
|
|
|
|
|
switch ( tag )
|
2000-05-27 00:13:17 +02:00
|
|
|
{
|
2000-06-05 07:26:15 +02:00
|
|
|
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;
|
2000-05-27 00:13:17 +02:00
|
|
|
}
|
2000-06-05 07:26:15 +02:00
|
|
|
|
2000-05-27 00:13:17 +02:00
|
|
|
return table;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
FTDriver_Interface SFNT_Get_Interface( FT_Driver driver,
|
|
|
|
const char* interface )
|
|
|
|
{
|
2000-06-05 07:26:15 +02:00
|
|
|
UNUSED( driver );
|
2000-05-27 00:13:17 +02:00
|
|
|
|
2000-06-05 07:26:15 +02:00
|
|
|
if ( strcmp( interface, "get_sfnt" ) == 0 )
|
2000-05-27 00:13:17 +02:00
|
|
|
return (FTDriver_Interface)get_sfnt_table;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
static const SFNT_Interface sfnt_interface =
|
|
|
|
{
|
|
|
|
TT_Goto_Table,
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-05-27 00:13:17 +02:00
|
|
|
SFNT_Init_Face,
|
|
|
|
SFNT_Load_Face,
|
|
|
|
SFNT_Done_Face,
|
|
|
|
SFNT_Get_Interface,
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_Load_Any,
|
2000-05-29 22:37:41 +02:00
|
|
|
TT_Load_SFNT_Header,
|
1999-12-17 00:11:37 +01:00
|
|
|
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,
|
2000-06-05 07:26:15 +02:00
|
|
|
TT_Load_PCLT,
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
|
|
|
/* see `ttsbit.h' */
|
|
|
|
TT_Load_SBit_Strikes,
|
|
|
|
TT_Load_SBit_Image,
|
|
|
|
TT_Free_SBit_Strikes,
|
2000-06-05 07:26:15 +02:00
|
|
|
#else /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
1999-12-17 00:11:37 +01:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2000-06-05 07:26:15 +02:00
|
|
|
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
2000-05-17 01:44:38 +02:00
|
|
|
|
|
|
|
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
2000-06-05 07:26:15 +02:00
|
|
|
/* see `ttpost.h' */
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_Get_PS_Name,
|
2000-05-17 01:44:38 +02:00
|
|
|
TT_Free_Post_Names,
|
2000-06-05 07:26:15 +02:00
|
|
|
#else /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
|
1999-12-17 00:11:37 +01:00
|
|
|
0,
|
|
|
|
0,
|
2000-06-05 07:26:15 +02:00
|
|
|
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/* see `ttcmap.h' */
|
|
|
|
TT_CharMap_Load,
|
|
|
|
TT_CharMap_Free,
|
|
|
|
};
|
2000-05-17 01:44:38 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
const FT_DriverInterface sfnt_driver_interface =
|
|
|
|
{
|
2000-06-05 07:26:15 +02:00
|
|
|
sizeof ( FT_DriverRec ), 0, 0, 0,
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-05 07:26:15 +02:00
|
|
|
"sfnt", /* driver name */
|
|
|
|
1, /* driver version */
|
|
|
|
2, /* driver requires FreeType 2 or higher */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-05-12 17:01:18 +02:00
|
|
|
(void*)&sfnt_interface,
|
2000-06-05 07:26:15 +02:00
|
|
|
|
|
|
|
0, 0, 0,
|
|
|
|
0, 0, 0,
|
2000-05-12 17:01:18 +02:00
|
|
|
0, 0, 0, 0,
|
2000-06-05 07:26:15 +02:00
|
|
|
0, 0, 0,
|
|
|
|
0,
|
1999-12-17 00:11:37 +01:00
|
|
|
};
|
|
|
|
|
2000-06-05 07:26:15 +02:00
|
|
|
|
|
|
|
/* END */
|