1
/*******************************************************************
5
* TrueType Tables Loader.
7
* Copyright 1996-1999 by
8
* David Turner, Robert Wilhelm, and Werner Lemberg.
10
* This file is part of the FreeType project, and may only be used
11
* modified and distributed under the terms of the FreeType project
12
* license, LICENSE.TXT. By continuing to use, modify, or distribute
13
* this file you indicate that you have read the license and
14
* understand and accept it fully.
17
* Changes between 1.1 and 1.0 :
19
* - add function Load_TrueType_Any used by TT_Get_Font_Data
21
******************************************************************/
22
/* $XFree86: xc/extras/FreeType/lib/ttload.h,v 1.2 2001/10/28 03:32:05 tsi Exp $ */
36
Long TT_LookUp_Table( PFace face, ULong tag );
38
#if !defined(FTXSBIT_H)
40
LOCAL_DEF TT_Error Load_TrueType_Directory ( PFace face,
43
LOCAL_DEF TT_Error Load_TrueType_MaxProfile ( PFace face );
44
LOCAL_DEF TT_Error Load_TrueType_Gasp ( PFace face );
45
LOCAL_DEF TT_Error Load_TrueType_Header ( PFace face );
46
LOCAL_DEF TT_Error Load_TrueType_Locations ( PFace face );
47
LOCAL_DEF TT_Error Load_TrueType_Names ( PFace face );
48
LOCAL_DEF TT_Error Load_TrueType_CVT ( PFace face );
49
LOCAL_DEF TT_Error Load_TrueType_CMap ( PFace face );
50
LOCAL_DEF TT_Error Load_TrueType_Programs ( PFace face );
51
LOCAL_DEF TT_Error Load_TrueType_OS2 ( PFace face );
52
LOCAL_DEF TT_Error Load_TrueType_PostScript ( PFace face );
53
LOCAL_DEF TT_Error Load_TrueType_Hdmx ( PFace face );
55
LOCAL_DEF TT_Error Load_TrueType_Metrics_Header( PFace face,
58
LOCAL_DEF TT_Error Load_TrueType_Any( PFace face,
64
LOCAL_DEF TT_Error Free_TrueType_Names( PFace face );
65
LOCAL_DEF TT_Error Free_TrueType_Hdmx ( PFace face );
67
#endif /* !FTXSBIT_H */
70
/* The following macros are defined to simplify the writing of */
71
/* the various table and glyph loaders. */
73
/* For examples see the code in ttload.c, ttgload.c etc. */
75
#define USE_Stream( original, duplicate ) \
76
( (error = TT_Use_Stream( original, &duplicate )) != TT_Err_Ok )
78
#define DONE_Stream( _stream ) \
79
TT_Done_Stream( &_stream )
81
/* Define a file frame -- use it only when needed */
82
#define DEFINE_A_FRAME TFileFrame frame = TT_Null_FileFrame
84
/* Define a stream -- use it only when needed */
85
#define DEFINE_A_STREAM TT_Stream stream
88
#ifdef TT_CONFIG_OPTION_THREAD_SAFE /* re-entrant implementation */
90
/* The following macros define the necessary local */
91
/* variables used to access streams and frames. */
93
/* Define stream locals with frame */
94
#define DEFINE_STREAM_LOCALS \
99
/* Define stream locals without frame */
100
#define DEFINE_STREAM_LOCALS_WO_FRAME \
104
/* Define locals with a predefined stream in reentrant mode -- see ttload.c */
105
#define DEFINE_LOAD_LOCALS( STREAM ) \
107
DEFINE_A_STREAM = (STREAM); \
110
/* Define locals without frame with a predefined stream - see ttload.c */
111
#define DEFINE_LOAD_LOCALS_WO_FRAME( STREAM ) \
113
DEFINE_A_STREAM = (STREAM)
115
/* Define all locals necessary to access a font file */
116
#define DEFINE_ALL_LOCALS \
122
#define ACCESS_Frame( _size_ ) \
123
( (error = TT_Access_Frame( stream, \
125
(Long)(_size_) )) != TT_Err_Ok )
126
#define CHECK_ACCESS_Frame( _size_ ) \
127
( (error = TT_Check_And_Access_Frame( stream, \
129
(Long)(_size_) )) != TT_Err_Ok )
130
#define FORGET_Frame() \
131
( (void)TT_Forget_Frame( &frame ) )
133
#define GET_Byte() TT_Get_Byte ( &frame )
134
#define GET_Char() TT_Get_Char ( &frame )
135
#define GET_UShort() TT_Get_UShort( &frame )
136
#define GET_Short() TT_Get_Short ( &frame )
137
#define GET_Long() TT_Get_Long ( &frame )
138
#define GET_ULong() TT_Get_ULong ( &frame )
139
#define GET_Tag4() TT_Get_ULong ( &frame )
141
#define FILE_Pos() TT_File_Pos ( stream )
143
#define FILE_Seek( _position_ ) \
144
( (error = TT_Seek_File( stream, \
145
(Long)(_position_) )) != TT_Err_Ok )
146
#define FILE_Skip( _distance_ ) \
147
( (error = TT_Skip_File( stream, \
148
(Long)(_distance_) )) != TT_Err_Ok )
149
#define FILE_Read( buffer, count ) \
150
( (error = TT_Read_File ( stream, \
152
(Long)(count) )) != TT_Err_Ok )
153
#define FILE_Read_At( pos, buffer, count ) \
154
( (error = TT_Read_At_File( stream, \
157
(Long)(count) )) != TT_Err_Ok )
159
#else /* thread-safe implementation */
161
/* Define stream locals with frame -- nothing in thread-safe mode */
162
#define DEFINE_STREAM_LOCALS \
165
/* Define stream locals without frame -- nothing in thread-safe mode */
166
#define DEFINE_STREAM_LOCALS_WO_FRAME \
169
/* Define locals with a predefined stream in reentrant mode -- see ttload.c */
170
#define DEFINE_LOAD_LOCALS( STREAM ) \
174
/* Define locals without frame with a predefined stream - see ttload.c */
175
#define DEFINE_LOAD_LOCALS_WO_FRAME( STREAM ) \
178
/* Define all locals necessary to access a font file */
179
#define DEFINE_ALL_LOCALS \
184
#define ACCESS_Frame( _size_ ) \
185
( (error = TT_Access_Frame( (Long)(_size_) )) != TT_Err_Ok )
186
#define CHECK_ACCESS_Frame( _size_ ) \
187
( (error = TT_Check_And_Access_Frame( (Long)(_size_) )) != TT_Err_Ok )
188
#define FORGET_Frame() \
189
( (void)TT_Forget_Frame() )
191
#define GET_Byte() TT_Get_Byte ()
192
#define GET_Char() TT_Get_Char ()
193
#define GET_UShort() TT_Get_UShort()
194
#define GET_Short() TT_Get_Short ()
195
#define GET_Long() TT_Get_Long ()
196
#define GET_ULong() TT_Get_ULong ()
197
#define GET_Tag4() TT_Get_ULong ()
199
#define FILE_Pos() TT_File_Pos()
201
#define FILE_Seek( _position_ ) \
202
( (error = TT_Seek_File( (Long)(_position_) )) != TT_Err_Ok )
203
#define FILE_Skip( _distance_ ) \
204
( (error = TT_Skip_File( (Long)(_distance_) )) != TT_Err_Ok )
205
#define FILE_Read( buffer, count ) \
206
( (error = TT_Read_File ( buffer, \
207
(Long)(count) )) != TT_Err_Ok )
208
#define FILE_Read_At( pos, buffer, count ) \
209
( (error = TT_Read_At_File( (Long)(pos), \
211
(Long)(count) )) != TT_Err_Ok )
213
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
219
#endif /* TTLOAD_H */