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
24#include FT_INTERNAL_POSTSCRIPT_AUX_H
38#define FT_COMPONENT cidload
50 for (
result = 0; offsize > 0; offsize-- )
118 FT_ERROR((
"cid_load_keyword: invalid use of `%s'\n",
124 dict =
cid->font_dicts +
parser->num_dict;
128 object = (
FT_Byte*)&dict->private_dict;
174 dict =
face->cid.font_dicts +
parser->num_dict;
183 FT_ERROR((
"cid_parse_font_matrix: not enough matrix elements\n" ));
188 (
double)
temp[0] / 65536 / 1000,
189 (
double)
temp[1] / 65536 / 1000,
190 (
double)
temp[2] / 65536 / 1000,
191 (
double)
temp[3] / 65536 / 1000,
192 (
double)
temp[4] / 65536 / 1000,
193 (
double)
temp[5] / 65536 / 1000 ));
197 if ( temp_scale == 0 )
199 FT_ERROR((
"cid_parse_font_matrix: invalid font matrix\n" ));
204 if ( temp_scale != 0x10000L )
214 temp[3] =
temp[3] < 0 ? -0x10000L : 0x10000L;
224 FT_ERROR((
"t1_parse_font_matrix: invalid font matrix\n" ));
253 FT_ERROR((
"parse_fd_array: invalid number of dictionaries\n" ));
277 FT_TRACE0((
"parse_fd_array: adjusting FDArray size"
278 " (from %d to %d)\n",
284 if ( !
cid->font_dicts )
292 cid->num_dicts = num_dicts;
295 for (
n = 0;
n <
cid->num_dicts;
n++ )
305 0.039625 * 0x10000L * 1000 );
327 dict =
face->cid.font_dicts +
parser->num_dict;
347#ifdef FT_DEBUG_LEVEL_TRACE
413 newlimit =
limit - 1 - 17;
415 newlimit =
parser->root.cursor - 17;
418 for ( ;
cur < newlimit;
cur++ )
425 if (
face->cid.num_dicts > 0 )
429#ifdef FT_DEBUG_LEVEL_TRACE
457 if (
len > 0 &&
len < 22 )
478 for (
n = 1;
n <
len;
n++ )
501 if ( !
face->cid.num_dicts )
503 FT_ERROR((
"cid_parse_dict: No font dictionary found\n" ));
504 return FT_THROW( Invalid_File_Format );
531 for (
n = 0;
n <
cid->num_dicts;
n++, subr++ )
544 if ( num_subrs + 1 > max_offsets )
549 if ( new_max <= max_offsets )
558 max_offsets = new_max;
576 FT_ERROR((
"cid_read_subrs: offsets are not ordered\n" ));
583 FT_ERROR((
"cid_read_subrs: too large `subrs' offsets\n" ));
633 for (
n = 0;
n <
cid->num_dicts;
n++ )
635 if (
face->subrs[
n].code )
688 dlimit =
d + data_len;
717 else if ( *
p >=
'a' && *
p <=
'f' )
719 else if ( *
p >=
'A' && *
p <=
'F' )
721 else if ( *
p ==
' ' ||
731 else if ( *
p ==
'>' )
750 upper_nibble = (
FT_Byte)( 1 - upper_nibble );
795 if ( face_index < 0 )
801 if (
parser->binary_length )
803 if (
parser->binary_length >
804 face->root.stream->size -
parser->data_offset )
806 FT_TRACE0((
"cid_face_open: adjusting length of binary data\n"
807 " (from %d to %d bytes)\n",
809 face->root.stream->size -
parser->data_offset ));
810 parser->binary_length =
face->root.stream->size -
824 cid->data_offset = 0;
828 *
face->cid_stream = *
face->root.stream;
829 cid->data_offset = loader.parser.data_offset;
834 if (
cid->fd_bytes < 0 ||
cid->gd_bytes < 1 )
837 " Invalid `FDBytes' or `GDBytes' value\n" ));
843 if (
cid->fd_bytes > 4 ||
cid->gd_bytes > 4 )
846 " Values of `FDBytes' or `GDBytes' larger than 4\n"
848 " are not supported\n" ));
853 binary_length =
face->cid_stream->size -
cid->data_offset;
856 for (
n = 0;
n <
cid->num_dicts;
n++ )
866 " setting unlikely BlueShift value %d to default (7)\n",
875 " setting unlikely BlueFuzz value %d to default (1)\n",
883 FT_ERROR((
"cid_face_open: Invalid `SDBytes' value\n" ));
891 " Values of `SDBytes' larger than 4"
892 " are not supported\n" ));
899 FT_ERROR((
"cid_face_open: Invalid `SubrMapOffset' value\n" ));
910 FT_ERROR((
"cid_face_open: Invalid `SubrCount' value\n" ));
916 if (
cid->cidmap_offset > binary_length )
918 FT_ERROR((
"cid_face_open: Invalid `CIDMapOffset' value\n" ));
925 ( binary_length -
cid->cidmap_offset ) / entry_len )
927 FT_ERROR((
"cid_face_open: Invalid `CIDCount' value\n" ));
parse_fd_array(CID_Face face, CID_Parser *parser)
static FT_Error cid_read_subrs(CID_Face face)
static void cid_init_loader(CID_Loader *loader, CID_Face face)
cid_get_offset(FT_Byte **start, FT_Byte offsize)
parse_font_name(CID_Face face, CID_Parser *parser)
static void cid_done_loader(CID_Loader *loader)
static FT_Error cid_load_keyword(CID_Face face, CID_Loader *loader, const T1_Field keyword)
parse_expansion_factor(CID_Face face, CID_Parser *parser)
cid_face_open(CID_Face face, FT_Int face_index)
static FT_Error cid_hex_to_binary(FT_Byte *data, FT_ULong data_len, FT_ULong offset, CID_Face face)
static const T1_FieldRec cid_field_records[]
static FT_Error cid_parse_dict(CID_Face face, CID_Loader *loader, FT_Byte *base, FT_ULong size)
cid_parse_font_matrix(CID_Face face, CID_Parser *parser)
FT_BEGIN_HEADER struct CID_Loader_ CID_Loader
cid_parser_new(CID_Parser *parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
cid_parser_done(CID_Parser *parser)
#define cid_parser_skip_PS_token(p)
FT_BEGIN_HEADER struct CID_Parser_ CID_Parser
#define cid_parser_to_fixed_array(p, m, f, t)
#define cid_parser_load_field(p, f, o)
#define cid_parser_load_field_table(p, f, o)
#define cid_parser_to_int(p)
#define cid_parser_skip_spaces(p)
#define cid_parser_to_fixed(p, t)
#define cid_parser_to_token(p, t)
FT_DivFix(FT_Long a, FT_Long b)
struct FT_FaceRec_ * FT_Face
FT_Matrix_Check(const FT_Matrix *matrix)
#define FT_CALLBACK_DEF(x)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE2(varformat)
#define FT_TRACE4(varformat)
#define FT_NEW_ARRAY(ptr, count)
#define FT_SET_ERROR(expression)
#define FT_ALLOC(ptr, size)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_PAD_CEIL(x, n)
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
#define FT_STREAM_READ(buffer, count)
FT_Stream_OpenMemory(FT_Stream stream, const FT_Byte *base, FT_ULong size)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
static const FxOffsetAndName offsets[]
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
static char memory[1024 *256]
struct PSAux_ServiceRec_ * PSAux_Service
@ T1_FIELD_TYPE_INTEGER_ARRAY
@ T1_FIELD_TYPE_FIXED_ARRAY
#define T1_FIELD_CALLBACK(_ident, _name, _dict)
@ T1_FIELD_LOCATION_FONT_EXTRA
@ T1_FIELD_LOCATION_CID_INFO
@ T1_FIELD_LOCATION_PRIVATE
@ T1_FIELD_LOCATION_FONT_INFO
struct T1_FieldRec_ * T1_Field
PS_PrivateRec private_dict
FT_Fixed expansion_factor
void(* t1_decrypt)(FT_Byte *buffer, FT_Offset length, FT_UShort seed)
FT_Fixed expansion_factor