Sync changes from upstream repository

First publish of public opennurbs from 8.x source
This commit is contained in:
Bozo The Builder
2022-07-28 11:12:21 -07:00
parent beeb16ad7e
commit f26b1ba26a
962 changed files with 822521 additions and 799465 deletions

View File

@@ -1,406 +1,406 @@
/***************************************************************************/
/* */
/* t1afm.c */
/* */
/* AFM support for Type 1 fonts (body). */
/* */
/* Copyright 1996-2016 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 <ft2build.h>
#include "t1afm.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include "t1errors.h"
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1afm
FT_LOCAL_DEF( void )
T1_Done_Metrics( FT_Memory memory,
AFM_FontInfo fi )
{
FT_FREE( fi->KernPairs );
fi->NumKernPair = 0;
FT_FREE( fi->TrackKerns );
fi->NumTrackKern = 0;
FT_FREE( fi );
}
/* read a glyph name and return the equivalent glyph index */
static FT_Int
t1_get_index( const char* name,
FT_Offset len,
void* user_data )
{
T1_Font type1 = (T1_Font)user_data;
FT_Int n;
/* PS string/name length must be < 16-bit */
if ( len > 0xFFFFU )
return 0;
for ( n = 0; n < type1->num_glyphs; n++ )
{
char* gname = (char*)type1->glyph_names[n];
if ( gname && gname[0] == name[0] &&
ft_strlen( gname ) == len &&
ft_strncmp( gname, name, len ) == 0 )
return n;
}
return 0;
}
#undef KERN_INDEX
#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) )
/* compare two kerning pairs */
FT_CALLBACK_DEF( int )
compare_kern_pairs( const void* a,
const void* b )
{
AFM_KernPair pair1 = (AFM_KernPair)a;
AFM_KernPair pair2 = (AFM_KernPair)b;
FT_ULong index1 = KERN_INDEX( pair1->index1, pair1->index2 );
FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 );
if ( index1 > index2 )
return 1;
else if ( index1 < index2 )
return -1;
else
return 0;
}
/* parse a PFM file -- for now, only read the kerning pairs */
static FT_Error
T1_Read_PFM( FT_Face t1_face,
FT_Stream stream,
AFM_FontInfo fi )
{
FT_Error error = FT_Err_Ok;
FT_Memory memory = stream->memory;
FT_Byte* start;
FT_Byte* limit;
FT_Byte* p;
AFM_KernPair kp;
FT_Int width_table_length;
FT_CharMap oldcharmap;
FT_CharMap charmap;
FT_Int n;
start = (FT_Byte*)stream->cursor;
limit = (FT_Byte*)stream->limit;
/* Figure out how long the width table is. */
/* This info is a little-endian short at offset 99. */
p = start + 99;
if ( p + 2 > limit )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
width_table_length = FT_PEEK_USHORT_LE( p );
p += 18 + width_table_length;
if ( p + 0x12 > limit || FT_PEEK_USHORT_LE( p ) < 0x12 )
/* extension table is probably optional */
goto Exit;
/* Kerning offset is 14 bytes from start of extensions table. */
p += 14;
p = start + FT_PEEK_ULONG_LE( p );
if ( p == start )
/* zero offset means no table */
goto Exit;
if ( p + 2 > limit )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
fi->NumKernPair = FT_PEEK_USHORT_LE( p );
p += 2;
if ( p + 4 * fi->NumKernPair > limit )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
/* Actually, kerning pairs are simply optional! */
if ( fi->NumKernPair == 0 )
goto Exit;
/* allocate the pairs */
if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) )
goto Exit;
/* now, read each kern pair */
kp = fi->KernPairs;
limit = p + 4 * fi->NumKernPair;
/* PFM kerning data are stored by encoding rather than glyph index, */
/* so find the PostScript charmap of this font and install it */
/* temporarily. If we find no PostScript charmap, then just use */
/* the default and hope it is the right one. */
oldcharmap = t1_face->charmap;
charmap = NULL;
for ( n = 0; n < t1_face->num_charmaps; n++ )
{
charmap = t1_face->charmaps[n];
/* check against PostScript pseudo platform */
if ( charmap->platform_id == 7 )
{
error = FT_Set_Charmap( t1_face, charmap );
if ( error )
goto Exit;
break;
}
}
/* Kerning info is stored as: */
/* */
/* encoding of first glyph (1 byte) */
/* encoding of second glyph (1 byte) */
/* offset (little-endian short) */
for ( ; p < limit ; p += 4 )
{
kp->index1 = FT_Get_Char_Index( t1_face, p[0] );
kp->index2 = FT_Get_Char_Index( t1_face, p[1] );
kp->x = (FT_Int)FT_PEEK_SHORT_LE(p + 2);
kp->y = 0;
kp++;
}
if ( oldcharmap != NULL )
error = FT_Set_Charmap( t1_face, oldcharmap );
if ( error )
goto Exit;
/* now, sort the kern pairs according to their glyph indices */
ft_qsort( fi->KernPairs, fi->NumKernPair, sizeof ( AFM_KernPairRec ),
compare_kern_pairs );
Exit:
if ( error )
{
FT_FREE( fi->KernPairs );
fi->NumKernPair = 0;
}
return error;
}
/* parse a metrics file -- either AFM or PFM depending on what */
/* it turns out to be */
FT_LOCAL_DEF( FT_Error )
T1_Read_Metrics( FT_Face t1_face,
FT_Stream stream )
{
PSAux_Service psaux;
FT_Memory memory = stream->memory;
AFM_ParserRec parser;
AFM_FontInfo fi = NULL;
FT_Error error = FT_ERR( Unknown_File_Format );
T1_Face face = (T1_Face)t1_face;
T1_Font t1_font = &face->type1;
if ( face->afm_data )
{
FT_TRACE1(( "T1_Read_Metrics:"
" Freeing previously attached metrics data.\n" ));
T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data );
face->afm_data = NULL;
}
if ( FT_NEW( fi ) ||
FT_FRAME_ENTER( stream->size ) )
goto Exit;
fi->FontBBox = t1_font->font_bbox;
fi->Ascender = t1_font->font_bbox.yMax;
fi->Descender = t1_font->font_bbox.yMin;
psaux = (PSAux_Service)face->psaux;
if ( psaux->afm_parser_funcs )
{
error = psaux->afm_parser_funcs->init( &parser,
stream->memory,
stream->cursor,
stream->limit );
if ( !error )
{
parser.FontInfo = fi;
parser.get_index = t1_get_index;
parser.user_data = t1_font;
error = psaux->afm_parser_funcs->parse( &parser );
psaux->afm_parser_funcs->done( &parser );
}
}
if ( FT_ERR_EQ( error, Unknown_File_Format ) )
{
FT_Byte* start = stream->cursor;
/* MS Windows allows versions up to 0x3FF without complaining */
if ( stream->size > 6 &&
start[1] < 4 &&
FT_PEEK_ULONG_LE( start + 2 ) == stream->size )
error = T1_Read_PFM( t1_face, stream, fi );
}
if ( !error )
{
t1_font->font_bbox = fi->FontBBox;
t1_face->bbox.xMin = fi->FontBBox.xMin >> 16;
t1_face->bbox.yMin = fi->FontBBox.yMin >> 16;
/* no `U' suffix here to 0xFFFF! */
t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFF ) >> 16;
t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16;
/* no `U' suffix here to 0x8000! */
t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000 ) >> 16 );
t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 );
if ( fi->NumKernPair )
{
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
face->afm_data = fi;
fi = NULL;
}
}
FT_FRAME_EXIT();
Exit:
if ( fi != NULL )
T1_Done_Metrics( memory, fi );
return error;
}
/* find the kerning for a given glyph pair */
FT_LOCAL_DEF( void )
T1_Get_Kerning( AFM_FontInfo fi,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning )
{
AFM_KernPair min, mid, max;
FT_ULong idx = KERN_INDEX( glyph1, glyph2 );
/* simple binary search */
min = fi->KernPairs;
max = min + fi->NumKernPair - 1;
while ( min <= max )
{
FT_ULong midi;
mid = min + ( max - min ) / 2;
midi = KERN_INDEX( mid->index1, mid->index2 );
if ( midi == idx )
{
kerning->x = mid->x;
kerning->y = mid->y;
return;
}
if ( midi < idx )
min = mid + 1;
else
max = mid - 1;
}
kerning->x = 0;
kerning->y = 0;
}
FT_LOCAL_DEF( FT_Error )
T1_Get_Track_Kerning( FT_Face face,
FT_Fixed ptsize,
FT_Int degree,
FT_Fixed* kerning )
{
AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data;
FT_UInt i;
if ( !fi )
return FT_THROW( Invalid_Argument );
for ( i = 0; i < fi->NumTrackKern; i++ )
{
AFM_TrackKern tk = fi->TrackKerns + i;
if ( tk->degree != degree )
continue;
if ( ptsize < tk->min_ptsize )
*kerning = tk->min_kern;
else if ( ptsize > tk->max_ptsize )
*kerning = tk->max_kern;
else
{
*kerning = FT_MulDiv( ptsize - tk->min_ptsize,
tk->max_kern - tk->min_kern,
tk->max_ptsize - tk->min_ptsize ) +
tk->min_kern;
}
}
return FT_Err_Ok;
}
/* END */
/***************************************************************************/
/* */
/* t1afm.c */
/* */
/* AFM support for Type 1 fonts (body). */
/* */
/* Copyright 1996-2016 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 <ft2build.h>
#include "t1afm.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include "t1errors.h"
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1afm
FT_LOCAL_DEF( void )
T1_Done_Metrics( FT_Memory memory,
AFM_FontInfo fi )
{
FT_FREE( fi->KernPairs );
fi->NumKernPair = 0;
FT_FREE( fi->TrackKerns );
fi->NumTrackKern = 0;
FT_FREE( fi );
}
/* read a glyph name and return the equivalent glyph index */
static FT_Int
t1_get_index( const char* name,
FT_Offset len,
void* user_data )
{
T1_Font type1 = (T1_Font)user_data;
FT_Int n;
/* PS string/name length must be < 16-bit */
if ( len > 0xFFFFU )
return 0;
for ( n = 0; n < type1->num_glyphs; n++ )
{
char* gname = (char*)type1->glyph_names[n];
if ( gname && gname[0] == name[0] &&
ft_strlen( gname ) == len &&
ft_strncmp( gname, name, len ) == 0 )
return n;
}
return 0;
}
#undef KERN_INDEX
#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) )
/* compare two kerning pairs */
FT_CALLBACK_DEF( int )
compare_kern_pairs( const void* a,
const void* b )
{
AFM_KernPair pair1 = (AFM_KernPair)a;
AFM_KernPair pair2 = (AFM_KernPair)b;
FT_ULong index1 = KERN_INDEX( pair1->index1, pair1->index2 );
FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 );
if ( index1 > index2 )
return 1;
else if ( index1 < index2 )
return -1;
else
return 0;
}
/* parse a PFM file -- for now, only read the kerning pairs */
static FT_Error
T1_Read_PFM( FT_Face t1_face,
FT_Stream stream,
AFM_FontInfo fi )
{
FT_Error error = FT_Err_Ok;
FT_Memory memory = stream->memory;
FT_Byte* start;
FT_Byte* limit;
FT_Byte* p;
AFM_KernPair kp;
FT_Int width_table_length;
FT_CharMap oldcharmap;
FT_CharMap charmap;
FT_Int n;
start = (FT_Byte*)stream->cursor;
limit = (FT_Byte*)stream->limit;
/* Figure out how long the width table is. */
/* This info is a little-endian short at offset 99. */
p = start + 99;
if ( p + 2 > limit )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
width_table_length = FT_PEEK_USHORT_LE( p );
p += 18 + width_table_length;
if ( p + 0x12 > limit || FT_PEEK_USHORT_LE( p ) < 0x12 )
/* extension table is probably optional */
goto Exit;
/* Kerning offset is 14 bytes from start of extensions table. */
p += 14;
p = start + FT_PEEK_ULONG_LE( p );
if ( p == start )
/* zero offset means no table */
goto Exit;
if ( p + 2 > limit )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
fi->NumKernPair = FT_PEEK_USHORT_LE( p );
p += 2;
if ( p + 4 * fi->NumKernPair > limit )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
/* Actually, kerning pairs are simply optional! */
if ( fi->NumKernPair == 0 )
goto Exit;
/* allocate the pairs */
if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) )
goto Exit;
/* now, read each kern pair */
kp = fi->KernPairs;
limit = p + 4 * fi->NumKernPair;
/* PFM kerning data are stored by encoding rather than glyph index, */
/* so find the PostScript charmap of this font and install it */
/* temporarily. If we find no PostScript charmap, then just use */
/* the default and hope it is the right one. */
oldcharmap = t1_face->charmap;
charmap = NULL;
for ( n = 0; n < t1_face->num_charmaps; n++ )
{
charmap = t1_face->charmaps[n];
/* check against PostScript pseudo platform */
if ( charmap->platform_id == 7 )
{
error = FT_Set_Charmap( t1_face, charmap );
if ( error )
goto Exit;
break;
}
}
/* Kerning info is stored as: */
/* */
/* encoding of first glyph (1 byte) */
/* encoding of second glyph (1 byte) */
/* offset (little-endian short) */
for ( ; p < limit ; p += 4 )
{
kp->index1 = FT_Get_Char_Index( t1_face, p[0] );
kp->index2 = FT_Get_Char_Index( t1_face, p[1] );
kp->x = (FT_Int)FT_PEEK_SHORT_LE(p + 2);
kp->y = 0;
kp++;
}
if ( oldcharmap != NULL )
error = FT_Set_Charmap( t1_face, oldcharmap );
if ( error )
goto Exit;
/* now, sort the kern pairs according to their glyph indices */
ft_qsort( fi->KernPairs, fi->NumKernPair, sizeof ( AFM_KernPairRec ),
compare_kern_pairs );
Exit:
if ( error )
{
FT_FREE( fi->KernPairs );
fi->NumKernPair = 0;
}
return error;
}
/* parse a metrics file -- either AFM or PFM depending on what */
/* it turns out to be */
FT_LOCAL_DEF( FT_Error )
T1_Read_Metrics( FT_Face t1_face,
FT_Stream stream )
{
PSAux_Service psaux;
FT_Memory memory = stream->memory;
AFM_ParserRec parser;
AFM_FontInfo fi = NULL;
FT_Error error = FT_ERR( Unknown_File_Format );
T1_Face face = (T1_Face)t1_face;
T1_Font t1_font = &face->type1;
if ( face->afm_data )
{
FT_TRACE1(( "T1_Read_Metrics:"
" Freeing previously attached metrics data.\n" ));
T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data );
face->afm_data = NULL;
}
if ( FT_NEW( fi ) ||
FT_FRAME_ENTER( stream->size ) )
goto Exit;
fi->FontBBox = t1_font->font_bbox;
fi->Ascender = t1_font->font_bbox.yMax;
fi->Descender = t1_font->font_bbox.yMin;
psaux = (PSAux_Service)face->psaux;
if ( psaux->afm_parser_funcs )
{
error = psaux->afm_parser_funcs->init( &parser,
stream->memory,
stream->cursor,
stream->limit );
if ( !error )
{
parser.FontInfo = fi;
parser.get_index = t1_get_index;
parser.user_data = t1_font;
error = psaux->afm_parser_funcs->parse( &parser );
psaux->afm_parser_funcs->done( &parser );
}
}
if ( FT_ERR_EQ( error, Unknown_File_Format ) )
{
FT_Byte* start = stream->cursor;
/* MS Windows allows versions up to 0x3FF without complaining */
if ( stream->size > 6 &&
start[1] < 4 &&
FT_PEEK_ULONG_LE( start + 2 ) == stream->size )
error = T1_Read_PFM( t1_face, stream, fi );
}
if ( !error )
{
t1_font->font_bbox = fi->FontBBox;
t1_face->bbox.xMin = fi->FontBBox.xMin >> 16;
t1_face->bbox.yMin = fi->FontBBox.yMin >> 16;
/* no `U' suffix here to 0xFFFF! */
t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFF ) >> 16;
t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16;
/* no `U' suffix here to 0x8000! */
t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000 ) >> 16 );
t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 );
if ( fi->NumKernPair )
{
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
face->afm_data = fi;
fi = NULL;
}
}
FT_FRAME_EXIT();
Exit:
if ( fi != NULL )
T1_Done_Metrics( memory, fi );
return error;
}
/* find the kerning for a given glyph pair */
FT_LOCAL_DEF( void )
T1_Get_Kerning( AFM_FontInfo fi,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning )
{
AFM_KernPair min, mid, max;
FT_ULong idx = KERN_INDEX( glyph1, glyph2 );
/* simple binary search */
min = fi->KernPairs;
max = min + fi->NumKernPair - 1;
while ( min <= max )
{
FT_ULong midi;
mid = min + ( max - min ) / 2;
midi = KERN_INDEX( mid->index1, mid->index2 );
if ( midi == idx )
{
kerning->x = mid->x;
kerning->y = mid->y;
return;
}
if ( midi < idx )
min = mid + 1;
else
max = mid - 1;
}
kerning->x = 0;
kerning->y = 0;
}
FT_LOCAL_DEF( FT_Error )
T1_Get_Track_Kerning( FT_Face face,
FT_Fixed ptsize,
FT_Int degree,
FT_Fixed* kerning )
{
AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data;
FT_UInt i;
if ( !fi )
return FT_THROW( Invalid_Argument );
for ( i = 0; i < fi->NumTrackKern; i++ )
{
AFM_TrackKern tk = fi->TrackKerns + i;
if ( tk->degree != degree )
continue;
if ( ptsize < tk->min_ptsize )
*kerning = tk->min_kern;
else if ( ptsize > tk->max_ptsize )
*kerning = tk->max_kern;
else
{
*kerning = FT_MulDiv( ptsize - tk->min_ptsize,
tk->max_kern - tk->min_kern,
tk->max_ptsize - tk->min_ptsize ) +
tk->min_kern;
}
}
return FT_Err_Ok;
}
/* END */

View File

@@ -1,54 +1,54 @@
/***************************************************************************/
/* */
/* t1afm.h */
/* */
/* AFM support for Type 1 fonts (specification). */
/* */
/* Copyright 1996-2016 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 T1AFM_H_
#define T1AFM_H_
#include <ft2build.h>
#include "t1objs.h"
#include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
T1_Read_Metrics( FT_Face face,
FT_Stream stream );
FT_LOCAL( void )
T1_Done_Metrics( FT_Memory memory,
AFM_FontInfo fi );
FT_LOCAL( void )
T1_Get_Kerning( AFM_FontInfo fi,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning );
FT_LOCAL( FT_Error )
T1_Get_Track_Kerning( FT_Face face,
FT_Fixed ptsize,
FT_Int degree,
FT_Fixed* kerning );
FT_END_HEADER
#endif /* T1AFM_H_ */
/* END */
/***************************************************************************/
/* */
/* t1afm.h */
/* */
/* AFM support for Type 1 fonts (specification). */
/* */
/* Copyright 1996-2016 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 T1AFM_H_
#define T1AFM_H_
#include <ft2build.h>
#include "t1objs.h"
#include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
T1_Read_Metrics( FT_Face face,
FT_Stream stream );
FT_LOCAL( void )
T1_Done_Metrics( FT_Memory memory,
AFM_FontInfo fi );
FT_LOCAL( void )
T1_Get_Kerning( AFM_FontInfo fi,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning );
FT_LOCAL( FT_Error )
T1_Get_Track_Kerning( FT_Face face,
FT_Fixed ptsize,
FT_Int degree,
FT_Fixed* kerning );
FT_END_HEADER
#endif /* T1AFM_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +1,42 @@
/***************************************************************************/
/* */
/* t1driver.h */
/* */
/* High-level Type 1 driver interface (specification). */
/* */
/* Copyright 1996-2016 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 T1DRIVER_H_
#define T1DRIVER_H_
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class;
FT_END_HEADER
#endif /* T1DRIVER_H_ */
/* END */
/***************************************************************************/
/* */
/* t1driver.h */
/* */
/* High-level Type 1 driver interface (specification). */
/* */
/* Copyright 1996-2016 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 T1DRIVER_H_
#define T1DRIVER_H_
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
#endif
FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class;
FT_END_HEADER
#endif /* T1DRIVER_H_ */
/* END */

View File

@@ -1,41 +1,41 @@
/***************************************************************************/
/* */
/* t1errors.h */
/* */
/* Type 1 error codes (specification only). */
/* */
/* Copyright 2001-2016 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 used to define the Type 1 error enumeration constants. */
/* */
/*************************************************************************/
#ifndef T1ERRORS_H_
#define T1ERRORS_H_
#include FT_MODULE_ERRORS_H
#undef FTERRORS_H_
#undef FT_ERR_PREFIX
#define FT_ERR_PREFIX T1_Err_
#define FT_ERR_BASE FT_Mod_Err_Type1
#include FT_ERRORS_H
#endif /* T1ERRORS_H_ */
/* END */
/***************************************************************************/
/* */
/* t1errors.h */
/* */
/* Type 1 error codes (specification only). */
/* */
/* Copyright 2001-2016 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 used to define the Type 1 error enumeration constants. */
/* */
/*************************************************************************/
#ifndef T1ERRORS_H_
#define T1ERRORS_H_
#include FT_MODULE_ERRORS_H
#undef FTERRORS_H_
#undef FT_ERR_PREFIX
#define FT_ERR_PREFIX T1_Err_
#define FT_ERR_BASE FT_Mod_Err_Type1
#include FT_ERRORS_H
#endif /* T1ERRORS_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@@ -1,53 +1,53 @@
/***************************************************************************/
/* */
/* t1gload.h */
/* */
/* Type 1 Glyph Loader (specification). */
/* */
/* Copyright 1996-2016 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 T1GLOAD_H_
#define T1GLOAD_H_
#include <ft2build.h>
#include "t1objs.h"
FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
FT_Pos* max_advance );
FT_LOCAL( FT_Error )
T1_Get_Advances( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Int32 load_flags,
FT_Fixed* advances );
FT_LOCAL( FT_Error )
T1_Load_Glyph( FT_GlyphSlot glyph,
FT_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags );
FT_END_HEADER
#endif /* T1GLOAD_H_ */
/* END */
/***************************************************************************/
/* */
/* t1gload.h */
/* */
/* Type 1 Glyph Loader (specification). */
/* */
/* Copyright 1996-2016 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 T1GLOAD_H_
#define T1GLOAD_H_
#include <ft2build.h>
#include "t1objs.h"
FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
FT_Pos* max_advance );
FT_LOCAL( FT_Error )
T1_Get_Advances( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Int32 load_flags,
FT_Fixed* advances );
FT_LOCAL( FT_Error )
T1_Load_Glyph( FT_GlyphSlot glyph,
FT_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags );
FT_END_HEADER
#endif /* T1GLOAD_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@@ -1,103 +1,103 @@
/***************************************************************************/
/* */
/* t1load.h */
/* */
/* Type 1 font loader (specification). */
/* */
/* Copyright 1996-2016 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 T1LOAD_H_
#define T1LOAD_H_
#include <ft2build.h>
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_MULTIPLE_MASTERS_H
#include "t1parse.h"
FT_BEGIN_HEADER
typedef struct T1_Loader_
{
T1_ParserRec parser; /* parser used to read the stream */
FT_Int num_chars; /* number of characters in encoding */
PS_TableRec encoding_table; /* PS_Table used to store the */
/* encoding character names */
FT_Int num_glyphs;
PS_TableRec glyph_names;
PS_TableRec charstrings;
PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */
FT_Int num_subrs;
PS_TableRec subrs;
FT_Hash subrs_hash;
FT_Bool fontdata;
FT_UInt keywords_encountered; /* T1_LOADER_ENCOUNTERED_XXX */
} T1_LoaderRec, *T1_Loader;
/* treatment of some keywords differs depending on whether */
/* they precede or follow certain other keywords */
#define T1_PRIVATE ( 1 << 0 )
#define T1_FONTDIR_AFTER_PRIVATE ( 1 << 1 )
FT_LOCAL( FT_Error )
T1_Open_Face( T1_Face face );
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
FT_LOCAL( FT_Error )
T1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
FT_LOCAL_DEF( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master );
FT_LOCAL( FT_Error )
T1_Set_MM_Blend( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
FT_LOCAL( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords );
FT_LOCAL_DEF( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
FT_LOCAL( void )
T1_Done_Blend( T1_Face face );
#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
FT_END_HEADER
#endif /* T1LOAD_H_ */
/* END */
/***************************************************************************/
/* */
/* t1load.h */
/* */
/* Type 1 font loader (specification). */
/* */
/* Copyright 1996-2016 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 T1LOAD_H_
#define T1LOAD_H_
#include <ft2build.h>
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_MULTIPLE_MASTERS_H
#include "t1parse.h"
FT_BEGIN_HEADER
typedef struct T1_Loader_
{
T1_ParserRec parser; /* parser used to read the stream */
FT_Int num_chars; /* number of characters in encoding */
PS_TableRec encoding_table; /* PS_Table used to store the */
/* encoding character names */
FT_Int num_glyphs;
PS_TableRec glyph_names;
PS_TableRec charstrings;
PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */
FT_Int num_subrs;
PS_TableRec subrs;
FT_Hash subrs_hash;
FT_Bool fontdata;
FT_UInt keywords_encountered; /* T1_LOADER_ENCOUNTERED_XXX */
} T1_LoaderRec, *T1_Loader;
/* treatment of some keywords differs depending on whether */
/* they precede or follow certain other keywords */
#define T1_PRIVATE ( 1 << 0 )
#define T1_FONTDIR_AFTER_PRIVATE ( 1 << 1 )
FT_LOCAL( FT_Error )
T1_Open_Face( T1_Face face );
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
FT_LOCAL( FT_Error )
T1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
FT_LOCAL_DEF( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master );
FT_LOCAL( FT_Error )
T1_Set_MM_Blend( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
FT_LOCAL( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords );
FT_LOCAL_DEF( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
FT_LOCAL( void )
T1_Done_Blend( T1_Face face );
#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
FT_END_HEADER
#endif /* T1LOAD_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@@ -1,160 +1,160 @@
/***************************************************************************/
/* */
/* t1objs.h */
/* */
/* Type 1 objects manager (specification). */
/* */
/* Copyright 1996-2016 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 T1OBJS_H_
#define T1OBJS_H_
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_CONFIG_CONFIG_H
#include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER
/* The following structures must be defined by the hinter */
typedef struct T1_Size_Hints_ T1_Size_Hints;
typedef struct T1_Glyph_Hints_ T1_Glyph_Hints;
/*************************************************************************/
/* */
/* <Type> */
/* T1_Size */
/* */
/* <Description> */
/* A handle to a Type 1 size object. */
/* */
typedef struct T1_SizeRec_* T1_Size;
/*************************************************************************/
/* */
/* <Type> */
/* T1_GlyphSlot */
/* */
/* <Description> */
/* A handle to a Type 1 glyph slot object. */
/* */
typedef struct T1_GlyphSlotRec_* T1_GlyphSlot;
/*************************************************************************/
/* */
/* <Type> */
/* T1_CharMap */
/* */
/* <Description> */
/* A handle to a Type 1 character mapping object. */
/* */
/* <Note> */
/* The Type 1 format doesn't use a charmap but an encoding table. */
/* The driver is responsible for making up charmap objects */
/* corresponding to these tables. */
/* */
typedef struct T1_CharMapRec_* T1_CharMap;
/*************************************************************************/
/* */
/* HERE BEGINS THE TYPE1 SPECIFIC STUFF */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Type> */
/* T1_SizeRec */
/* */
/* <Description> */
/* Type 1 size record. */
/* */
typedef struct T1_SizeRec_
{
FT_SizeRec root;
} T1_SizeRec;
FT_LOCAL( void )
T1_Size_Done( FT_Size size );
FT_LOCAL( FT_Error )
T1_Size_Request( FT_Size size,
FT_Size_Request req );
FT_LOCAL( FT_Error )
T1_Size_Init( FT_Size size );
/*************************************************************************/
/* */
/* <Type> */
/* T1_GlyphSlotRec */
/* */
/* <Description> */
/* Type 1 glyph slot record. */
/* */
typedef struct T1_GlyphSlotRec_
{
FT_GlyphSlotRec root;
FT_Bool hint;
FT_Bool scaled;
FT_Int max_points;
FT_Int max_contours;
FT_Fixed x_scale;
FT_Fixed y_scale;
} T1_GlyphSlotRec;
FT_LOCAL( FT_Error )
T1_Face_Init( FT_Stream stream,
FT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
FT_LOCAL( void )
T1_Face_Done( FT_Face face );
FT_LOCAL( FT_Error )
T1_GlyphSlot_Init( FT_GlyphSlot slot );
FT_LOCAL( void )
T1_GlyphSlot_Done( FT_GlyphSlot slot );
FT_LOCAL( FT_Error )
T1_Driver_Init( FT_Module driver );
FT_LOCAL( void )
T1_Driver_Done( FT_Module driver );
FT_END_HEADER
#endif /* T1OBJS_H_ */
/* END */
/***************************************************************************/
/* */
/* t1objs.h */
/* */
/* Type 1 objects manager (specification). */
/* */
/* Copyright 1996-2016 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 T1OBJS_H_
#define T1OBJS_H_
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_CONFIG_CONFIG_H
#include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER
/* The following structures must be defined by the hinter */
typedef struct T1_Size_Hints_ T1_Size_Hints;
typedef struct T1_Glyph_Hints_ T1_Glyph_Hints;
/*************************************************************************/
/* */
/* <Type> */
/* T1_Size */
/* */
/* <Description> */
/* A handle to a Type 1 size object. */
/* */
typedef struct T1_SizeRec_* T1_Size;
/*************************************************************************/
/* */
/* <Type> */
/* T1_GlyphSlot */
/* */
/* <Description> */
/* A handle to a Type 1 glyph slot object. */
/* */
typedef struct T1_GlyphSlotRec_* T1_GlyphSlot;
/*************************************************************************/
/* */
/* <Type> */
/* T1_CharMap */
/* */
/* <Description> */
/* A handle to a Type 1 character mapping object. */
/* */
/* <Note> */
/* The Type 1 format doesn't use a charmap but an encoding table. */
/* The driver is responsible for making up charmap objects */
/* corresponding to these tables. */
/* */
typedef struct T1_CharMapRec_* T1_CharMap;
/*************************************************************************/
/* */
/* HERE BEGINS THE TYPE1 SPECIFIC STUFF */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Type> */
/* T1_SizeRec */
/* */
/* <Description> */
/* Type 1 size record. */
/* */
typedef struct T1_SizeRec_
{
FT_SizeRec root;
} T1_SizeRec;
FT_LOCAL( void )
T1_Size_Done( FT_Size size );
FT_LOCAL( FT_Error )
T1_Size_Request( FT_Size size,
FT_Size_Request req );
FT_LOCAL( FT_Error )
T1_Size_Init( FT_Size size );
/*************************************************************************/
/* */
/* <Type> */
/* T1_GlyphSlotRec */
/* */
/* <Description> */
/* Type 1 glyph slot record. */
/* */
typedef struct T1_GlyphSlotRec_
{
FT_GlyphSlotRec root;
FT_Bool hint;
FT_Bool scaled;
FT_Int max_points;
FT_Int max_contours;
FT_Fixed x_scale;
FT_Fixed y_scale;
} T1_GlyphSlotRec;
FT_LOCAL( FT_Error )
T1_Face_Init( FT_Stream stream,
FT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
FT_LOCAL( void )
T1_Face_Done( FT_Face face );
FT_LOCAL( FT_Error )
T1_GlyphSlot_Init( FT_GlyphSlot slot );
FT_LOCAL( void )
T1_GlyphSlot_Done( FT_GlyphSlot slot );
FT_LOCAL( FT_Error )
T1_Driver_Init( FT_Module driver );
FT_LOCAL( void )
T1_Driver_Done( FT_Module driver );
FT_END_HEADER
#endif /* T1OBJS_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@@ -1,129 +1,129 @@
/***************************************************************************/
/* */
/* t1parse.h */
/* */
/* Type 1 parser (specification). */
/* */
/* Copyright 1996-2016 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 T1PARSE_H_
#define T1PARSE_H_
#include <ft2build.h>
#include FT_INTERNAL_TYPE1_TYPES_H
#include FT_INTERNAL_STREAM_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* T1_ParserRec */
/* */
/* <Description> */
/* A PS_ParserRec is an object used to parse a Type 1 fonts very */
/* quickly. */
/* */
/* <Fields> */
/* root :: The root parser. */
/* */
/* stream :: The current input stream. */
/* */
/* base_dict :: A pointer to the top-level dictionary. */
/* */
/* base_len :: The length in bytes of the top dictionary. */
/* */
/* private_dict :: A pointer to the private dictionary. */
/* */
/* private_len :: The length in bytes of the private dictionary. */
/* */
/* in_pfb :: A boolean. Indicates that we are handling a PFB */
/* file. */
/* */
/* in_memory :: A boolean. Indicates a memory-based stream. */
/* */
/* single_block :: A boolean. Indicates that the private dictionary */
/* is stored in lieu of the base dictionary. */
/* */
typedef struct T1_ParserRec_
{
PS_ParserRec root;
FT_Stream stream;
FT_Byte* base_dict;
FT_ULong base_len;
FT_Byte* private_dict;
FT_ULong private_len;
FT_Bool in_pfb;
FT_Bool in_memory;
FT_Bool single_block;
} T1_ParserRec, *T1_Parser;
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
#define T1_Release_Table( p ) \
do \
{ \
if ( (p)->funcs.release ) \
(p)->funcs.release( p ); \
} while ( 0 )
#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
#define T1_ToCoordArray( p, m, c ) \
(p)->root.funcs.to_coord_array( &(p)->root, m, c )
#define T1_ToFixedArray( p, m, f, t ) \
(p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
#define T1_ToToken( p, t ) \
(p)->root.funcs.to_token( &(p)->root, t )
#define T1_ToTokenArray( p, t, m, c ) \
(p)->root.funcs.to_token_array( &(p)->root, t, m, c )
#define T1_Load_Field( p, f, o, m, pf ) \
(p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
#define T1_Load_Field_Table( p, f, o, m, pf ) \
(p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
FT_LOCAL( FT_Error )
T1_New_Parser( T1_Parser parser,
FT_Stream stream,
FT_Memory memory,
PSAux_Service psaux );
FT_LOCAL( FT_Error )
T1_Get_Private_Dict( T1_Parser parser,
PSAux_Service psaux );
FT_LOCAL( void )
T1_Finalize_Parser( T1_Parser parser );
FT_END_HEADER
#endif /* T1PARSE_H_ */
/* END */
/***************************************************************************/
/* */
/* t1parse.h */
/* */
/* Type 1 parser (specification). */
/* */
/* Copyright 1996-2016 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 T1PARSE_H_
#define T1PARSE_H_
#include <ft2build.h>
#include FT_INTERNAL_TYPE1_TYPES_H
#include FT_INTERNAL_STREAM_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* T1_ParserRec */
/* */
/* <Description> */
/* A PS_ParserRec is an object used to parse a Type 1 fonts very */
/* quickly. */
/* */
/* <Fields> */
/* root :: The root parser. */
/* */
/* stream :: The current input stream. */
/* */
/* base_dict :: A pointer to the top-level dictionary. */
/* */
/* base_len :: The length in bytes of the top dictionary. */
/* */
/* private_dict :: A pointer to the private dictionary. */
/* */
/* private_len :: The length in bytes of the private dictionary. */
/* */
/* in_pfb :: A boolean. Indicates that we are handling a PFB */
/* file. */
/* */
/* in_memory :: A boolean. Indicates a memory-based stream. */
/* */
/* single_block :: A boolean. Indicates that the private dictionary */
/* is stored in lieu of the base dictionary. */
/* */
typedef struct T1_ParserRec_
{
PS_ParserRec root;
FT_Stream stream;
FT_Byte* base_dict;
FT_ULong base_len;
FT_Byte* private_dict;
FT_ULong private_len;
FT_Bool in_pfb;
FT_Bool in_memory;
FT_Bool single_block;
} T1_ParserRec, *T1_Parser;
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
#define T1_Release_Table( p ) \
do \
{ \
if ( (p)->funcs.release ) \
(p)->funcs.release( p ); \
} while ( 0 )
#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
#define T1_ToCoordArray( p, m, c ) \
(p)->root.funcs.to_coord_array( &(p)->root, m, c )
#define T1_ToFixedArray( p, m, f, t ) \
(p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
#define T1_ToToken( p, t ) \
(p)->root.funcs.to_token( &(p)->root, t )
#define T1_ToTokenArray( p, t, m, c ) \
(p)->root.funcs.to_token_array( &(p)->root, t, m, c )
#define T1_Load_Field( p, f, o, m, pf ) \
(p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
#define T1_Load_Field_Table( p, f, o, m, pf ) \
(p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
FT_LOCAL( FT_Error )
T1_New_Parser( T1_Parser parser,
FT_Stream stream,
FT_Memory memory,
PSAux_Service psaux );
FT_LOCAL( FT_Error )
T1_Get_Private_Dict( T1_Parser parser,
PSAux_Service psaux );
FT_LOCAL( void )
T1_Finalize_Parser( T1_Parser parser );
FT_END_HEADER
#endif /* T1PARSE_H_ */
/* END */

View File

@@ -1,143 +1,143 @@
/***************************************************************************/
/* */
/* t1tokens.h */
/* */
/* Type 1 tokenizer (specification). */
/* */
/* Copyright 1996-2016 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. */
/* */
/***************************************************************************/
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontInfoRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
T1_FIELD_STRING( "version", version,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "Notice", notice,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "FullName", full_name,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "FamilyName", family_name,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "Weight", weight,
T1_FIELD_DICT_FONTDICT )
/* we use pointers to detect modifications made by synthetic fonts */
T1_FIELD_NUM ( "ItalicAngle", italic_angle,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "UnderlinePosition", underline_position,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness,
T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontExtraRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
T1_FIELD_NUM ( "FSType", fs_type,
T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_PrivateRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_PRIVATE
T1_FIELD_NUM ( "UniqueID", unique_id,
T1_FIELD_DICT_FONTDICT | T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "lenIV", lenIV,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "LanguageGroup", language_group,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "password", password,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_FIXED_1000( "BlueScale", blue_scale,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "BlueShift", blue_shift,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "BlueFuzz", blue_fuzz,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "BlueValues", blue_values, 14,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "OtherBlues", other_blues, 10,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "FamilyBlues", family_blues, 14,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE2( "StdHW", standard_width, 1,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE2( "StdVW", standard_height, 1,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_FIXED ( "ExpansionFactor", expansion_factor,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_BOOL ( "ForceBold", force_bold,
T1_FIELD_DICT_PRIVATE )
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FontRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
T1_FIELD_KEY ( "FontName", font_name, T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "PaintType", paint_type, T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "FontType", font_type, T1_FIELD_DICT_FONTDICT )
T1_FIELD_FIXED( "StrokeWidth", stroke_width, T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_BBOX
T1_FIELD_BBOX( "FontBBox", xMin, T1_FIELD_DICT_FONTDICT )
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FaceRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FACE
T1_FIELD_NUM( "NDV", ndv_idx, T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM( "CDV", cdv_idx, T1_FIELD_DICT_PRIVATE )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_BlendRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_BLEND
T1_FIELD_NUM_TABLE( "DesignVector", default_design_vector,
T1_MAX_MM_DESIGNS, T1_FIELD_DICT_FONTDICT )
#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */
/* END */
/***************************************************************************/
/* */
/* t1tokens.h */
/* */
/* Type 1 tokenizer (specification). */
/* */
/* Copyright 1996-2016 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. */
/* */
/***************************************************************************/
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontInfoRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
T1_FIELD_STRING( "version", version,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "Notice", notice,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "FullName", full_name,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "FamilyName", family_name,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_STRING( "Weight", weight,
T1_FIELD_DICT_FONTDICT )
/* we use pointers to detect modifications made by synthetic fonts */
T1_FIELD_NUM ( "ItalicAngle", italic_angle,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "UnderlinePosition", underline_position,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness,
T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontExtraRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
T1_FIELD_NUM ( "FSType", fs_type,
T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_PrivateRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_PRIVATE
T1_FIELD_NUM ( "UniqueID", unique_id,
T1_FIELD_DICT_FONTDICT | T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "lenIV", lenIV,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "LanguageGroup", language_group,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "password", password,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_FIXED_1000( "BlueScale", blue_scale,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "BlueShift", blue_shift,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM ( "BlueFuzz", blue_fuzz,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "BlueValues", blue_values, 14,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "OtherBlues", other_blues, 10,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "FamilyBlues", family_blues, 14,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE2( "StdHW", standard_width, 1,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE2( "StdVW", standard_height, 1,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_FIXED ( "ExpansionFactor", expansion_factor,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_BOOL ( "ForceBold", force_bold,
T1_FIELD_DICT_PRIVATE )
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FontRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
T1_FIELD_KEY ( "FontName", font_name, T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "PaintType", paint_type, T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "FontType", font_type, T1_FIELD_DICT_FONTDICT )
T1_FIELD_FIXED( "StrokeWidth", stroke_width, T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_BBOX
T1_FIELD_BBOX( "FontBBox", xMin, T1_FIELD_DICT_FONTDICT )
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FaceRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FACE
T1_FIELD_NUM( "NDV", ndv_idx, T1_FIELD_DICT_PRIVATE )
T1_FIELD_NUM( "CDV", cdv_idx, T1_FIELD_DICT_PRIVATE )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_BlendRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_BLEND
T1_FIELD_NUM_TABLE( "DesignVector", default_design_vector,
T1_MAX_MM_DESIGNS, T1_FIELD_DICT_FONTDICT )
#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */
/* END */

View File

@@ -1,33 +1,33 @@
/***************************************************************************/
/* */
/* type1.c */
/* */
/* FreeType Type 1 driver component (body only). */
/* */
/* Copyright 1996-2016 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. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "t1parse.c"
#include "t1load.c"
#include "t1objs.c"
#include "t1driver.c"
#include "t1gload.c"
#ifndef T1_CONFIG_OPTION_NO_AFM
#include "t1afm.c"
#endif
/* END */
/***************************************************************************/
/* */
/* type1.c */
/* */
/* FreeType Type 1 driver component (body only). */
/* */
/* Copyright 1996-2016 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. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "t1parse.c"
#include "t1load.c"
#include "t1objs.c"
#include "t1driver.c"
#include "t1gload.c"
#ifndef T1_CONFIG_OPTION_NO_AFM
#include "t1afm.c"
#endif
/* END */