FT2 beta, and was moved to "src/sfn")VER-2-0-4-PATCH
parent
17ae985d38
commit
2fce88c6b9
16 changed files with 0 additions and 8678 deletions
@ -1,372 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* otlayout.h */ |
||||
/* */ |
||||
/* OpenType layout type definitions (specification only). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
#ifndef OTLAYOUT_H |
||||
#define OTLAYOUT_H |
||||
|
||||
#include <tttypes.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_LangSys */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL LangSys record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* lang_tag :: The language tag. */ |
||||
/* lang_offset :: The offset of the langsys data in the
|
||||
/* resource. */ |
||||
/* */ |
||||
/* lookup_order :: Always 0 for OTL 1.0. */ |
||||
/* req_feature_index :: The `required feature' index. */ |
||||
/* num_feature_indices :: The number of feature indices. */ |
||||
/* feature_indices :: An array of feature indices. */ |
||||
/* */ |
||||
typedef struct OTL_LangSys_ |
||||
{ |
||||
TT_ULong lang_tag; |
||||
TT_ULong lang_offset; |
||||
|
||||
TT_UShort lookup_order; /* always 0 for TT Open 1.0 */ |
||||
TT_UShort req_feature_index; /* required FeatureIndex */ |
||||
TT_UShort num_feature_indices; /* number of Feature indices */ |
||||
TT_UShort* feature_indices; /* array of Feature indices */ |
||||
|
||||
} OTL_LangSys; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Script */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Script record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* script_tag :: The script tag. */ |
||||
/* script_offset :: The offset of the script data in the resource. */ |
||||
/* */ |
||||
/* num_langsys :: The number of langsys records. */ |
||||
/* langsys :: An array of langsys records. */ |
||||
/* langsys_default :: A pointer to the default langsys table for this */ |
||||
/* script. */ |
||||
/* */ |
||||
typedef struct OTL_Script_ |
||||
{ |
||||
TT_ULong script_tag; |
||||
TT_ULong script_offset; |
||||
|
||||
TT_UShort num_langsys; |
||||
OTL_LangSys* langsys; |
||||
OTL_LangSys* langsys_default; |
||||
|
||||
} OTL_Script; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Script_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Script List record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* num_scripts :: The number of scripts records. */ |
||||
/* scripts :: An array of script records. */ |
||||
/* */ |
||||
typedef struct OTL_Script_List_ |
||||
{ |
||||
TT_UShort num_scripts; |
||||
OTL_Script* scripts; |
||||
|
||||
} OTL_Script_List; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Feature */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Feature record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* feature_tag :: The feature tag. */ |
||||
/* feature_offset :: The offset of the feature data in the resource. */ |
||||
/* */ |
||||
/* feature_params :: Always 0 for OpenType Layout 1.0. */ |
||||
/* num_lookups :: The number of lookup indices. */ |
||||
/* lookups :: An array of lookup indices. */ |
||||
/* */ |
||||
typedef struct OTL_Feature_ |
||||
{ |
||||
TT_ULong feature_tag; |
||||
TT_ULong feature_offset; |
||||
|
||||
TT_UShort feature_params; /* always 0 for OpenType Layout 1.0 */ |
||||
TT_UShort num_lookups; |
||||
TT_UShort* lookups; |
||||
|
||||
} OTL_Feature; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Feature_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Feature List record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* num_features :: The number of features. */ |
||||
/* features :: An array of features. */ |
||||
/* */ |
||||
typedef struct OTL_Feature_List_ |
||||
{ |
||||
TT_UShort num_features; |
||||
OTL_Feature* features; |
||||
|
||||
} OTL_Feature_List; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Lookup */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Lookup record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* lookup_offset :: The offset of the lookup data in the resource. */ |
||||
/* lookup_type :: The lookup type. */ |
||||
/* lookup_flag :: The lookup bit flags. */ |
||||
/* */ |
||||
/* num_subtables :: The number of subtables. */ |
||||
/* subtable_offsets :: An array of offsets to the subtables. */ |
||||
/* subtables :: An array of pointers to the subtable records. */ |
||||
/* */ |
||||
/* <Note> */ |
||||
/* The format of each lookup sub-table is determined by the parent */ |
||||
/* OpenType table, and cannot be known here. */ |
||||
/* */ |
||||
/* The `subtable_offsets' array is filled when the lookup table is */ |
||||
/* loaded the first time. It is up to OT table handlers to read the */ |
||||
/* corresponding sub-table records and store them in the `subtables' */ |
||||
/* array. */ |
||||
/* */ |
||||
typedef struct OTL_Lookup_ |
||||
{ |
||||
TT_ULong lookup_offset; |
||||
TT_UShort lookup_type; |
||||
TT_UShort lookup_flag; |
||||
|
||||
TT_UShort num_subtables; |
||||
TT_ULong* subtable_offsets; |
||||
void** subtables; |
||||
|
||||
} OTL_Lookup; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Lookup List record. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* num_lookups :: The number of lookups. */ |
||||
/* lookups :: An array of lookups. */ |
||||
/* */ |
||||
typedef struct OTL_Lookup_List_ |
||||
{ |
||||
TT_UShort num_lookups; |
||||
OTL_Lookup* lookups; |
||||
|
||||
} OTL_Lookup_List; |
||||
|
||||
|
||||
#define OTL_LOOKUP_FLAG_RIGHT_TO_LEFT 1 |
||||
#define OTL_LOOKUP_FLAG_IGNORE_BASE_GLYPHS 2 |
||||
#define OTL_LOOKUP_FLAG_IGNORE_LIGATURES 4 |
||||
#define OTL_LOOKUP_FLAG_IGNORE_MARKS 8 |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_SubTable1 */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The first generic OTL sub-table format. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* num_indices :: The number of indices. */ |
||||
/* indices :: An array of indices. */ |
||||
/* data :: A generic value. */ |
||||
/* */ |
||||
typedef struct OTL_SubTable1_ |
||||
{ |
||||
TT_UShort num_indices; |
||||
TT_UShort* indices; |
||||
TT_UShort data; |
||||
|
||||
} OTL_SubTable1; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_SubTable2_Rec */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A record for the second generic OTL sub-table format. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* start :: The first element in the range. */ |
||||
/* end :: The last element in the range. */ |
||||
/* data :: A generic value. */ |
||||
/* */ |
||||
typedef struct OTL_SubTable2_Rec_ |
||||
{ |
||||
TT_UShort start; |
||||
TT_UShort end; |
||||
TT_UShort data; |
||||
|
||||
} OTL_SubTable2_Rec; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_SubTable2 */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The second generic OTL sub-table format. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* num_ranges :: The number of ranges. */ |
||||
/* ranges :: An array of ranges. */ |
||||
/* */ |
||||
typedef struct OTL_SubTable2_ |
||||
{ |
||||
TT_UShort num_ranges; |
||||
OTL_SubTable2_Rec* ranges; |
||||
|
||||
} OTL_SubTable2; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_SubTable */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A generic OTL sub-table which is a union of two possible formats */ |
||||
/* just defined. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* format :: The format of the sub-table. */ |
||||
/* set :: A union of `format1' and `format2', representing */ |
||||
/* sub-tables. */ |
||||
/* */ |
||||
typedef struct OTL_SubTable_ |
||||
{ |
||||
TT_UShort format; |
||||
|
||||
union |
||||
{ |
||||
OTL_SubTable1 format1; |
||||
OTL_SubTable2 format2; |
||||
|
||||
} set; |
||||
|
||||
} OTL_SubTable; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Coverage */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Coverage sub-table. */ |
||||
/* */ |
||||
typedef OTL_SubTable OTL_Coverage; |
||||
typedef OTL_SubTable1 OTL_Coverage1; |
||||
typedef OTL_SubTable2 OTL_Coverage2; |
||||
typedef OTL_SubTable2_Rec OTL_Coverage2_Rec; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Class_Def */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Class Definition sub-table. */ |
||||
/* */ |
||||
typedef OTL_SubTable OTL_Class_Def; |
||||
typedef OTL_SubTable1 OTL_Class_Def1; |
||||
typedef OTL_SubTable2 OTL_Class_Def2; |
||||
typedef OTL_SubTable2_Rec OTL_Class_Def2_Rec; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Struct> */ |
||||
/* OTL_Device */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* An OTL Device sub-table */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* start_size :: The smallest size to correct. */ |
||||
/* end_size :: The largest size to correct. */ |
||||
/* delta_format :: The format of the `delta_values' array. */ |
||||
/* delta_values :: An array of compressed delta values. */ |
||||
typedef struct OTL_Device_ |
||||
{ |
||||
TT_UShort start_size; |
||||
TT_UShort end_size; |
||||
TT_UShort delta_format; |
||||
TT_UShort* delta_values; |
||||
|
||||
} OTL_Device; |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* OTLAYOUT_H */ |
||||
|
||||
|
||||
/* END */ |
@ -1,890 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* otload.c */ |
||||
/* */ |
||||
/* OpenType Layout loader (body). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
#include <otlayout.h> |
||||
#include <otload.h> |
||||
|
||||
#include <tterrors.h> |
||||
|
||||
|
||||
/***************************
|
||||
* Script related functions |
||||
***************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Script_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Script list. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target script list. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
void OTL_Free_Script_List( OTL_Script_List* list, |
||||
FT_System system ) |
||||
{ |
||||
if ( list ) |
||||
{ |
||||
if ( list->scripts ) |
||||
{ |
||||
OTL_Script* script = list->scripts; |
||||
OTL_Script* script_limit = script + list->num_scripts; |
||||
|
||||
|
||||
for ( ; script < script_limit; script++ ) |
||||
{ |
||||
if ( script->langsys ) |
||||
{ |
||||
OTL_LangSys* langsys = script->langsys; |
||||
OTL_LangSys* langsys_limit = langsys + script->num_langsys; |
||||
|
||||
|
||||
for ( ; langsys < langsys_limit; langsys++ ) |
||||
{ |
||||
FREE( langsys->feature_indices ); |
||||
langsys->num_feature_indices = 0; |
||||
} |
||||
FREE( script->langsys ); |
||||
} |
||||
script->langsys_default = NULL; |
||||
script->num_langsys = 0; |
||||
} |
||||
FREE( list->scripts ); |
||||
} |
||||
list->num_scripts = 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
static |
||||
TT_Error Load_OTL_LangSys_List( OTL_Script* script, |
||||
FT_Stream stream, |
||||
TT_ULong default_offset ) |
||||
{ |
||||
FT_System system = stream->system; |
||||
TT_Error error; |
||||
|
||||
TT_UShort n, count; |
||||
OTL_LangSys* langsys; |
||||
|
||||
|
||||
/* read the langsys tags and offsets */ |
||||
{ |
||||
count = script->num_langsys; |
||||
langsys = script->langsys; |
||||
|
||||
if ( ACCESS_Frame( 6L * count ) ) |
||||
goto Exit; |
||||
|
||||
for ( n = 0; n < count; n++, langsys++ ) |
||||
{ |
||||
TT_ULong offset; |
||||
|
||||
|
||||
langsys->lang_tag = GET_ULong(); |
||||
offset = GET_UShort(); |
||||
|
||||
if ( langsys->lang_offset == default_offset ) |
||||
script->langsys_default = langsys; |
||||
|
||||
langsys->lang_offset = offset + script->script_offset; |
||||
} |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
|
||||
/* now read each langsys record */ |
||||
{ |
||||
count = script->num_langsys; |
||||
langsys = script->langsys; |
||||
|
||||
for ( n = 0; n < count; n++, langsys++ ) |
||||
{ |
||||
TT_UShort num_feature_indices, i; |
||||
|
||||
|
||||
if ( FILE_Seek( langsys->lang_offset ) || |
||||
ACCESS_Frame( 8L ) ) |
||||
goto Exit; |
||||
|
||||
langsys->lookup_order = GET_ULong(); |
||||
langsys->req_feature_index = GET_UShort(); |
||||
langsys->num_feature_indices = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
|
||||
num_feature_indices = langsys->num_feature_indices; |
||||
|
||||
if ( ALLOC_ARRAY ( langsys->feature_indices, |
||||
num_feature_indices, TT_UShort ) || |
||||
ACCESS_Frame( num_feature_indices * 2L ) ) |
||||
goto Exit; |
||||
|
||||
for ( i = 0; i < num_feature_indices; i++ ) |
||||
langsys->feature_indices[i] = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
} |
||||
|
||||
Exit: |
||||
return error; |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Script_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Script List from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target script list. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Script_List( OTL_Script_List* list, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_System system = stream->system; |
||||
TT_Error error; |
||||
|
||||
TT_ULong start_pos; |
||||
TT_UShort num_scripts; |
||||
OTL_Script* scripts; |
||||
|
||||
|
||||
start_pos = FILE_Pos(); |
||||
|
||||
if ( READ_UShort( list->num_scripts ) ) |
||||
goto Exit; |
||||
|
||||
num_scripts = list->num_scripts; |
||||
|
||||
/* Allocate the scripts table, read their tags and offsets */ |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
if ( ALLOC_ARRAY( list->scripts, num_scripts, OTL_Script ) || |
||||
ACCESS_Frame( num_scripts * 6L ) ) |
||||
goto Exit; |
||||
|
||||
scripts = list->scripts; |
||||
|
||||
for ( n = 0; n < num_scripts; n++ ) |
||||
{ |
||||
scripts[n].script_tag = GET_ULong(); |
||||
scripts[n].script_offset = GET_UShort() + start_pos; |
||||
} |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
|
||||
/* now read each script in the table */ |
||||
{ |
||||
TT_UShort n; |
||||
OTL_Script* script = scripts; |
||||
|
||||
|
||||
for ( n = num_scripts; n > 0; n--, script++ ) |
||||
{ |
||||
TT_ULong default_langsys_offset; |
||||
|
||||
|
||||
if ( FILE_Seek ( script->script_offset ) || |
||||
READ_ULong ( default_langsys_offset ) || |
||||
READ_UShort( script->num_langsys ) || |
||||
ALLOC_ARRAY( script->langsys, |
||||
script->num_langsys, OTL_LangSys ) ) |
||||
goto Exit; |
||||
|
||||
/* read the corresponding langsys list */ |
||||
error = Load_OTL_LangSys_List( |
||||
script, |
||||
stream, |
||||
default_langsys_offset + script->script_offset ); |
||||
if ( error ) |
||||
goto Exit; |
||||
} |
||||
} |
||||
|
||||
Exit: |
||||
if ( error ) |
||||
OTL_Free_Script_List( list, system ); |
||||
|
||||
return error; |
||||
} |
||||
|
||||
|
||||
/*********************************
|
||||
* Feature List related functions |
||||
*********************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Features_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Features list. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target feature list. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
void OTL_Free_Features_List( OTL_Feature_List* list, |
||||
FT_System system ) |
||||
{ |
||||
if ( list ) |
||||
{ |
||||
if ( list->features ) |
||||
{ |
||||
OTL_Feature* feature = list->features; |
||||
OTL_Feature* feature_limit = feature + list->num_features; |
||||
|
||||
|
||||
for ( ; feature < feature_limit; feature++ ) |
||||
{ |
||||
FREE( feature->lookups ); |
||||
feature->num_lookups = 0; |
||||
} |
||||
|
||||
FREE( list->features ); |
||||
} |
||||
list->num_features = 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Feature_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Feature List from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target feature list. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Feature_List( OTL_Feature_List* list, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_System system = stream->system; |
||||
TT_Error error; |
||||
TT_ULong start_pos; |
||||
TT_UShort num_features, n; |
||||
|
||||
|
||||
start_pos = FILE_Pos(); |
||||
|
||||
if ( READ_UShort( num_features ) ) |
||||
goto Exit; |
||||
|
||||
/* allocate the features array and read their tag and offset */ |
||||
{ |
||||
OTL_Feature* feature; |
||||
OTL_Feature* feature_limit; |
||||
|
||||
|
||||
if ( ALLOC_ARRAY ( list->features, num_features, OTL_Feature ) || |
||||
ACCESS_Frame( num_features * 6L ) ) |
||||
goto Exit; |
||||
|
||||
list->num_features = num_features; |
||||
feature = list->features; |
||||
feature_limit = feature + num_features; |
||||
|
||||
for ( ; feature < feature_limit; feature++ ) |
||||
{ |
||||
feature->feature_tag = GET_ULong(); |
||||
feature->feature_offset = GET_UShort() + start_pos; |
||||
} |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
|
||||
/* now read each feature */ |
||||
{ |
||||
OTL_Feature* feature; |
||||
OTL_Feature* feature_limit; |
||||
|
||||
|
||||
feature = list->features; |
||||
feature_limit = feature + num_features; |
||||
|
||||
for ( ; feature < feature_limit; feature++ ) |
||||
{ |
||||
TT_UShort num_lookups; |
||||
TT_UShort* lookup; |
||||
TT_UShort* lookup_limit; |
||||
|
||||
|
||||
if ( FILE_Seek ( feature->feature_offset ) || |
||||
READ_ULong ( feature->feature_params ) || |
||||
READ_UShort ( num_lookups ) || |
||||
ALLOC_ARRAY ( feature->lookups, |
||||
num_lookups, TT_UShort ) || |
||||
ACCESS_Frame( num_lookups * 2L ) ) |
||||
goto Exit; |
||||
|
||||
feature->num_lookups = num_lookups; |
||||
lookup = feature->lookups; |
||||
lookup_limit = lookup + num_lookups; |
||||
|
||||
for ( ; lookup < lookup_limit; lookup++ ) |
||||
lookup[0] = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
} |
||||
|
||||
Exit: |
||||
if ( error ) |
||||
OTL_Free_Feature_List( list, system ); |
||||
|
||||
return error; |
||||
} |
||||
|
||||
|
||||
/********************************
|
||||
* Lookup List related functions |
||||
********************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Iterate_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Scans an OpenType Lookup List. This can be used to load the */ |
||||
/* Lookup sub-tables in a GSUB or GPOS loader. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The source list. */ |
||||
/* iterator :: The iterator -- a function which is called on each */ |
||||
/* element of the list. */ |
||||
/* closure :: User-specified data which is passed to each iterator */ |
||||
/* with the lookup element pointer. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* If one iterator call returns a non-zero `result', the list parsing */ |
||||
/* is aborted and the value is returned to the caller. Otherwise, */ |
||||
/* the function returns 0 when the list has been parsed completely. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Iterate_Lookup_List( OTL_Lookup_List* list, |
||||
OTL_Lookup_Iterator iterator, |
||||
void* closure ) |
||||
{ |
||||
int result = 0; |
||||
|
||||
|
||||
if ( list->lookups ) |
||||
{ |
||||
OTL_Lookup* lookup = list->lookups; |
||||
OTL_Lookup* limit = lookup + list->num_lookups; |
||||
|
||||
|
||||
for ( ; lookup < limit; lookup++ ) |
||||
{ |
||||
result = iterator( lookup, closure ); |
||||
if ( result ) |
||||
break; |
||||
} |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Lookup list. Uses a destructor called */ |
||||
/* to destroy the Lookup sub-tables. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target lookup list. */ |
||||
/* system :: The current system object. */ |
||||
/* destructor :: A destructor function called on each lookup element. */ |
||||
/* Can be used to destroy sub-tables. Ignored if NULL. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
void OTL_Free_Lookup_List( OTL_Lookup_List* list, |
||||
FT_System system, |
||||
OTL_Lookup_Destructor destroy ) |
||||
{ |
||||
if ( list ) |
||||
{ |
||||
if ( list->lookups ) |
||||
{ |
||||
OTL_Lookup* lookup = list->lookups; |
||||
OTL_Lookup* limit = lookup + list->num_lookups; |
||||
|
||||
|
||||
for ( ; lookup < limit; lookup++ ) |
||||
{ |
||||
if ( destroy ) |
||||
destroy( lookup, system ); |
||||
|
||||
FREE( lookup->subtable_offsets ); |
||||
lookup->num_subtables = 0; |
||||
} |
||||
|
||||
FREE( list->lookups ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Lookup List from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target lookup list. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
/* <Note> */ |
||||
/* This function does NOT load the lookup sub-tables. Instead, it */ |
||||
/* stores the file offsets of the particular table in each lookup */ |
||||
/* element. It is up to the caller to load these sub-tables. This */ |
||||
/* can be done more easily with OTL_Iterate_Lookup_List(). */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Lookup_List( OTL_Lookup_List* list, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_System system = stream->system; |
||||
TT_Error error; |
||||
|
||||
TT_UShort num_lookups; |
||||
TT_ULong start_pos; |
||||
|
||||
|
||||
start_pos = GET_ULong(); |
||||
|
||||
if ( READ_UShort( num_lookups ) ) |
||||
goto Exit; |
||||
|
||||
/* allocate the lookups array and read their tags and offset */ |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
if ( ALLOC_ARRAY ( list->lookups, num_lookups, OTL_Lookup ) || |
||||
ACCESS_Frame( num_lookups * 2L ) ) |
||||
goto Exit; |
||||
|
||||
list->num_lookups = num_lookups; |
||||
for ( n = 0; n < num_lookups; n++ ) |
||||
list->lookups[n].lookup_offset = start_pos + GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
|
||||
/* now read each lookup table */ |
||||
/* NOTE that we don't load the sub-tables here, but simply */ |
||||
/* store their file offsets in the `subtable_offsets' array */ |
||||
{ |
||||
OTL_Lookup* lookup = list->lookups; |
||||
OTL_Lookup* lookup_limit = lookup + num_lookups; |
||||
|
||||
|
||||
for ( ; lookup < lookup_limit; lookup++ ) |
||||
{ |
||||
TT_UShort n, num_subtables; |
||||
TT_ULong* offsets; |
||||
|
||||
|
||||
if ( FILE_Seek ( lookup->lookup_offset ) || |
||||
ACCESS_Frame( 6L ) ) |
||||
goto Exit; |
||||
|
||||
lookup->lookup_type = GET_UShort(); |
||||
lookup->lookup_flag = GET_UShort(); |
||||
lookup->num_subtables = GET_UShort(); |
||||
|
||||
num_subtables = lookup->num_subtables; |
||||
|
||||
FORGET_Frame(); |
||||
|
||||
if ( ALLOC_ARRAY ( lookup->subtable_offsets, |
||||
num_subtables, TT_ULong ) || |
||||
ACCESS_Frame( num_subtables * 2L ) ) |
||||
goto Exit; |
||||
|
||||
offsets = lookup->subtable_offsets; |
||||
for ( n = 0; n < num_subtables; n++ ) |
||||
offsets[n] = lookup->lookup_offset + GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
} |
||||
|
||||
Exit: |
||||
if ( error ) |
||||
OTL_Free_Lookup_List( list, system, 0 ); |
||||
|
||||
return error; |
||||
} |
||||
|
||||
|
||||
/* generic sub-table freeing and loading */ |
||||
|
||||
static |
||||
void Free_SubTable( OTL_SubTable* subtable, |
||||
FT_System system ) |
||||
{ |
||||
if ( subtable ) |
||||
{ |
||||
switch ( subtable->format ) |
||||
{ |
||||
case 1: |
||||
{ |
||||
OTL_SubTable1* st = &subtable->set.format1; |
||||
|
||||
|
||||
FREE( st->indices ); |
||||
st->num_indices = 0; |
||||
FREE( st ); |
||||
} |
||||
break; |
||||
|
||||
case 2: |
||||
{ |
||||
OTL_SubTable2* st = &subtable->set.format2; |
||||
|
||||
|
||||
FREE( st->ranges ); |
||||
st->num_ranges = 0; |
||||
FREE( st ); |
||||
} |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
|
||||
FREE( subtable ); |
||||
} |
||||
} |
||||
|
||||
|
||||
static |
||||
TT_Error Load_SubTable( OTL_SubTable* subtable, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_System system = stream->system; |
||||
TT_Error error; |
||||
|
||||
|
||||
if ( READ_UShort( subtable->format ) ) |
||||
goto Exit; |
||||
|
||||
switch ( subtable->format ) |
||||
{ |
||||
case 1: |
||||
{ |
||||
OTL_SubTable1* st = &subtable->set.format1; |
||||
TT_UShort num_indices, n; |
||||
|
||||
|
||||
if ( READ_UShort ( num_indices ) || |
||||
ALLOC_ARRAY ( st->indices, num_indices, TT_UShort ) || |
||||
ACCESS_Frame( num_indices * 2L ) ) |
||||
goto Exit; |
||||
|
||||
st->num_indices = num_indices; |
||||
for ( n = 0; n < num_indices; n++ ) |
||||
st->indices[n] = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
|
||||
case 2: |
||||
{ |
||||
OTL_SubTable2* st = &subtable->set.format2; |
||||
TT_UShort num_ranges, n; |
||||
OTL_SubTable2_Rec* range; |
||||
|
||||
|
||||
if ( READ_UShort( num_ranges ) || |
||||
ALLOC_ARRAY( st->ranges, num_ranges, OTL_SubTable2_Rec ) || |
||||
ACCESS_Frame( num_ranges * 6L ) ) |
||||
goto Exit; |
||||
|
||||
st->num_ranges = num_ranges; |
||||
range = st->ranges; |
||||
for ( ; num_ranges > 0; num_ranges--, range++ ) |
||||
{ |
||||
range->start = GET_UShort(); |
||||
range->end = GET_UShort(); |
||||
range->data = GET_UShort(); |
||||
} |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
break; |
||||
|
||||
default: |
||||
error = TT_Err_Invalid_File_Format; |
||||
} |
||||
|
||||
Exit: |
||||
if ( error ) |
||||
Free_SubTable( subtable, system ); |
||||
|
||||
return error; |
||||
} |
||||
|
||||
|
||||
/*****************************
|
||||
* Coverage related functions |
||||
*****************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Coverage */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Coverage table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* coverage :: The target coverage. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
void OTL_Free_Coverage( OTL_Coverage* coverage, |
||||
FT_System system ) |
||||
{ |
||||
Free_SubTable( (OTL_SubTable*)coverage, system ); |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Coverage */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Coverage table from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* coverage :: The target coverage. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Coverage( OTL_Coverage* coverage, |
||||
FT_Stream stream ) |
||||
{ |
||||
return Load_SubTable( (OTL_SubTable*)coverage, stream ); |
||||
} |
||||
|
||||
|
||||
/*************************************
|
||||
* Class Definition related functions |
||||
*************************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Class_Def */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Class Definition table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* class_def :: The target class definition. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
void OTL_Free_Class_Def( OTL_Class_Def* class_def, |
||||
FT_System system ) |
||||
{ |
||||
Free_SubTable( (OTL_SubTable*)class_def, system ); |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Class_Def */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Class Definition table from a resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* class_def :: The target class definition. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Class_Def( OTL_Class_Def* class_def, |
||||
FT_Stream stream ) |
||||
{ |
||||
return OTL_Load_SubTable( (OTL_SubTable*)class_def, stream ); |
||||
} |
||||
|
||||
|
||||
/*************************************
|
||||
* Device related functions |
||||
*************************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Device */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Layout Device table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* device :: The target device table. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
void OTL_Free_Device( OTL_Device* device, |
||||
FT_System system ) |
||||
{ |
||||
if ( device ) |
||||
{ |
||||
FREE( device->delta_values ); |
||||
FREE( device ); |
||||
} |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Device */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Device table from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* device :: The target device table. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Device( OTL_Device* device, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_System system = stream->system; |
||||
TT_Error error; |
||||
TT_UShort* deltas; |
||||
TT_UShort num_deltas, num_values; |
||||
|
||||
|
||||
if ( ACCESS_Frame( 6L ) ) |
||||
goto Exit; |
||||
|
||||
device->start_size = GET_UShort(); |
||||
device->end_size = GET_UShort(); |
||||
device->delta_format = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
|
||||
num_deltas = device->end_size - device->start_size + 1; |
||||
|
||||
switch ( device->delta_format ) |
||||
{ |
||||
case 1: |
||||
num_values = ( num_deltas + 7 ) >> 3; |
||||
break; |
||||
|
||||
case 2: |
||||
num_values = ( num_deltas + 3 ) >> 2; |
||||
break; |
||||
|
||||
case 3: |
||||
num_values = ( num_deltas + 1 ) >> 1; |
||||
break; |
||||
|
||||
default: |
||||
error = TT_Err_Invalid_File_Format; |
||||
goto Exit; |
||||
} |
||||
|
||||
if ( ALLOC_ARRAY( deltas, num_values, TT_UShort ) ) |
||||
goto Exit; |
||||
|
||||
if ( !ACCESS_Frame( num_values * 2L ) ) |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
for ( n = 0; n < num_values; n++ ) |
||||
deltas[n] = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
|
||||
device->delta_values = deltas; |
||||
} |
||||
else |
||||
FREE( deltas ); |
||||
|
||||
Exit: |
||||
return error; |
||||
} |
||||
|
||||
|
||||
/* END */ |
@ -1,297 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* otload.h */ |
||||
/* */ |
||||
/* OpenType layout loader functions (specification). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
#ifndef OTLOAD_H |
||||
#define OTLOAD_H |
||||
|
||||
#include <otlayout.h> |
||||
#include <ftstream.h> |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Script_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Script List from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target script list. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error OTL_Load_Script_List( OTL_Script_List* list, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Feature_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Feature List from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target feature list. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error OTL_Load_Feature_List( OTL_Feature_List* list, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Lookup List from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target lookup list. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
/* <Note> */ |
||||
/* This function does NOT load the lookup sub-tables. Instead, it */ |
||||
/* stores the file offsets of the particular table in each lookup */ |
||||
/* element. It is up to the caller to load these sub-tables. This */ |
||||
/* can be done more easily with OTL_Iterate_Lookup_List(). */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error OTL_Load_Lookup_List( OTL_Lookup_List* list, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
typedef int OTL_Lookup_Iterator( OTL_Lookup* lookup, |
||||
void* closure ); |
||||
|
||||
|
||||
typedef void OTL_Lookup_Destructor( OTL_Lookup* lookup, |
||||
FT_System system ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Iterate_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Scans an OpenType Lookup List. This can be used to load the */ |
||||
/* Lookup sub-tables in a GSUB or GPOS loader. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The source list. */ |
||||
/* iterator :: The iterator -- a function which is called on each */ |
||||
/* element of the list. */ |
||||
/* closure :: User-specified data which is passed to each iterator */ |
||||
/* with the lookup element pointer. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* If one iterator call returns a non-zero `result', the list parsing */ |
||||
/* is aborted and the value is returned to the caller. Otherwise, */ |
||||
/* the function returns 0 when the list has been parsed completely. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error OTL_Iterate_Lookup_List( OTL_Lookup_List* list, |
||||
OTL_Lookup_Iterator iterator, |
||||
void* closure ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Coverage */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Coverage table from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* coverage :: The target coverage. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
TT_Error OTL_Load_Coverage( OTL_Coverage* coverage, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Class_Def */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Class Definition table from a resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* class_def :: The target class definition. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error OTL_Load_Class_Def( OTL_Class_Def* class_def, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Load_Device */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads an OpenType Device table from a font resource. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* device :: The target device table. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error OTL_Load_Device( OTL_Device* device, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Script_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Script list. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target script list. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void OTL_Free_Script_List( OTL_Script_List* list, |
||||
FT_System system ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Features_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Features list. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target feature list. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void OTL_Free_Features_List( OTL_Feature_List* list, |
||||
FT_System system ); |
||||
|
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Lookup_List */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Lookup list. Uses a destructor called */ |
||||
/* to destroy the Lookup sub-tables. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* list :: The target lookup list. */ |
||||
/* system :: The current system object. */ |
||||
/* destructor :: A destructor function called on each lookup element. */ |
||||
/* Can be used to destroy sub-tables. Ignored if NULL. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void OTL_Free_Lookup_List( OTL_Lookup_List* list, |
||||
FT_System system, |
||||
OTL_Lookup_Destructor destroy ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Coverage */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Coverage table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* coverage :: The target coverage. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void OTL_Free_Coverage( OTL_Coverage* coverage, |
||||
FT_System system ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Class_Def */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Class Definition table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* class_def :: The target class definition. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void OTL_Free_Class_Def( OTL_Class_Def* class_def, |
||||
FT_System system ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* OTL_Free_Device */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases a given OpenType Layout Device table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* device :: The target device table. */ |
||||
/* system :: The current system object. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void OTL_Free_Device( OTL_Device* device, |
||||
FT_System system ); |
||||
|
||||
|
||||
#endif /* OTLOAD_H */ |
||||
|
||||
|
||||
/* END */ |
@ -1,58 +0,0 @@ |
||||
#****************************************************************************
|
||||
#* *
|
||||
#* SFNT/TrueType Makefile *
|
||||
#* *
|
||||
#* Copyright 1996-1999 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. *
|
||||
#* *
|
||||
#****************************************************************************
|
||||
|
||||
|
||||
#****************************************************************************
|
||||
#* *
|
||||
#* IMPORTANT NOTE: This Makefile is intended for GNU Make! *
|
||||
#* If you provide Makefiles for other make utilities, *
|
||||
#* please place them in `freetype/lib/arch/<system>'. *
|
||||
#* *
|
||||
#* *
|
||||
#* This file is to be included by the Makefiles of each driver that uses *
|
||||
#* the shared source code in `freetype2/lib/drivers/sfnt'. This code *
|
||||
#* contains type definitions as well as interface which are common to all *
|
||||
#* `sfnt' font formats (i.e., TrueType, OpenType-TTF, and OpenType-CFF). *
|
||||
#* *
|
||||
#* *
|
||||
#* The purpose of this Makefile is to define two make variables that are *
|
||||
#* used directly by the parent Makefile. *
|
||||
#* *
|
||||
#****************************************************************************
|
||||
|
||||
|
||||
# SFNT_DIR is the directory to the `sfnt' sources
|
||||
#
|
||||
SFNT_DIR := $(SRC)$(SEP)shared$(SEP)sfnt
|
||||
SFNT_DIR_ := $(SFNT_DIR)$(SEP)
|
||||
|
||||
|
||||
# SFNT_H is the list of all header files on which the client drivers depend
|
||||
#
|
||||
SFNT_H := $(SFNT_DIR_)tttypes.h \
|
||||
$(SFNT_DIR_)ttload.h \
|
||||
$(SFNT_DIR_)ttsbit.h \
|
||||
$(SFNT_DIR_)ttpost.h \
|
||||
$(SFNT_DIR_)sfnt.h
|
||||
|
||||
# SFNT_SRC is the list of all shared source files that are included by any
|
||||
# client driver
|
||||
#
|
||||
SFNT_SRC := $(SFNT_DIR_)ttload.c \
|
||||
$(SFNT_DIR_)ttsbit.c \
|
||||
$(SFNT_DIR_)ttpost.c
|
||||
|
||||
|
||||
# END
|
@ -1,50 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* sfnt.h */ |
||||
/* */ |
||||
/* Defines the function interface used to access SFNT files, i.e., */ |
||||
/* TrueType, OpenType-TT, and OpenType-T2 files (specification only). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
#ifndef SFNT_H |
||||
#define SFNT_H |
||||
|
||||
#include <tttypes.h> |
||||
|
||||
|
||||
typedef TT_Long (*SFNT_LookUp_Table)( TT_Face face, |
||||
TT_ULong tag ); |
||||
|
||||
|
||||
typedef TT_Error (*SFNT_Load_Table)( TT_Face face, |
||||
TT_ULong tag, |
||||
TT_Long offset, |
||||
void* buffer, |
||||
TT_Long* length ); |
||||
|
||||
typedef TT_Error (*SFNT_Get_PS_Name)( TT_Face face, |
||||
TT_UShort index, |
||||
TT_String* *ps_name ); |
||||
|
||||
typedef struct SFNT_Interface_ |
||||
{ |
||||
SFNT_LookUp_Table lookup_table; |
||||
SFNT_Load_Table load_table; |
||||
|
||||
} SFNT_Interface; |
||||
|
||||
|
||||
#endif /* SFNT_H */ |
||||
|
||||
|
||||
/* END */ |
File diff suppressed because it is too large
Load Diff
@ -1,353 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* ttload.h */ |
||||
/* */ |
||||
/* Load the basic TrueType tables, i.e., tables that can be either in */ |
||||
/* TTF or OTF font (specification). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
#ifndef TTLOAD_H |
||||
#define TTLOAD_H |
||||
|
||||
|
||||
#include <ftstream.h> |
||||
#include <ttobjs.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_LookUp_Table */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Looks for a TrueType table by name. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A face object handle. */ |
||||
/* tag :: The searched tag. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* Index of table if found, -1 otherwise. */ |
||||
/* */ |
||||
EXPORT_DEF |
||||
TT_Long TT_LookUp_Table( TT_Face face, |
||||
TT_ULong tag ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Directory */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the table directory into a face object. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* faceIndex :: The index of the TrueType font, if we're opening a */ |
||||
/* collection. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Directory( TT_Face face, |
||||
FT_Stream stream, |
||||
TT_Long faceIndex ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Any */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads any font table into client memory. Used by the */ |
||||
/* TT_Get_Font_Data() API function. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: The face object to look for. */ |
||||
/* */ |
||||
/* tag :: The tag of table to load. Use the value 0 if you want */ |
||||
/* to access the whole font file, else set this parameter */ |
||||
/* to a valid TrueType table tag that you can forge with */ |
||||
/* the MAKE_TT_TAG macro. */ |
||||
/* */ |
||||
/* offset :: The starting offset in the table (or the file if */ |
||||
/* tag == 0). */ |
||||
/* */ |
||||
/* length :: The address of the decision variable: */ |
||||
/* */ |
||||
/* If length == NULL: */ |
||||
/* Loads the whole table. Returns an error if */ |
||||
/* `offset' == 0! */ |
||||
/* */ |
||||
/* If *length == 0: */ |
||||
/* Exits immediately; returning the length of the given */ |
||||
/* table or of the font file, depending on the value of */ |
||||
/* `tag'. */ |
||||
/* */ |
||||
/* If *length != 0: */ |
||||
/* Loads the next `length' bytes of table or font, */ |
||||
/* starting at offset `offset' (in table or font too). */ |
||||
/* */ |
||||
/* <Output> */ |
||||
/* buffer :: The address of target buffer. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Any( TT_Face face, |
||||
TT_ULong tag, |
||||
TT_Long offset, |
||||
void* buffer, |
||||
TT_Long* length ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Header */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the TrueType font header. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Header( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Metrics_Header */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the horizontal or vertical header in a face object. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Metrics_Header( TT_Face face, |
||||
FT_Stream stream, |
||||
TT_Bool vertical ); |
||||
|
||||
|
||||
LOCAL_DEF |
||||
TT_Error TT_Load_CMap( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_MaxProfile */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the maximum profile into a face object. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_MaxProfile( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Names */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the name records. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Names( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_OS2 */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the OS2 table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: A handle to the input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_OS2( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Postscript */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the Postscript table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: A handle to the input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_PostScript( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Hdmx */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the horizontal device metrics table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: A handle to the input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Hdmx( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Free_Names */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Frees the name records. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Free_Names( TT_Face face ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Free_Hdmx */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Frees the horizontal device metrics table. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Free_Hdmx ( TT_Face face ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Kern */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the first kerning table with format 0 in the font. Only */ |
||||
/* accepts the first horizontal kerning table. Developers should use */ |
||||
/* the `ftxkern' extension to access other kerning tables in the font */ |
||||
/* file, if they really want to. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Kern( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_Gasp */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the `GASP' table into a face object. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: A handle to the target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_Gasp( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
#endif /* TTLOAD_H */ |
||||
|
||||
|
||||
/* END */ |
@ -1,713 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* ttpost.c */ |
||||
/* */ |
||||
/* Postscript names table processing (body). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* The post table is not completely loaded by the core engine. This */ |
||||
/* file loads the missing PS glyph names and implements an API to access */ |
||||
/* them. */ |
||||
/* */ |
||||
/*************************************************************************/ |
||||
|
||||
|
||||
#include <ttpost.h> |
||||
#include <ftstream.h> |
||||
#include <tterrors.h> |
||||
#include <ttload.h> |
||||
#include <tttags.h> |
||||
|
||||
/* the 258 default Mac PS glyph names */ |
||||
|
||||
const TT_String* TT_Mac_Postscript_Names[258] = |
||||
{ |
||||
/* 0 */ |
||||
".notdef", |
||||
".null", |
||||
"CR", |
||||
"space", |
||||
"exclam", |
||||
"quotedbl", |
||||
"numbersign", |
||||
"dollar", |
||||
"percent", |
||||
"ampersand", |
||||
|
||||
/* 10 */ |
||||
"quotesingle", |
||||
"parenleft", |
||||
"parenright", |
||||
"asterisk", |
||||
"plus", |
||||
"comma", |
||||
"hyphen", |
||||
"period", |
||||
"slash", |
||||
"zero", |
||||
|
||||
/* 20 */ |
||||
"one", |
||||
"two", |
||||
"three", |
||||
"four", |
||||
"five", |
||||
"six", |
||||
"seven", |
||||
"eight", |
||||
"nine", |
||||
"colon", |
||||
|
||||
/* 30 */ |
||||
"semicolon", |
||||
"less", |
||||
"equal", |
||||
"greater", "question", |
||||
"at", |
||||
"A", |
||||
"B", |
||||
"C", |
||||
"D", |
||||
|
||||
/* 40 */ |
||||
"E", |
||||
"F", |
||||
"G", |
||||
"H", |
||||
"I", |
||||
"J", |
||||
"K", |
||||
"L", |
||||
"M", |
||||
"N", |
||||
|
||||
/* 50 */ |
||||
"O", |
||||
"P", |
||||
"Q", |
||||
"R", |
||||
"S", |
||||
"T", |
||||
"U", |
||||
"V", |
||||
"W", |
||||
"X", |
||||
|
||||
/* 60 */ |
||||
"Y", |
||||
"Z", |
||||
"bracketleft", |
||||
"backslash", |
||||
"bracketright", |
||||
"asciicircum", |
||||
"underscore", |
||||
"grave", |
||||
"a", |
||||
"b", |
||||
|
||||
/* 70 */ |
||||
"c", |
||||
"d", |
||||
"e", |
||||
"f", |
||||
"g", |
||||
"h", |
||||
"i", |
||||
"j", |
||||
"k", |
||||
"l", |
||||
|
||||
/* 80 */ |
||||
"m", |
||||
"n", |
||||
"o", |
||||
"p", |
||||
"q", |
||||
"r", |
||||
"s", |
||||
"t", |
||||
"u", |
||||
"v", |
||||
|
||||
/* 90 */ |
||||
"w", |
||||
"x", |
||||
"y", |
||||
"z", |
||||
"braceleft", |
||||
"bar", |
||||
"braceright", |
||||
"asciitilde", |
||||
"Adieresis", |
||||
"Aring", |
||||
|
||||
/* 100 */ |
||||
"Ccedilla", |
||||
"Eacute", |
||||
"Ntilde", |
||||
"Odieresis", |
||||
"Udieresis", |
||||
"aacute", |
||||
"agrave", |
||||
"acircumflex", |
||||
"adieresis", |
||||
"atilde", |
||||
|
||||
/* 110 */ |
||||
"aring", |
||||
"ccedilla", |
||||
"eacute", |
||||
"egrave", |
||||
"ecircumflex", |
||||
"edieresis", |
||||
"iacute", |
||||
"igrave", |
||||
"icircumflex", |
||||
"idieresis", |
||||
|
||||
/* 120 */ |
||||
"ntilde", |
||||
"oacute", |
||||
"ograve", |
||||
"ocircumflex", |
||||
"odieresis", |
||||
"otilde", |
||||
"uacute", |
||||
"ugrave", |
||||
"ucircumflex", |
||||
"udieresis", |
||||
|
||||
/* 130 */ |
||||
"dagger", |
||||
"degree", |
||||
"cent", |
||||
"sterling", |
||||
"section", |
||||
"bullet", |
||||
"paragraph", |
||||
"germandbls", |
||||
"registered", |
||||
"copyright", |
||||
|
||||
/* 140 */ |
||||
"trademark", |
||||
"acute", |
||||
"dieresis", |
||||
"notequal", |
||||
"AE", |
||||
"Oslash", |
||||
"infinity", |
||||
"plusminus", |
||||
"lessequal", |
||||
"greaterequal", |
||||
|
||||
/* 150 */ |
||||
"yen", |
||||
"mu", |
||||
"partialdiff", |
||||
"summation", |
||||
"product", |
||||
"pi", |
||||
"integral", |
||||
"ordfeminine", |
||||
"ordmasculine", |
||||
"Omega", |
||||
|
||||
/* 160 */ |
||||
"ae", |
||||
"oslash", |
||||
"questiondown", |
||||
"exclamdown", |
||||
"logicalnot", |
||||
"radical", |
||||
"florin", |
||||
"approxequal", |
||||
"Delta", |
||||
"guillemotleft", |
||||
|
||||
/* 170 */ |
||||
"guillemotright", |
||||
"ellipsis", |
||||
"nbspace", |
||||
"Agrave", |
||||
"Atilde", |
||||
"Otilde", |
||||
"OE", |
||||
"oe", |
||||
"endash", |
||||
"emdash", |
||||
|
||||
/* 180 */ |
||||
"quotedblleft", |
||||
"quotedblright", |
||||
"quoteleft", |
||||
"quoteright", |
||||
"divide", |
||||
"lozenge", |
||||
"ydieresis", |
||||
"Ydieresis", |
||||
"fraction", |
||||
"currency", |
||||
|
||||
/* 190 */ |
||||
"guilsinglleft", |
||||
"guilsinglright", |
||||
"fi", |
||||
"fl", |
||||
"daggerdbl", |
||||
"periodcentered", |
||||
"quotesinglbase", |
||||
"quotedblbase", |
||||
"perthousand", |
||||
"Acircumflex", |
||||
|
||||
/* 200 */ |
||||
"Ecircumflex", |
||||
"Aacute", |
||||
"Edieresis", |
||||
"Egrave", |
||||
"Iacute", |
||||
"Icircumflex", |
||||
"Idieresis", |
||||
"Igrave", |
||||
"Oacute", |
||||
"Ocircumflex", |
||||
|
||||
/* 210 */ |
||||
"apple", |
||||
"Ograve", |
||||
"Uacute", |
||||
"Ucircumflex", |
||||
"Ugrave", |
||||
"dotlessi", |
||||
"circumflex", |
||||
"tilde", |
||||
"macron", |
||||
"breve", |
||||
|
||||
/* 220 */ |
||||
"dotaccent", |
||||
"ring", |
||||
"cedilla", |
||||
"hungarumlaut", |
||||
"ogonek", |
||||
"caron", |
||||
"Lslash", |
||||
"lslash", |
||||
"Scaron", |
||||
"scaron", |
||||
|
||||
/* 230 */ |
||||
"Zcaron", |
||||
"zcaron", |
||||
"brokenbar", |
||||
"Eth", |
||||
"eth", |
||||
"Yacute", |
||||
"yacute", |
||||
"Thorn", |
||||
"thorn", |
||||
"minus", |
||||
|
||||
/* 240 */ |
||||
"multiply", |
||||
"onesuperior", |
||||
"twosuperior", |
||||
"threesuperior", |
||||
"onehalf", |
||||
"onequarter", |
||||
"threequarters", |
||||
"franc", |
||||
"Gbreve", |
||||
"gbreve", |
||||
|
||||
/* 250 */ |
||||
"Idot", |
||||
"Scedilla", |
||||
"scedilla", |
||||
"Cacute", |
||||
"cacute", |
||||
"Ccaron", |
||||
"ccaron", |
||||
"dmacron", |
||||
}; |
||||
|
||||
|
||||
static |
||||
TT_Error Load_Format_20( TT_Face face, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_Memory memory = stream->memory; |
||||
TT_Error error; |
||||
|
||||
TT_UShort num_glyphs; |
||||
TT_UShort num_names; |
||||
|
||||
TT_UShort* glyph_indices = 0; |
||||
TT_Char** name_strings = 0; |
||||
|
||||
|
||||
if ( READ_UShort( num_glyphs ) ) |
||||
goto Exit; |
||||
|
||||
/* UNDOCUMENTED! The number of glyphs in this table can be smaller */ |
||||
/* than the value in the maxp table (cf. cyberbit.ttf). */ |
||||
|
||||
/* There already exist fonts which have more than 32768 glyph names */ |
||||
/* in this table, so the test for this threshold has been dropped. */ |
||||
|
||||
if ( num_glyphs > face->root.num_glyphs ) |
||||
{ |
||||
error = TT_Err_Invalid_File_Format; |
||||
goto Exit; |
||||
} |
||||
|
||||
/* load the indices */ |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
if ( ALLOC_ARRAY ( glyph_indices, num_glyphs, TT_UShort ) || |
||||
ACCESS_Frame( num_glyphs * 2L ) ) |
||||
goto Fail; |
||||
|
||||
for ( n = 0; n < num_glyphs; n++ ) |
||||
glyph_indices[n] = GET_UShort(); |
||||
|
||||
FORGET_Frame(); |
||||
} |
||||
|
||||
/* compute number of names stored in table */ |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
num_names = 0; |
||||
|
||||
for ( n = 0; n < num_glyphs; n++ ) |
||||
{ |
||||
TT_UShort index; |
||||
|
||||
|
||||
index = glyph_indices[n]; |
||||
if ( index >= 258 ) |
||||
{ |
||||
index -= 257; |
||||
if ( index > num_names ) |
||||
num_names = index; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/* now load the name strings */ |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
if ( ALLOC_ARRAY( name_strings, num_names, TT_Char* ) ) |
||||
goto Fail; |
||||
|
||||
for ( n = 0; n < num_names; n++ ) |
||||
{ |
||||
TT_Byte len; |
||||
|
||||
|
||||
if ( READ_Byte ( len ) || |
||||
ALLOC_ARRAY( name_strings[n], len+1, TT_Char ) || |
||||
FILE_Read ( name_strings[n], len ) ) |
||||
goto Fail1; |
||||
|
||||
name_strings[n][len] = '\0'; |
||||
} |
||||
} |
||||
|
||||
/* all right, set table fields and exit successfuly */ |
||||
{ |
||||
TT_Post_20* table = &face->postscript_names.names.format_20; |
||||
|
||||
|
||||
table->num_glyphs = num_glyphs; |
||||
table->num_names = num_names; |
||||
table->glyph_indices = glyph_indices; |
||||
table->glyph_names = name_strings; |
||||
} |
||||
return TT_Err_Ok; |
||||
|
||||
|
||||
Fail1: |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
for ( n = 0; n < num_names; n++ ) |
||||
FREE( name_strings[n] ); |
||||
} |
||||
|
||||
Fail: |
||||
FREE( name_strings ); |
||||
FREE( glyph_indices ); |
||||
|
||||
Exit: |
||||
return error; |
||||
} |
||||
|
||||
|
||||
static |
||||
TT_Error Load_Format_25( TT_Face face, |
||||
FT_Stream stream ) |
||||
{ |
||||
FT_Memory memory = stream->memory; |
||||
TT_Error error; |
||||
|
||||
TT_UShort num_glyphs; |
||||
TT_Char* offset_table = 0; |
||||
|
||||
|
||||
/* UNDOCUMENTED! This value appears only in the Apple TT specs. */ |
||||
if ( READ_UShort( num_glyphs ) ) |
||||
goto Exit; |
||||
|
||||
/* check the number of glyphs */ |
||||
if ( num_glyphs > face->root.num_glyphs || num_glyphs > 258 ) |
||||
{ |
||||
error = TT_Err_Invalid_File_Format; |
||||
goto Exit; |
||||
} |
||||
|
||||
if ( ALLOC ( offset_table, num_glyphs ) || |
||||
FILE_Read( offset_table, num_glyphs ) ) |
||||
goto Fail; |
||||
|
||||
/* now check the offset table */ |
||||
{ |
||||
TT_UShort n; |
||||
|
||||
|
||||
for ( n = 0; n < num_glyphs; n++ ) |
||||
{ |
||||
TT_Long index = (TT_Long)n + offset_table[n]; |
||||
|
||||
|
||||
if ( index < 0 || index > num_glyphs ) |
||||
{ |
||||
error = TT_Err_Invalid_File_Format; |
||||
goto Fail; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/* OK, set table fields and exit successfuly */ |
||||
{ |
||||
TT_Post_25* table = &face->postscript_names.names.format_25; |
||||
|
||||
|
||||
table->num_glyphs = num_glyphs; |
||||
table->offsets = offset_table; |
||||
} |
||||
|
||||
return TT_Err_Ok; |
||||
|
||||
Fail: |
||||
FREE( offset_table ); |
||||
|
||||
Exit: |
||||
return error; |
||||
} |
||||
|
||||
|
||||
static |
||||
TT_Error Load_Post_Names( TT_Face face ) |
||||
{ |
||||
FT_Stream stream; |
||||
TT_Error error; |
||||
|
||||
/* get a stream for the face's resource */ |
||||
stream = face->root.stream; |
||||
|
||||
/* seek to the beginning of the PS names table */ |
||||
{ |
||||
TT_Long table; |
||||
|
||||
|
||||
table = TT_LookUp_Table( face, TTAG_post ); |
||||
if ( FILE_Seek( face->dir_tables[table].Offset + 32L ) ) |
||||
goto Exit; |
||||
} |
||||
|
||||
/* now read postscript table */ |
||||
switch ( face->postscript.FormatType ) |
||||
{ |
||||
case 0x00020000: |
||||
error = Load_Format_20( face, stream ); |
||||
break; |
||||
|
||||
case 0x00028000: |
||||
error = Load_Format_25( face, stream ); |
||||
break; |
||||
|
||||
default: |
||||
error = TT_Err_Invalid_File_Format; |
||||
} |
||||
|
||||
face->postscript_names.loaded = 1; |
||||
|
||||
Exit: |
||||
return error; |
||||
} |
||||
|
||||
|
||||
LOCAL_FUNC |
||||
void TT_Free_Post_Names( TT_Face face ) |
||||
{ |
||||
FT_Memory memory = face->root.memory; |
||||
TT_Post_Names* names = &face->postscript_names; |
||||
|
||||
|
||||
if ( names->loaded ) |
||||
{ |
||||
switch ( face->postscript.FormatType ) |
||||
{ |
||||
case 0x00020000: |
||||
{ |
||||
TT_Post_20* table = &names->names.format_20; |
||||
TT_UShort n; |
||||
|
||||
|
||||
FREE( table->glyph_indices ); |
||||
table->num_glyphs = 0; |
||||
|
||||
for ( n = 0; n < table->num_names; n++ ) |
||||
FREE( table->glyph_names[n] ); |
||||
|
||||
FREE( table->glyph_names ); |
||||
table->num_names = 0; |
||||
} |
||||
break; |
||||
|
||||
case 0x00028000: |
||||
{ |
||||
TT_Post_25* table = &names->names.format_25; |
||||
|
||||
|
||||
FREE( table->offsets ); |
||||
table->num_glyphs = 0; |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
names->loaded = 0; |
||||
} |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Get_PS_Name */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Gets the PostScript glyph name of a glyph. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* index :: The glyph index. */ |
||||
/* */ |
||||
/* PSname :: The address of a string pointer. Will be NULL in case */ |
||||
/* of error, otherwise it is a pointer to the glyph name. */ |
||||
/* */ |
||||
/* You must not modify the returned string! */ |
||||
/* */ |
||||
/* <Output> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
EXPORT_FUNC |
||||
TT_Error TT_Get_PS_Name( TT_Face face, |
||||
TT_UInt index, |
||||
TT_String** PSname ) |
||||
{ |
||||
TT_Error error; |
||||
TT_Post_Names* names; |
||||
|
||||
if ( !face ) |
||||
return TT_Err_Invalid_Face_Handle; |
||||
|
||||
if ( index >= face->root.num_glyphs ) |
||||
return TT_Err_Invalid_Glyph_Index; |
||||
|
||||
names = &face->postscript_names; |
||||
|
||||
/* `.notdef' by default */ |
||||
*PSname = (TT_String*)TT_Mac_Postscript_Names[0]; |
||||
|
||||
switch ( face->postscript.FormatType ) |
||||
{ |
||||
case 0x00010000: |
||||
if ( index < 258 ) /* paranoid checking */ |
||||
*PSname = (TT_String*)TT_Mac_Postscript_Names[index]; |
||||
break; |
||||
|
||||
case 0x00020000: |
||||
{ |
||||
TT_Post_20* table = &names->names.format_20; |
||||
|
||||
|
||||
if ( !names->loaded ) |
||||
{ |
||||
error = Load_Post_Names( face ); |
||||
if ( error ) |
||||
break; |
||||
} |
||||
|
||||
if ( index < table->num_glyphs ) |
||||
{ |
||||
TT_UShort name_index = table->glyph_indices[index]; |
||||
|
||||
|
||||
if ( name_index < 258 ) |
||||
*PSname = (TT_String*)TT_Mac_Postscript_Names[name_index]; |
||||
else |
||||
*PSname = (TT_String*)table->glyph_names[name_index - 258]; |
||||
} |
||||
} |
||||
break; |
||||
|
||||
case 0x00028000: |
||||
{ |
||||
TT_Post_25* table = &names->names.format_25; |
||||
|
||||
|
||||
if ( !names->loaded ) |
||||
{ |
||||
error = Load_Post_Names( face ); |
||||
if ( error ) |
||||
break; |
||||
} |
||||
|
||||
if ( index < table->num_glyphs ) /* paranoid checking */ |
||||
{ |
||||
index += table->offsets[index]; |
||||
*PSname = (TT_String*)TT_Mac_Postscript_Names[index]; |
||||
} |
||||
} |
||||
break; |
||||
|
||||
case 0x00030000: |
||||
break; /* nothing to do */ |
||||
} |
||||
|
||||
return TT_Err_Ok; |
||||
} |
||||
|
||||
|
||||
/* END */ |
@ -1,95 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* ttpost.h */ |
||||
/* */ |
||||
/* Postcript name table processing for TrueType and OpenType fonts */ |
||||
/* (specification). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* The post table is not completely loaded by the core engine. This */ |
||||
/* file loads the missing PS glyph names and implements an API to access */ |
||||
/* them. */ |
||||
/* */ |
||||
/*************************************************************************/ |
||||
|
||||
|
||||
#ifndef TTPOST_H |
||||
#define TTPOST_H |
||||
|
||||
#include <ftconfig.h> |
||||
#include <tttypes.h> |
||||
#include <ttconfig.h> |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
|
||||
#define TT_Err_Invalid_Post_Table_Format 0x0B00 |
||||
#define TT_Err_Invalid_Post_Table 0x0B01 |
||||
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES |
||||
|
||||
#if 0 |
||||
/* the 258 standard Mac glyph names, used for format 1.0 and 2.5 */ |
||||
LOCAL_DEF |
||||
const TT_String* TT_Mac_Postscript_Names[]; |
||||
#endif |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Get_PS_Name */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Gets the PostScript glyph name of a glyph. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* index :: The glyph index. */ |
||||
/* */ |
||||
/* PSname :: The address of a string pointer. Will be NULL in case */ |
||||
/* of error, otherwise it is a pointer to the glyph name. */ |
||||
/* */ |
||||
/* You must not modify the returned string! */ |
||||
/* */ |
||||
/* <Output> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
EXPORT_DEF |
||||
TT_Error TT_Get_PS_Name( TT_Face face, |
||||
TT_UInt index, |
||||
TT_String** PSname ); |
||||
|
||||
|
||||
LOCAL_DEF |
||||
void TT_Free_Post_Names( TT_Face face ); |
||||
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
|
||||
#endif /* TTPOST_H */ |
||||
|
||||
|
||||
/* END */ |
File diff suppressed because it is too large
Load Diff
@ -1,104 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* ttsbit.h */ |
||||
/* */ |
||||
/* TrueType and OpenType embedded bitmap support (specification). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
#ifndef TTSBIT_H |
||||
#define TTSBIT_H |
||||
|
||||
#include <ttload.h> |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_SBit_Strikes */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads the table of embedded bitmap sizes for this face. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: The target face object. */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_SBit_Strikes( TT_Face face, |
||||
FT_Stream stream ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Free_SBit_Strikes */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Releases the embedded bitmap tables. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: The target face object. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
void TT_Free_SBit_Strikes( TT_Face face ); |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* <Function> */ |
||||
/* TT_Load_SBit_Image */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* Loads a given glyph sbit image from the font resource. This also */ |
||||
/* returns its metrics. */ |
||||
/* */ |
||||
/* <Input> */ |
||||
/* face :: The target face object. */ |
||||
/* */ |
||||
/* x_ppem :: The horizontal resolution in points per EM. */ |
||||
/* */ |
||||
/* y_ppem :: The vertical resolution in points per EM. */ |
||||
/* */ |
||||
/* glyph_index :: The current glyph index. */ |
||||
/* */ |
||||
/* stream :: The input stream. */ |
||||
/* */ |
||||
/* <Output> */ |
||||
/* map :: The target pixmap. */ |
||||
/* metrics :: A big sbit metrics structure for the glyph image. */ |
||||
/* */ |
||||
/* <Return> */ |
||||
/* TrueType error code. 0 means success. Returns an error if no */ |
||||
/* glyph sbit exists for the index. */ |
||||
/* */ |
||||
/* <Note> */ |
||||
/* The `map.buffer' field is always freed before the glyph is loaded. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
TT_Error TT_Load_SBit_Image( TT_Face face, |
||||
TT_Int x_ppem, |
||||
TT_Int y_ppem, |
||||
TT_UInt glyph_index, |
||||
FT_Stream stream, |
||||
FT_Bitmap* map, |
||||
TT_SBit_Metrics* metrics ); |
||||
|
||||
|
||||
#endif /* TTSBIT_H */ |
||||
|
||||
|
||||
/* END */ |
File diff suppressed because it is too large
Load Diff
@ -1,54 +0,0 @@ |
||||
#****************************************************************************
|
||||
#* *
|
||||
#* Shared/Type1 Makefile *
|
||||
#* *
|
||||
#* Copyright 1996-1999 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. *
|
||||
#* *
|
||||
#****************************************************************************
|
||||
|
||||
|
||||
#****************************************************************************
|
||||
#* *
|
||||
#* IMPORTANT NOTE: This Makefile is intended for GNU Make! *
|
||||
#* If you provide Makefiles for other make utilities, *
|
||||
#* please place them in `freetype/lib/arch/<system>'. *
|
||||
#* *
|
||||
#* *
|
||||
#* This file is to be included by the Makefiles of each driver that uses *
|
||||
#* the shared source code in `freetype2/lib/drivers/type1'. This code *
|
||||
#* contains type definitions as well as interface which are common to all *
|
||||
#* supported Postscript font formats (i.e. Type1 and Type2). *
|
||||
#* *
|
||||
#* *
|
||||
#* The purpose of this Makefile is to define make variables that are used *
|
||||
#* directly by the parent Makefile. *
|
||||
#* *
|
||||
#****************************************************************************
|
||||
|
||||
|
||||
# T1SHARED_DIR is the directory to the `shared/type1' sources
|
||||
#
|
||||
T1SHARED_DIR := $(SRC)/shared/type1
|
||||
T1SHARED_DIR_ := $(T1SHARED_DIR)$(SEP)
|
||||
|
||||
|
||||
# T1SHARED_H is the list of all header files on which the client drivers
|
||||
# depend
|
||||
#
|
||||
T1SHARED_H := $(T1SHARED_DIR_)t1types.h \
|
||||
$(T1SHARED_DIR_)t1encode.h
|
||||
|
||||
# T1SHARED_SRC is the list of all shared source files that are included
|
||||
# by any client driver
|
||||
#
|
||||
T1SHARED_SRC := $(T1SHARED_DIR_)t1encode.c
|
||||
|
||||
|
||||
# END
|
@ -1,330 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* t1encode.c */ |
||||
/* */ |
||||
/* Type 1 standard encoding tables definitions (body). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/* */ |
||||
/* This file is included by both the Type1 and Type2 driver. */ |
||||
/* It should never be compiled directly. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_standard_strings: */ |
||||
/* */ |
||||
/* This array contains the Adobe Standard Glyph Names ordered by */ |
||||
/* SID. It was taken from the CFF specification. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
const T1_String* t1_standard_strings[] = |
||||
{ |
||||
/* 0 */ |
||||
".notdef", "space", "exclam", "quotedbl", "numbersign", |
||||
"dollar", "percent", "ampersand", "quoteright", "parenleft", |
||||
/* 10 */ |
||||
"parenright", "asterisk", "plus", "comma", "hyphen", |
||||
"period", "slash", "zero", "one", "two", |
||||
/* 20 */ |
||||
"three", "four", "five", "six", "seven", |
||||
"height", "nine", "colon", "semicolon", "less", |
||||
/* 30 */ |
||||
"equal", "greater", "question", "at", "A", |
||||
"B", "C", "D", "E", "F", |
||||
/* 40 */ |
||||
"G", "H", "I", "J", "K", |
||||
"L", "M", "N", "O", "P", |
||||
/* 50 */ |
||||
"Q", "R", "S", "T", "U", |
||||
"V", "W", "X", "Y", "Z", |
||||
/* 60 */ |
||||
"bracketleft", "backslash", "bracketright", "asciicircum", "underscore", |
||||
"quoteleft", "a", "b", "c", "d", |
||||
/* 70 */ |
||||
"e", "f", "g", "h", "i", |
||||
"j", "k", "l", "m", "n", |
||||
/* 80 */ |
||||
"o", "p", "q", "r", "s", |
||||
"t", "u", "v", "w", "x", |
||||
/* 90 */ |
||||
"y", "z", "braceleft", "bar", "braceright", |
||||
"asciitilde", "exclamdown", "cent", "sterling", "fraction", |
||||
/* 100 */ |
||||
"yen", "florin", "section", "currency", "quotesingle", |
||||
"quotedblleft", "quillemotleft", "guilsinglleft", "guilsinglright", "fi", |
||||
/* 110 */ |
||||
"fl", "endash", "dagger", "daggerdbl", "periodcenter", |
||||
"paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", |
||||
/* 120 */ |
||||
"quillemotright", "ellipsis", "perthousand", "questiondown", "grave", |
||||
"acute", "circumflex", "tilde", "macron", "breve", |
||||
/* 130 */ |
||||
"dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", |
||||
"ogonek", "caron", "emdash", "AE", "ordfeminine", |
||||
/* 140 */ |
||||
"Lslash", "Oslash", "OE", "ordmasculine", "ae", |
||||
"dotlessi", "Islash", "oslash", "oe", "germandbls", |
||||
/* 150 */ |
||||
"onesuperior", "logicalnot", "mu", "trademark", "Eth", |
||||
"onehalf", "plusminus", "Thorn", "onequarter", "divide", |
||||
/* 160 */ |
||||
"brokenbar", "degree", "thorn", "threequarters", "twosuperior", |
||||
"regitered", "minus", "eth", "multiply", "threesuperior", |
||||
/* 170 */ |
||||
"copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", |
||||
"Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", |
||||
/* 180 */ |
||||
"Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", |
||||
"Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", |
||||
/* 190 */ |
||||
"Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", |
||||
"Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", |
||||
/* 200 */ |
||||
"aacute", "acircumflex", "adieresis", "agrave", "aring", |
||||
"atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", |
||||
/* 210 */ |
||||
"egrave", "iacute", "icircumflex", "idieresis", "igrave", |
||||
"ntilde", "oacute", "ocircumflex", "odieresis", "ograve", |
||||
/* 220 */ |
||||
"otilde", "scaron", "uacute", "ucircumflex", "udieresis", |
||||
"ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", |
||||
/* 230 */ |
||||
"Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", |
||||
"Acutesmall", |
||||
"parenleftsuperior", "parenrightsuperior", "twodotenleader", |
||||
"onedotenleader", "zerooldstyle", |
||||
/* 240 */ |
||||
"oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", |
||||
"fiveoldstyle", |
||||
"sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", |
||||
"commasuperior", |
||||
/* 250 */ |
||||
"threequartersemdash", "periodsuperior", "questionsmall", "asuperior", |
||||
"bsuperior", |
||||
"centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", |
||||
/* 260 */ |
||||
"msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", |
||||
"tsuperior", "ff", "ffi", "ffl", "parenleftinferior", |
||||
/* 270 */ |
||||
"parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", |
||||
"Asmall", |
||||
"Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", |
||||
/* 280 */ |
||||
"Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", |
||||
"Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", |
||||
/* 290 */ |
||||
"Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", |
||||
"Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", |
||||
/* 300 */ |
||||
"colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", |
||||
"centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", |
||||
"Dieresissmall", |
||||
/* 310 */ |
||||
"Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", |
||||
"hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", |
||||
"questiondownsmall", |
||||
/* 320 */ |
||||
"oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", |
||||
"twothirds", "zerosuperior", "foursuperior", "fivesuperior", |
||||
"sixsuperior", |
||||
/* 330 */ |
||||
"sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", |
||||
"oneinferior", |
||||
"twoinferior", "threeinferior", "fourinferior", "fiveinferior", |
||||
"sixinferior", |
||||
/* 340 */ |
||||
"seveninferior", "eightinferior", "nineinferior", "centinferior", |
||||
"dollarinferior", |
||||
"periodinferior", "commainferior", "Agravesmall", "Aacutesmall", |
||||
"Acircumflexsmall", |
||||
/* 350 */ |
||||
"Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", |
||||
"Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", |
||||
"Igravesmall", |
||||
/* 360 */ |
||||
"Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", |
||||
"Ntildesmall", |
||||
"Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", |
||||
"Odieresissmall", |
||||
/* 370 */ |
||||
"OEsmall", "Oslashsmall", "Ugravesmall", "Uacautesmall", |
||||
"Ucircumflexsmall", |
||||
"Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", |
||||
"001.000", |
||||
/* 380 */ |
||||
"001.001", "001.002", "001.003", "Black", "Bold", |
||||
"Book", "Light", "Medium", "Regular", "Roman", |
||||
/* 390 */ |
||||
"Semibold" |
||||
}; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_standard_encoding: */ |
||||
/* */ |
||||
/* A simple table used to encode the Adobe StandardEncoding. The */ |
||||
/* table values are the SID of the standard glyphs; the table index */ |
||||
/* is the character code for the encoding. */ |
||||
/* */ |
||||
/* Example: */ |
||||
/* */ |
||||
/* t1_standard_encoding[33] == 2 */ |
||||
/* */ |
||||
/* which means that the glyph name for character code 32 is */ |
||||
/* */ |
||||
/* t1_standard_strings[2] == "exclam" */ |
||||
/* */ |
||||
/* (this correspond to the exclamation mark `!'). */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
T1_Short t1_standard_encoding[256] = |
||||
{ |
||||
/* 0 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 1, 2, 3, 4, 5, 6, 7, 8, |
||||
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
||||
/* 50 */ |
||||
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, |
||||
/* 100 */ |
||||
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, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
/* 150 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 96, 97, 98, 99, 100, 101, 102, 103, 104, |
||||
105, 106, 107, 108, 109, 110, 0, 111, 112, 113, |
||||
114, 0, 115, 116, 117, 118, 119, 120, 121, 122, |
||||
0, 123, 0, 124, 125, 126, 127, 128, 129, 130, |
||||
/* 200 */ |
||||
131, 0, 132, 133, 0, 134, 135, 136, 137, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 138, 0, 139, 0, 0, |
||||
0, 0, 140, 141, 142, 143, 0, 0, 0, 0, |
||||
0, 144, 0, 0, 0, 145, 0, 0, 146, 147, |
||||
/* 250 */ |
||||
148, 149, 0, 0, 0, 0 |
||||
}; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_expert_encoding: */ |
||||
/* */ |
||||
/* A simple table used to encode the Adobe ExpertEncoding. The */ |
||||
/* table values are the SID of the standard glyphs; the table index */ |
||||
/* is the character code for the encoding. */ |
||||
/* */ |
||||
/* Example: */ |
||||
/* */ |
||||
/* t1_expert_encoding[33] == 229 */ |
||||
/* */ |
||||
/* which means that the glyph name for character code 32 is */ |
||||
/* */ |
||||
/* t1_standard_strings[229] == "exclamsmall" */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
T1_Short t1_expert_encoding[256] = |
||||
{ |
||||
/* 0 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 1, 229, 230, 0, 231, 232, 233, 234, |
||||
235, 236, 237, 238, 13, 14, 15, 99, 239, 240, |
||||
/* 50 */ |
||||
241, 242, 243, 244, 245, 246, 247, 248, 27, 28, |
||||
249, 250, 251, 252, 0, 253, 254, 255, 256, 257, |
||||
0, 0, 0, 258, 0, 0, 259, 260, 261, 262, |
||||
0, 0, 263, 264, 265, 0, 266, 109, 110, 267, |
||||
268, 269, 0, 270, 271, 272, 273, 274, 275, 276, |
||||
/* 100 */ |
||||
277, 278, 279, 280, 281, 282, 283, 284, 285, 286, |
||||
287, 288, 289, 290, 291, 292, 293, 294, 295, 296, |
||||
297, 298, 299, 300, 301, 302, 303, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
/* 150 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 304, 305, 306, 0, 0, 307, 308, 309, 310, |
||||
311, 0, 312, 0, 0, 312, 0, 0, 314, 315, |
||||
0, 0, 316, 317, 318, 0, 0, 0, 158, 155, |
||||
163, 319, 320, 321, 322, 323, 324, 325, 0, 0, |
||||
/* 200 */ |
||||
326, 150, 164, 169, 327, 328, 329, 330, 331, 332, |
||||
333, 334, 335, 336, 337, 338, 339, 340, 341, 342, |
||||
343, 344, 345, 346, 347, 348, 349, 350, 351, 352, |
||||
353, 354, 355, 356, 357, 358, 359, 360, 361, 362, |
||||
363, 364, 365, 366, 367, 368, 369, 370, 371, 372, |
||||
/* 250 */ |
||||
373, 374, 375, 376, 377, 378 |
||||
}; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_expert_subset_encoding: */ |
||||
/* */ |
||||
/* A simple table used to encode the Adobe ExpertEncoding subset */ |
||||
/* defined in the CFF specification. It will probably evolve into */ |
||||
/* another form sooner or later, as we deal with charsets */ |
||||
/* differently than with encodings. */ |
||||
/* */ |
||||
LOCAL_FUNC |
||||
FT_Short t1_expert_subset_encoding[256] = |
||||
{ |
||||
/* 0 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 1, 0, 0, 0, 231, 232, 0, 0, |
||||
235, 236, 237, 238, 13, 14, 15, 99, 239, 240, |
||||
/* 50 */ |
||||
241, 242, 243, 244, 245, 246, 247, 248, 27, 28, |
||||
249, 250, 251, 252, 0, 253, 254, 255, 256, 257, |
||||
0, 0, 0, 258, 0, 0, 259, 260, 261, 262, |
||||
0, 0, 263, 264, 265, 0, 266, 109, 110, 267, |
||||
268, 269, 0, 270, 0, 272, 0, 0, 0, 0, |
||||
/* 100 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 300, 301, 302, 303, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
/* 150 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 304, 305, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 314, 315, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 158, 155, |
||||
163, 0, 320, 321, 322, 323, 324, 325, 0, 0, |
||||
/* 200 */ |
||||
326, 150, 164, 169, 327, 328, 329, 330, 331, 332, |
||||
333, 334, 335, 336, 337, 338, 339, 340, 341, 342, |
||||
343, 344, 345, 346, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
/* 250 */ |
||||
0, 0, 0, 0, 0, 0 |
||||
}; |
||||
|
||||
|
||||
/* END */ |
@ -1,98 +0,0 @@ |
||||
/***************************************************************************/ |
||||
/* */ |
||||
/* t1encode.h */ |
||||
/* */ |
||||
/* Type 1 standard encoding tables definitions (specification). */ |
||||
/* */ |
||||
/* Copyright 1996-1999 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. */ |
||||
/* */ |
||||
/* */ |
||||
/* This file is included by both the Type1 and Type2 driver. */ |
||||
/* It should never be compiled directly. */ |
||||
/* */ |
||||
/***************************************************************************/ |
||||
|
||||
|
||||
#ifndef T1ENCODE_H |
||||
#define T1ENCODE_H |
||||
|
||||
#include <t1types.h> |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_standard_strings: */ |
||||
/* */ |
||||
/* This array contains the Adobe Standard Glyph Names ordered by */ |
||||
/* SID. It was taken from the CFF specification. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
const T1_String* t1_standard_strings[]; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_standard_encoding: */ |
||||
/* */ |
||||
/* A simple table used to encode the Adobe StandardEncoding. The */ |
||||
/* table values are the SID of the standard glyphs; the table index */ |
||||
/* is the character code for the encoding. */ |
||||
/* */ |
||||
/* Example: */ |
||||
/* */ |
||||
/* t1_standard_encoding[33] == 2 */ |
||||
/* */ |
||||
/* which means that the glyph name for character code 32 is */ |
||||
/* */ |
||||
/* t1_standard_strings[2] == "exclam" */ |
||||
/* */ |
||||
/* (this correspond to the exclamation mark `!'). */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
T1_Short t1_standard_encoding[256]; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_expert_encoding: */ |
||||
/* */ |
||||
/* A simple table used to encode the Adobe ExpertEncoding. The */ |
||||
/* table values are the SID of the standard glyphs; the table index */ |
||||
/* is the character code for the encoding. */ |
||||
/* */ |
||||
/* Example: */ |
||||
/* */ |
||||
/* t1_expert_encoding[33] == 229 */ |
||||
/* */ |
||||
/* which means that the glyph name for character code 32 is */ |
||||
/* */ |
||||
/* t1_standard_strings[229] == "exclamsmall" */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
T1_Short t1_expert_encoding[256]; |
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/* */ |
||||
/* t1_expert_subset_encoding: */ |
||||
/* */ |
||||
/* A simple table used to encode the Adobe ExpertEncoding subset */ |
||||
/* defined in the CFF specification. It will probably evolve into */ |
||||
/* another form sooner or later, as we deal with charsets */ |
||||
/* differently than with encodings. */ |
||||
/* */ |
||||
LOCAL_DEF |
||||
T1_Short t1_expert_subset_encoding[256]; |
||||
|
||||
|
||||
#endif /* T1ENCODE_H */ |
||||
|
||||
|
||||
/* END */ |
@ -1,485 +0,0 @@ |
||||
/*******************************************************************
|
||||
* |
||||
* t1types.h 1.0 |
||||
* |
||||
* Basic Type1/Type2 type definitions and interface. |
||||
* |
||||
* This code is shared by the Type1 and Type2 drivers |
||||
* |
||||
* |
||||
* Copyright 1996-1999 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. |
||||
* |
||||
******************************************************************/ |
||||
|
||||
#ifndef T1TYPES_H |
||||
#define T1TYPES_H |
||||
|
||||
#include <freetype.h> |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*** DEFINITIONS OF BASIC DATA TYPES ***/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
|
||||
|
||||
/* The REDEFINE macro is used to convert a FreeType generic type into */ |
||||
/* a TrueType-specific one. It simply replaces the "FT_" prefix by "T1_" */ |
||||
/* in order to define compatible T1_Long, T1_Error, T1_Outline, etc.. */ |
||||
/* */ |
||||
#undef REDEFINE |
||||
#define REDEFINE( type ) typedef FT_##type T1_##type |
||||
|
||||
|
||||
/* <Type> T1_Bool */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A simple typedef of unsigned char, used for simple booleans. */ |
||||
/* */ |
||||
REDEFINE( Bool ); |
||||
|
||||
|
||||
/* <Type> T1_FWord */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a signed 16-bit integer used to store a distance in original */ |
||||
/* font units. */ |
||||
/* */ |
||||
REDEFINE( FWord ); |
||||
|
||||
|
||||
/* <Type> T1_UFWord */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* an unsigned 16-bit integer used to store a distance in original */ |
||||
/* font units. */ |
||||
/* */ |
||||
REDEFINE( UFWord ); |
||||
|
||||
|
||||
/* <Type> T1_Char */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a simple typedef for the _signed_ char type. */ |
||||
/* */ |
||||
REDEFINE( Char ); |
||||
|
||||
|
||||
/* <Type> T1_Byte */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a simple typedef for the _unsigned_ char type. */ |
||||
/* */ |
||||
REDEFINE( Byte ); |
||||
|
||||
|
||||
/* <Type> T1_String */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a simple typedef for the char type, used for strings usually. */ |
||||
/* */ |
||||
REDEFINE( String ); |
||||
|
||||
|
||||
/* <Type> T1_Short */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a typedef for signed short */ |
||||
/* */ |
||||
REDEFINE( Short ); |
||||
|
||||
|
||||
/* <Type> T1_UShort */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a typedef for unsigned short */ |
||||
/* */ |
||||
REDEFINE( UShort ); |
||||
|
||||
|
||||
/* <Type> FT_Int */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a typedef for the int type */ |
||||
/* */ |
||||
REDEFINE( Int ); |
||||
|
||||
|
||||
/* <Type> FT_UInt */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a typedef for the unsigned int type */ |
||||
/* */ |
||||
REDEFINE( UInt ); |
||||
|
||||
|
||||
/* <Type> T1_Long */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a typedef for signed long */ |
||||
/* */ |
||||
REDEFINE( Long ); |
||||
|
||||
|
||||
/* <Type> T1_ULong */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a typedef for unsigned long */ |
||||
/* */ |
||||
REDEFINE( ULong ); |
||||
|
||||
|
||||
/* <Type> T1_F2Dot14 */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a signed 2.14 fixed float used for unit vectors */ |
||||
/* */ |
||||
REDEFINE( F2Dot14 ); |
||||
|
||||
|
||||
/* <Type> T1_F26Dot6 */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* a signed 26.6 fixed float used for vectorial pixel coordinates */ |
||||
/* */ |
||||
REDEFINE( F26Dot6 ); |
||||
|
||||
|
||||
/* <Type> T1_Fixed */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* This type is used to store 16.16 fixed float values, like */ |
||||
/* scales or matrix coefficients.. */ |
||||
/* */ |
||||
REDEFINE( Fixed ); |
||||
|
||||
|
||||
/* <Type> T1_Pos */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The type T1_Pos is a 32-bits integer used to store vectorial */ |
||||
/* coordinates. Depending on the context, these can represent */ |
||||
/* distances in integer font units, or 26.6 fixed float pixel */ |
||||
/* coordinates.. */ |
||||
/* */ |
||||
REDEFINE( Pos ); |
||||
|
||||
|
||||
/* <Struct> T1_Vector */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A simple structure used to store a 2d vector, coordinates */ |
||||
/* are of the T1_Pos type. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* x :: horizontal coordinate */ |
||||
/* y :: vertical coordinate */ |
||||
/* */ |
||||
REDEFINE( Vector ); |
||||
|
||||
/* <Struct> T1_UnitVector */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A simple structure used to store a 2d vector unit vector. */ |
||||
/* uses T1_F2Dot14 types. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* x :: horizontal coordinate */ |
||||
/* y :: vertical coordinate */ |
||||
/* */ |
||||
REDEFINE( UnitVector ); |
||||
|
||||
|
||||
/* <Struct> T1_Matrix */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A simple structure used to store a 2x2 matrix. Coefficients */ |
||||
/* are in 16.16 fixed float format. The computation performed */ |
||||
/* is : */ |
||||
/* { */ |
||||
/* x' = x*xx + y*xy */ |
||||
/* y' = x*yx + y*yy */ |
||||
/* } */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* xx :: matrix coefficient */ |
||||
/* xy :: matrix coefficient */ |
||||
/* yx :: matrix coefficient */ |
||||
/* yy :: matrix coefficient */ |
||||
/* */ |
||||
REDEFINE( Matrix ); |
||||
|
||||
|
||||
/* <Struct> T1_BBox */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* A structure used to hold an outline's bounding box, i.e. */ |
||||
/* the coordinates of its extrema in the horizontal and vertical */ |
||||
/* directions. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* xMin :: the horizontal minimum (left-most) */ |
||||
/* yMin :: the vertical minimum (bottom-most) */ |
||||
/* xMax :: the horizontal maximum (right-most) */ |
||||
/* yMax :: the vertical maximum (top-most) */ |
||||
/* */ |
||||
REDEFINE( BBox ); |
||||
|
||||
|
||||
/* <Type> T1_Error */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The FreeType error code type. A value of 0 is always */ |
||||
/* interpreted as a succesful operation. */ |
||||
/* */ |
||||
REDEFINE( Error ); |
||||
|
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
|
||||
/***********************************************************************/ |
||||
/* */ |
||||
/* <Struct> T1_FontInfo */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The FontInfo dictionary structure. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* version :: */ |
||||
/* notice :: */ |
||||
/* full_name :: */ |
||||
/* family_name :: */ |
||||
/* weight :: */ |
||||
/* italic_angle :: */ |
||||
/* is_fixed_pitch :: */ |
||||
/* underline_position :: */ |
||||
/* underline_thickness :: */ |
||||
/* */ |
||||
typedef struct T1_FontInfo_ |
||||
{ |
||||
T1_String* version; |
||||
T1_String* notice; |
||||
T1_String* full_name; |
||||
T1_String* family_name; |
||||
T1_String* weight; |
||||
T1_Long italic_angle; |
||||
T1_Bool is_fixed_pitch; |
||||
T1_Short underline_position; |
||||
T1_UShort underline_thickness; |
||||
|
||||
} T1_FontInfo; |
||||
|
||||
|
||||
/***********************************************************************/ |
||||
/* */ |
||||
/* <Struct> T1_Private */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The Private dictionary structure. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* unique_id :: the font's unique id */ |
||||
/* lenIV :: length of decrypt padding */ |
||||
/* */ |
||||
/* num_blues :: number of blue values */ |
||||
/* num_other_blues :: number of other blue values */ |
||||
/* num_family_blues :: number of family blue values */ |
||||
/* num_family_other_blues :: number of family other blue values */ |
||||
/* */ |
||||
/* blue_values :: array of blue values */ |
||||
/* other_blues :: array of other blue values */ |
||||
/* family_blues :: array of family blue values */ |
||||
/* family_other_blues :: array of family other blue values */ |
||||
/* */ |
||||
/* blue_scale :: */ |
||||
/* blue_shift :: */ |
||||
/* blue_scale :: */ |
||||
/* */ |
||||
/* standard_width :: */ |
||||
/* standard_height :: */ |
||||
/* */ |
||||
/* num_snap_widths :: */ |
||||
/* num_snap_heights :: */ |
||||
/* force_bold :: */ |
||||
/* round_stem_up :: */ |
||||
/* */ |
||||
/* stem_snap_widths :: */ |
||||
/* stem_snap_heights :: */ |
||||
/* */ |
||||
/* language_group :: */ |
||||
/* password :: */ |
||||
/* */ |
||||
/* min_feature :: */ |
||||
/* */ |
||||
/* */ |
||||
typedef struct T1_Private_ |
||||
{ |
||||
T1_Int unique_id; |
||||
T1_Int lenIV; |
||||
|
||||
T1_Byte num_blues; |
||||
T1_Byte num_other_blues; |
||||
T1_Byte num_family_blues; |
||||
T1_Byte num_family_other_blues; |
||||
|
||||
T1_Short blue_values[14]; |
||||
T1_Short other_blues[10]; |
||||
|
||||
T1_Short family_blues [14]; |
||||
T1_Short family_other_blues[10]; |
||||
|
||||
T1_Fixed blue_scale; |
||||
T1_Int blue_shift; |
||||
T1_Int blue_fuzz; |
||||
|
||||
T1_UShort standard_width; |
||||
T1_UShort standard_height; |
||||
|
||||
T1_Byte num_snap_widths; |
||||
T1_Byte num_snap_heights; |
||||
T1_Bool force_bold; |
||||
T1_Bool round_stem_up; |
||||
|
||||
T1_Short stem_snap_widths [13]; /* reserve one place for the std */ |
||||
T1_Short stem_snap_heights[13]; /* reserve one place for the std */ |
||||
|
||||
T1_Long language_group; |
||||
T1_Long password; |
||||
|
||||
T1_Short min_feature[2]; |
||||
|
||||
} T1_Private; |
||||
|
||||
|
||||
|
||||
/***********************************************************************/ |
||||
/* */ |
||||
/* <Struct> T1_Private */ |
||||
/* */ |
||||
/* <Description> */ |
||||
/* The Private dictionary structure. */ |
||||
/* */ |
||||
/* <Fields> */ |
||||
/* num_chars :: number of char codes in encoding. Usually 256 */ |
||||
/* code_first :: lower char code in encoding */ |
||||
/* code_last :: higher char code in encoding */ |
||||
/* */ |
||||
/* char_code :: array of character codes */ |
||||
/* char_index :: array of correpsonding glyph indices */ |
||||
/* char_name :: array of correpsonding glyph names */ |
||||
/* */ |
||||
typedef struct T1_Encoding_ |
||||
{ |
||||
T1_Int num_chars; |
||||
T1_Int code_first; |
||||
T1_Int code_last; |
||||
|
||||
T1_Short* char_index; |
||||
T1_String** char_name; |
||||
|
||||
} T1_Encoding; |
||||
|
||||
|
||||
|
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*** ORIGINAL TT_FACE CLASS DEFINITION ***/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*** This structure/class is defined here because it is common ***/ |
||||
/*** to the following formats : TTF, OpenType-TT and OpenType-CFF ***/ |
||||
/*** ***/ |
||||
/*** Note however that the classes TT_Size, TT_GlyphSlot and ***/ |
||||
/*** TT_CharMap are not shared between font drivers, and are ***/ |
||||
/*** thus defined normally in "drivers/truetype/ttobjs.h" ***/ |
||||
/*** ***/ |
||||
/*** ***/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
/*************************************************************************/ |
||||
|
||||
|
||||
typedef struct T1_FaceRec_* T1_Face; |
||||
|
||||
|
||||
/***************************************************/ |
||||
/* */ |
||||
/* T1_Face : */ |
||||
/* */ |
||||
/* Type1 face record.. */ |
||||
/* */ |
||||
|
||||
typedef struct T1_FaceRec_ |
||||
{ |
||||
FT_FaceRec root; |
||||
|
||||
T1_FontInfo font_info; |
||||
FT_String* font_name; |
||||
|
||||
T1_Encoding encoding; |
||||
|
||||
T1_Byte* subrs_block; |
||||
T1_Byte* charstrings_block; |
||||
|
||||
T1_Int num_subrs; |
||||
T1_Byte** subrs; |
||||
T1_Int* subrs_len; |
||||
|
||||
T1_Int num_glyphs; |
||||
T1_String** glyph_names; /* array of glyph names */ |
||||
T1_Byte** charstrings; /* array of glyph charstrings */ |
||||
T1_Int* charstrings_len; |
||||
|
||||
T1_Byte paint_type; |
||||
T1_Byte font_type; |
||||
T1_Matrix font_matrix; |
||||
T1_BBox font_bbox; |
||||
T1_Long unique_id; |
||||
T1_Long font_id; |
||||
|
||||
T1_Int stroke_width; |
||||
T1_Private private_dict; |
||||
|
||||
} T1_FaceRec; |
||||
|
||||
|
||||
#endif /* T1TYPES_H */ |
Loading…
Reference in new issue