20 #include FT_INTERNAL_DEBUG_H
21 #include FT_INTERNAL_STREAM_H
22 #include FT_TRUETYPE_TAGS_H
28 #ifdef TT_CONFIG_OPTION_BDF
37 #define FT_COMPONENT trace_ttbdf
43 TT_BDF bdf = &face->bdf;
51 if ( bdf->table !=
NULL )
54 bdf->table_end =
NULL;
56 bdf->strings_size = 0;
62 tt_face_load_bdf_props(
TT_Face face,
65 TT_BDF bdf = &face->bdf;
77 error = SFNT_Err_Invalid_Table;
81 bdf->table_end = bdf->table +
length;
92 if ( version != 0x0001 ||
94 ( strings - 8 ) / 4 < num_strikes ||
95 strings + 1 > length )
100 bdf->num_strikes = num_strikes;
101 bdf->strings = bdf->table +
strings;
102 bdf->strings_size = length -
strings;
104 count = bdf->num_strikes;
106 strike = p + count * 4;
109 for ( ; count > 0; count-- )
117 strike += 10 * num_items;
122 if ( strike > bdf->strings )
134 error = SFNT_Err_Invalid_Table;
141 const char* property_name,
144 TT_BDF bdf = &face->bdf;
155 if ( bdf->loaded == 0 )
157 error = tt_face_load_bdf_props( face,
FT_FACE( face )->stream );
162 count = bdf->num_strikes;
164 strike = p + 4 *
count;
166 error = SFNT_Err_Invalid_Argument;
168 if ( size ==
NULL || property_name ==
NULL )
171 property_len =
ft_strlen( property_name );
172 if ( property_len == 0 )
175 for ( ; count > 0; count-- )
186 strike += 10 * _count;
192 for ( ; count > 0; count-- )
196 if ( ( type & 0x10 ) != 0 )
202 if ( name_offset < bdf->strings_size &&
203 property_len < bdf->strings_size - name_offset &&
205 (
const char*)bdf->strings + name_offset,
206 bdf->strings_size - name_offset ) == 0 )
208 switch ( type & 0x0F )
214 ft_memchr( bdf->strings + value, 0, bdf->strings_size ) )
217 aprop->u.atom = (
const char*)bdf->strings + value;
225 aprop->u.integer = (FT_Int32)value;
231 aprop->u.cardinal =
value;
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
FT_BEGIN_HEADER tt_face_free_bdf_props(TT_Face face)
GLsizei const GLchar ** strings
#define FT_PEEK_USHORT(p)
#define FT_NEXT_USHORT(buffer)
#define FT_FRAME_RELEASE(bytes)
EGLSurface EGLint void ** value
#define FT_NEXT_ULONG(buffer)
#define FT_FRAME_EXTRACT(size, bytes)
tt_face_goto_table(TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong *length)
tt_face_find_bdf_prop(TT_Face face, const char *property_name, BDF_PropertyRec *aprop)