692 {
698
700
703
704
706
712
718
719 if ( face_index < 0 )
721
724
725 if (
parser->binary_length )
726 {
727 if (
parser->binary_length >
728 face->root.stream->size -
parser->data_offset )
729 {
730 FT_TRACE0((
"cid_face_open: adjusting length of binary data\n"
731 " (from %d to %d bytes)\n",
733 face->root.stream->size -
parser->data_offset ));
734 parser->binary_length =
face->root.stream->size -
736 }
737
738
745
748 cid->data_offset = 0;
749 }
750 else
751 {
752 *
face->cid_stream = *
face->root.stream;
753 cid->data_offset = loader.parser.data_offset;
754 }
755
756
757
758 if (
cid->fd_bytes < 0 ||
cid->gd_bytes < 1 )
759 {
761 " Invalid `FDBytes' or `GDBytes' value\n" ));
764 }
765
766
767 if (
cid->fd_bytes > 4 ||
cid->gd_bytes > 4 )
768 {
770 " Values of `FDBytes' or `GDBytes' larger than 4\n"
771 " "
772 " are not supported\n" ));
775 }
776
777 binary_length =
face->cid_stream->size -
cid->data_offset;
779
780 for (
n = 0;
n <
cid->num_dicts;
n++ )
781 {
783
784
787 {
788 FT_ERROR((
"cid_parse_dict: Invalid `SDBytes' value\n" ));
791 }
792
794 {
796 " Values of `SDBytes' larger than 4"
797 " are not supported\n" ));
800 }
801
803 {
804 FT_ERROR((
"cid_parse_dict: Invalid `SubrMapOffset' value\n" ));
807 }
808
809
814 {
815 FT_ERROR((
"cid_parse_dict: Invalid `SubrCount' value\n" ));
818 }
819 }
820
821 if (
cid->cidmap_offset > binary_length )
822 {
823 FT_ERROR((
"cid_parse_dict: Invalid `CIDMapOffset' value\n" ));
826 }
827
828 if ( entry_len &&
830 ( binary_length -
cid->cidmap_offset ) / entry_len )
831 {
832 FT_ERROR((
"cid_parse_dict: Invalid `CIDCount' value\n" ));
835 }
836
837
839
843 }
static FT_Error cid_read_subrs(CID_Face face)
static void cid_init_loader(CID_Loader *loader, CID_Face face)
static void cid_done_loader(CID_Loader *loader)
static FT_Error cid_hex_to_binary(FT_Byte *data, FT_ULong data_len, FT_ULong offset, CID_Face face)
static FT_Error cid_parse_dict(CID_Face face, CID_Loader *loader, FT_Byte *base, FT_ULong size)
FT_BEGIN_HEADER struct CID_Loader_ CID_Loader
cid_parser_new(CID_Parser *parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
FT_BEGIN_HEADER struct CID_Parser_ CID_Parser
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_SET_ERROR(expression)
#define FT_ALLOC(ptr, size)
FT_Stream_OpenMemory(FT_Stream stream, const FT_Byte *base, FT_ULong size)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
GLenum GLuint GLint GLenum face
static char memory[1024 *256]