20 #include FT_INTERNAL_DEBUG_H
21 #include FT_CONFIG_CONFIG_H
22 #include FT_MULTIPLE_MASTERS_H
23 #include FT_INTERNAL_TYPE1_TYPES_H
37 #define FT_COMPONENT trace_cidload
49 for ( result = 0; offsize > 0; offsize-- )
85 error = parser->root.error;
113 if ( parser->num_dict < 0 || parser->num_dict >= cid->
num_dicts )
115 FT_ERROR((
"cid_load_keyword: invalid use of `%s'\n",
117 error = CID_Err_Syntax_Error;
125 object = (
FT_Byte*)&dict->private_dict;
143 keyword, &dummy_object );
161 if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
163 dict = face->cid.font_dicts + parser->num_dict;
169 temp_scale =
FT_ABS( temp[3] );
178 if ( temp_scale != 0x10000L )
180 temp[0] =
FT_DivFix( temp[0], temp_scale );
181 temp[1] =
FT_DivFix( temp[1], temp_scale );
182 temp[2] =
FT_DivFix( temp[2], temp_scale );
183 temp[4] =
FT_DivFix( temp[4], temp_scale );
184 temp[5] =
FT_DivFix( temp[5], temp_scale );
188 matrix->
xx = temp[0];
189 matrix->
yx = temp[1];
190 matrix->
xy = temp[2];
191 matrix->
yy = temp[3];
194 offset->
x = temp[4] >> 16;
195 offset->
y = temp[5] >> 16;
252 if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
254 dict = face->cid.font_dicts + parser->num_dict;
287 parser->root.cursor = base;
288 parser->root.limit = base +
size;
289 parser->root.error = CID_Err_Ok;
301 parser->root.cursor = cur;
304 if ( parser->root.cursor >= limit )
305 newlimit = limit - 1 - 17;
307 newlimit = parser->root.cursor - 17;
310 for ( ; cur < newlimit; cur++ )
313 ft_strncmp( (
char*)cur,
"%ADOBeginFontDict", 17 ) == 0 )
322 cur = parser->root.cursor;
328 if ( parser->root.cursor >= limit || parser->root.error )
332 if ( *cur ==
'/' && cur + 2 < limit )
338 len = parser->root.cursor - cur;
340 if ( len > 0 && len < 22 )
355 if ( cur[0] == name[0] &&
361 for ( n = 1; n <
len; n++ )
362 if ( cur[n] != name[n] )
371 if ( parser->root.error )
372 return parser->root.error;
381 cur = parser->root.cursor;
384 return parser->root.error;
407 for ( n = 0; n < cid->
num_dicts; n++, subr++ )
419 error = CID_Err_Syntax_Error;
424 if ( num_subrs + 1 > max_offsets )
429 if ( new_max <= max_offsets )
431 error = CID_Err_Syntax_Error;
438 max_offsets = new_max;
447 for ( count = 0; count <= num_subrs; count++ )
453 for ( count = 1; count <= num_subrs; count++ )
454 if ( offsets[count - 1] > offsets[count] )
459 data_len = offsets[num_subrs] - offsets[0];
470 for ( count = 1; count <= num_subrs; count++ )
475 len = offsets[
count] - offsets[count - 1];
482 for ( count = 0; count < num_subrs; count++ )
487 len = offsets[count + 1] - offsets[
count];
557 dlimit = d + data_len;
574 error = CID_Err_Syntax_Error;
586 else if ( *p >=
'a' && *p <=
'f' )
588 else if ( *p >=
'A' && *p <=
'F' )
589 val = (
FT_Byte)( *p -
'A' + 10 );
590 else if ( *p ==
' ' ||
600 else if ( *p ==
'>' )
607 error = CID_Err_Syntax_Error;
619 upper_nibble = (
FT_Byte)( 1 - upper_nibble );
646 parser = &loader.parser;
647 error =
cid_parser_new( parser, face->root.stream, face->root.memory,
654 parser->postscript_len );
658 if ( face_index < 0 )
661 if (
FT_NEW( face->cid_stream ) )
664 if ( parser->binary_length )
667 if (
FT_ALLOC( face->binary_data, parser->binary_length ) ||
669 parser->data_offset, face ) )
673 face->binary_data, parser->binary_length );
674 face->cid.data_offset = 0;
678 *face->cid_stream = *face->root.stream;
679 face->cid.data_offset = loader.parser.data_offset;
#define FT_ALLOC(ptr, size)
cid_parser_done(CID_Parser *parser)
FT_DivFix(FT_Long a, FT_Long b)
#define cid_parser_to_fixed(p, t)
GLuint const GLfloat * val
static const T1_FieldRec cid_field_records[]
cid_parser_new(CID_Parser *parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
#define FT_MEM_ZERO(dest, count)
static void cid_done_loader(CID_Loader *loader)
GLuint GLsizei const GLuint const GLintptr * offsets
EGLImageKHR EGLint * name
return Display return Display Bool Bool int d
PS_PrivateRec private_dict
FT_BEGIN_HEADER struct CID_Parser_ CID_Parser
#define cid_parser_to_int(p)
FT_Fixed expansion_factor
FT_BEGIN_HEADER typedef unsigned char FT_Bool
static void cid_init_loader(CID_Loader *loader, CID_Face face)
#define cid_parser_load_field_table(p, f, o)
#define FT_ERROR(varformat)
#define FT_PAD_CEIL(x, n)
PS_FontExtraRec font_extra
FT_Fixed expansion_factor
EGLContext EGLenum EGLClientBuffer buffer
struct T1_FieldRec_ * T1_Field
void(* t1_decrypt)(FT_Byte *buffer, FT_Offset length, FT_UShort seed)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define cid_parser_skip_spaces(p)
#define T1_FIELD_CALLBACK(_ident, _name, _dict)
struct PSAux_ServiceRec_ * PSAux_Service
struct FT_FaceRec_ * FT_Face
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_CALLBACK_DEF(x)
FT_BEGIN_HEADER struct CID_Loader_ CID_Loader
static FT_Error cid_load_keyword(CID_Face face, CID_Loader *loader, const T1_Field keyword)
cid_face_open(CID_Face face, FT_Int face_index)
parse_fd_array(CID_Face face, CID_Parser *parser)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
cid_parse_font_matrix(CID_Face face, CID_Parser *parser)
#define FT_NEW_ARRAY(ptr, count)
#define FT_STREAM_SEEK(position)
static FT_Error cid_hex_to_binary(FT_Byte *data, FT_Long data_len, FT_ULong offset, CID_Face face)
T1_Field_ParseFunc reader
#define cid_parser_load_field(p, f, o)
static FT_Error cid_read_subrs(CID_Face face)
T1_FieldLocation location
FT_Stream_OpenMemory(FT_Stream stream, const FT_Byte *base, FT_ULong size)
#define FT_FRAME_ENTER(size)
#define cid_parser_skip_PS_token(p)
#define FT_STREAM_READ(buffer, count)
cid_get_offset(FT_Byte **start, FT_Byte offsize)
parse_expansion_factor(CID_Face face, CID_Parser *parser)
static FT_Error cid_parse_dict(CID_Face face, CID_Loader *loader, FT_Byte *base, FT_Long size)
#define cid_parser_to_fixed_array(p, m, f, t)