1 /***************************************************************************/
5 /* OpenType objects manager (body). */
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
17 /***************************************************************************/
21 #include FT_INTERNAL_DEBUG_H
22 #include FT_INTERNAL_CALC_H
23 #include FT_INTERNAL_STREAM_H
25 #include FT_TRUETYPE_IDS_H
26 #include FT_TRUETYPE_TAGS_H
27 #include FT_INTERNAL_SFNT_H
35 /*************************************************************************/
37 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
38 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
39 /* messages during execution. */
42 #define FT_COMPONENT trace_cffobjs
45 /*************************************************************************/
49 /* Note that we store the global hints in the size's `internal' root */
52 /*************************************************************************/
55 static PSH_Globals_Funcs
56 cff_size_get_globals_funcs( CFF_Size size )
58 CFF_Face face = (CFF_Face)size->root.face;
59 CFF_Font font = (CFF_Font)face->extra.data;
60 PSHinter_Service pshinter = font->pshinter;
64 module = FT_Get_Module( size->root.face->driver->root.library,
66 return ( module && pshinter && pshinter->get_globals_funcs )
67 ? pshinter->get_globals_funcs( module )
73 cff_size_done( FT_Size cffsize ) /* CFF_Size */
75 CFF_Size size = (CFF_Size)cffsize;
76 CFF_Face face = (CFF_Face)size->root.face;
77 CFF_Font font = (CFF_Font)face->extra.data;
78 CFF_Internal internal = (CFF_Internal)cffsize->internal;
83 PSH_Globals_Funcs funcs;
86 funcs = cff_size_get_globals_funcs( size );
92 funcs->destroy( internal->topfont );
94 for ( i = font->num_subfonts; i > 0; i-- )
95 funcs->destroy( internal->subfonts[i - 1] );
98 /* `internal' is freed by destroy_size (in ftobjs.c) */
103 /* CFF and Type 1 private dictionaries have slightly different */
104 /* structures; we need to synthesize a Type 1 dictionary on the fly */
107 cff_make_private_dict( CFF_SubFont subfont,
110 CFF_Private cpriv = &subfont->private_dict;
114 FT_MEM_ZERO( priv, sizeof ( *priv ) );
116 count = priv->num_blue_values = cpriv->num_blue_values;
117 for ( n = 0; n < count; n++ )
118 priv->blue_values[n] = (FT_Short)cpriv->blue_values[n];
120 count = priv->num_other_blues = cpriv->num_other_blues;
121 for ( n = 0; n < count; n++ )
122 priv->other_blues[n] = (FT_Short)cpriv->other_blues[n];
124 count = priv->num_family_blues = cpriv->num_family_blues;
125 for ( n = 0; n < count; n++ )
126 priv->family_blues[n] = (FT_Short)cpriv->family_blues[n];
128 count = priv->num_family_other_blues = cpriv->num_family_other_blues;
129 for ( n = 0; n < count; n++ )
130 priv->family_other_blues[n] = (FT_Short)cpriv->family_other_blues[n];
132 priv->blue_scale = cpriv->blue_scale;
133 priv->blue_shift = (FT_Int)cpriv->blue_shift;
134 priv->blue_fuzz = (FT_Int)cpriv->blue_fuzz;
136 priv->standard_width[0] = (FT_UShort)cpriv->standard_width;
137 priv->standard_height[0] = (FT_UShort)cpriv->standard_height;
139 count = priv->num_snap_widths = cpriv->num_snap_widths;
140 for ( n = 0; n < count; n++ )
141 priv->snap_widths[n] = (FT_Short)cpriv->snap_widths[n];
143 count = priv->num_snap_heights = cpriv->num_snap_heights;
144 for ( n = 0; n < count; n++ )
145 priv->snap_heights[n] = (FT_Short)cpriv->snap_heights[n];
147 priv->force_bold = cpriv->force_bold;
148 priv->language_group = cpriv->language_group;
149 priv->lenIV = cpriv->lenIV;
153 FT_LOCAL_DEF( FT_Error )
154 cff_size_init( FT_Size cffsize ) /* CFF_Size */
156 CFF_Size size = (CFF_Size)cffsize;
157 FT_Error error = CFF_Err_Ok;
158 PSH_Globals_Funcs funcs = cff_size_get_globals_funcs( size );
163 CFF_Face face = (CFF_Face)cffsize->face;
164 CFF_Font font = (CFF_Font)face->extra.data;
165 CFF_Internal internal;
168 FT_Memory memory = cffsize->face->memory;
173 if ( FT_NEW( internal ) )
176 cff_make_private_dict( &font->top_font, &priv );
177 error = funcs->create( cffsize->face->memory, &priv,
178 &internal->topfont );
182 for ( i = font->num_subfonts; i > 0; i-- )
184 CFF_SubFont sub = font->subfonts[i - 1];
187 cff_make_private_dict( sub, &priv );
188 error = funcs->create( cffsize->face->memory, &priv,
189 &internal->subfonts[i - 1] );
194 cffsize->internal = (FT_Size_Internal)(void*)internal;
197 size->strike_index = 0xFFFFFFFFUL;
204 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
206 FT_LOCAL_DEF( FT_Error )
207 cff_size_select( FT_Size size,
208 FT_ULong strike_index )
210 CFF_Size cffsize = (CFF_Size)size;
211 PSH_Globals_Funcs funcs;
214 cffsize->strike_index = strike_index;
216 FT_Select_Metrics( size->face, strike_index );
218 funcs = cff_size_get_globals_funcs( cffsize );
222 CFF_Face face = (CFF_Face)size->face;
223 CFF_Font font = (CFF_Font)face->extra.data;
224 CFF_Internal internal = (CFF_Internal)size->internal;
226 FT_ULong top_upm = font->top_font.font_dict.units_per_em;
230 funcs->set_scale( internal->topfont,
231 size->metrics.x_scale, size->metrics.y_scale,
234 for ( i = font->num_subfonts; i > 0; i-- )
236 CFF_SubFont sub = font->subfonts[i - 1];
237 FT_ULong sub_upm = sub->font_dict.units_per_em;
238 FT_Pos x_scale, y_scale;
241 if ( top_upm != sub_upm )
243 x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );
244 y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );
248 x_scale = size->metrics.x_scale;
249 y_scale = size->metrics.y_scale;
252 funcs->set_scale( internal->subfonts[i - 1],
253 x_scale, y_scale, 0, 0 );
260 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
263 FT_LOCAL_DEF( FT_Error )
264 cff_size_request( FT_Size size,
265 FT_Size_Request req )
267 CFF_Size cffsize = (CFF_Size)size;
268 PSH_Globals_Funcs funcs;
271 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
273 if ( FT_HAS_FIXED_SIZES( size->face ) )
275 CFF_Face cffface = (CFF_Face)size->face;
276 SFNT_Service sfnt = (SFNT_Service)cffface->sfnt;
277 FT_ULong strike_index;
280 if ( sfnt->set_sbit_strike( cffface, req, &strike_index ) )
281 cffsize->strike_index = 0xFFFFFFFFUL;
283 return cff_size_select( size, strike_index );
286 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
288 FT_Request_Metrics( size->face, req );
290 funcs = cff_size_get_globals_funcs( cffsize );
294 CFF_Face cffface = (CFF_Face)size->face;
295 CFF_Font font = (CFF_Font)cffface->extra.data;
296 CFF_Internal internal = (CFF_Internal)size->internal;
298 FT_ULong top_upm = font->top_font.font_dict.units_per_em;
302 funcs->set_scale( internal->topfont,
303 size->metrics.x_scale, size->metrics.y_scale,
306 for ( i = font->num_subfonts; i > 0; i-- )
308 CFF_SubFont sub = font->subfonts[i - 1];
309 FT_ULong sub_upm = sub->font_dict.units_per_em;
310 FT_Pos x_scale, y_scale;
313 if ( top_upm != sub_upm )
315 x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );
316 y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );
320 x_scale = size->metrics.x_scale;
321 y_scale = size->metrics.y_scale;
324 funcs->set_scale( internal->subfonts[i - 1],
325 x_scale, y_scale, 0, 0 );
333 /*************************************************************************/
337 /*************************************************************************/
340 cff_slot_done( FT_GlyphSlot slot )
342 slot->internal->glyph_hints = 0;
346 FT_LOCAL_DEF( FT_Error )
347 cff_slot_init( FT_GlyphSlot slot )
349 CFF_Face face = (CFF_Face)slot->face;
350 CFF_Font font = (CFF_Font)face->extra.data;
351 PSHinter_Service pshinter = font->pshinter;
359 module = FT_Get_Module( slot->face->driver->root.library,
363 T2_Hints_Funcs funcs;
366 funcs = pshinter->get_t2_funcs( module );
367 slot->internal->glyph_hints = (void*)funcs;
375 /*************************************************************************/
379 /*************************************************************************/
382 cff_strcpy( FT_Memory memory,
383 const FT_String* source )
389 (void)FT_STRDUP( result, source );
397 /* Strip all subset prefixes of the form `ABCDEF+'. Usually, there */
398 /* is only one, but font names like `APCOOG+JFABTD+FuturaBQ-Bold' */
399 /* have been seen in the wild. */
402 remove_subset_prefix( FT_String* name )
405 FT_Int32 length = strlen( name ) + 1;
406 FT_Bool continue_search = 1;
409 while ( continue_search )
411 if ( length >= 7 && name[6] == '+' )
413 for ( idx = 0; idx < 6; idx++ )
415 /* ASCII uppercase letters */
416 if ( !( 'A' <= name[idx] && name[idx] <= 'Z' ) )
420 if ( continue_search )
422 for ( idx = 7; idx < length; idx++ )
423 name[idx - 7] = name[idx];
432 FT_LOCAL_DEF( FT_Error )
433 cff_face_init( FT_Stream stream,
434 FT_Face cffface, /* CFF_Face */
437 FT_Parameter* params )
439 CFF_Face face = (CFF_Face)cffface;
442 FT_Service_PsCMaps psnames;
443 PSHinter_Service pshinter;
444 FT_Bool pure_cff = 1;
445 FT_Bool sfnt_format = 0;
446 FT_Library library = cffface->driver->root.library;
449 sfnt = (SFNT_Service)FT_Get_Module_Interface(
454 FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
456 pshinter = (PSHinter_Service)FT_Get_Module_Interface(
457 library, "pshinter" );
459 /* create input stream from resource */
460 if ( FT_STREAM_SEEK( 0 ) )
463 /* check whether we have a valid OpenType file */
464 error = sfnt->init_face( stream, face, face_index, num_params, params );
467 if ( face->format_tag != TTAG_OTTO ) /* `OTTO'; OpenType/CFF font */
469 FT_TRACE2(( "[not a valid OpenType/CFF font]\n" ));
473 /* if we are performing a simple font format check, exit immediately */
474 if ( face_index < 0 )
477 /* UNDOCUMENTED! A CFF in an SFNT can have only a single font. */
478 if ( face_index > 0 )
480 FT_ERROR(( "cff_face_init: invalid face index\n" ));
481 error = CFF_Err_Invalid_Argument;
487 /* now, the font can be either an OpenType/CFF font, or an SVG CEF */
488 /* font; in the latter case it doesn't have a `head' table */
489 error = face->goto_table( face, TTAG_head, stream, 0 );
494 /* load font directory */
495 error = sfnt->load_face( stream, face, 0, num_params, params );
501 /* load the `cmap' table explicitly */
502 error = sfnt->load_cmap( face, stream );
506 /* XXX: we don't load the GPOS table, as OpenType Layout */
507 /* support will be added later to a layout library on top of */
511 /* now load the CFF part of the file */
512 error = face->goto_table( face, TTAG_CFF, stream, 0 );
518 /* rewind to start of file; we are going to load a pure-CFF font */
519 if ( FT_STREAM_SEEK( 0 ) )
524 /* now load and parse the CFF table in the file */
527 CFF_FontRecDict dict;
528 FT_Memory memory = cffface->memory;
536 face->extra.data = cff;
537 error = cff_font_load( library, stream, face_index, cff, pure_cff );
541 cff->pshinter = pshinter;
542 cff->psnames = psnames;
544 cffface->face_index = face_index;
546 /* Complement the root flags with some interesting information. */
547 /* Note that this is only necessary for pure CFF and CEF fonts; */
548 /* SFNT based fonts use the `name' table instead. */
550 cffface->num_glyphs = cff->num_glyphs;
552 dict = &cff->top_font.font_dict;
554 /* we need the `PSNames' module for CFF and CEF formats */
555 /* which aren't CID-keyed */
556 if ( dict->cid_registry == 0xFFFFU && !psnames )
558 FT_ERROR(( "cff_face_init:"
559 " cannot open CFF & CEF fonts\n"
561 " without the `PSNames' module\n" ));
565 if ( !dict->units_per_em )
566 dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
568 /* Normalize the font matrix so that `matrix->xx' is 1; the */
569 /* scaling is done with `units_per_em' then (at this point, */
570 /* it already contains the scaling factor, but without */
571 /* normalization of the matrix). */
573 /* Note that the offsets must be expressed in integer font */
577 FT_Matrix* matrix = &dict->font_matrix;
578 FT_Vector* offset = &dict->font_offset;
579 FT_ULong* upm = &dict->units_per_em;
580 FT_Fixed temp = FT_ABS( matrix->yy );
583 if ( temp != 0x10000L )
585 *upm = FT_DivFix( *upm, temp );
587 matrix->xx = FT_DivFix( matrix->xx, temp );
588 matrix->yx = FT_DivFix( matrix->yx, temp );
589 matrix->xy = FT_DivFix( matrix->xy, temp );
590 matrix->yy = FT_DivFix( matrix->yy, temp );
591 offset->x = FT_DivFix( offset->x, temp );
592 offset->y = FT_DivFix( offset->y, temp );
599 for ( i = cff->num_subfonts; i > 0; i-- )
601 CFF_FontRecDict sub = &cff->subfonts[i - 1]->font_dict;
602 CFF_FontRecDict top = &cff->top_font.font_dict;
610 if ( sub->units_per_em )
615 if ( top->units_per_em > 1 && sub->units_per_em > 1 )
616 scaling = FT_MIN( top->units_per_em, sub->units_per_em );
620 FT_Matrix_Multiply_Scaled( &top->font_matrix,
623 FT_Vector_Transform_Scaled( &sub->font_offset,
627 sub->units_per_em = FT_MulDiv( sub->units_per_em,
633 sub->font_matrix = top->font_matrix;
634 sub->font_offset = top->font_offset;
636 sub->units_per_em = top->units_per_em;
639 matrix = &sub->font_matrix;
640 offset = &sub->font_offset;
641 upm = &sub->units_per_em;
642 temp = FT_ABS( matrix->yy );
644 if ( temp != 0x10000L )
646 *upm = FT_DivFix( *upm, temp );
648 /* if *upm is larger than 100*1000 we divide by 1000 -- */
649 /* this can happen if e.g. there is no top-font FontMatrix */
650 /* and the subfont FontMatrix already contains the complete */
651 /* scaling for the subfont (see section 5.11 of the PLRM) */
653 /* 100 is a heuristic value */
655 if ( *upm > 100L * 1000L )
656 *upm = ( *upm + 500 ) / 1000;
658 matrix->xx = FT_DivFix( matrix->xx, temp );
659 matrix->yx = FT_DivFix( matrix->yx, temp );
660 matrix->xy = FT_DivFix( matrix->xy, temp );
661 matrix->yy = FT_DivFix( matrix->yy, temp );
662 offset->x = FT_DivFix( offset->x, temp );
663 offset->y = FT_DivFix( offset->y, temp );
672 char* style_name = NULL;
675 /* set up num_faces */
676 cffface->num_faces = cff->num_faces;
678 /* compute number of glyphs */
679 if ( dict->cid_registry != 0xFFFFU )
680 cffface->num_glyphs = cff->charset.max_cid + 1;
682 cffface->num_glyphs = cff->charstrings_index.count;
684 /* set global bbox, as well as EM size */
685 cffface->bbox.xMin = dict->font_bbox.xMin >> 16;
686 cffface->bbox.yMin = dict->font_bbox.yMin >> 16;
687 /* no `U' suffix here to 0xFFFF! */
688 cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFF ) >> 16;
689 cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFF ) >> 16;
691 cffface->units_per_EM = (FT_UShort)( dict->units_per_em );
693 cffface->ascender = (FT_Short)( cffface->bbox.yMax );
694 cffface->descender = (FT_Short)( cffface->bbox.yMin );
696 cffface->height = (FT_Short)( ( cffface->units_per_EM * 12 ) / 10 );
697 if ( cffface->height < cffface->ascender - cffface->descender )
698 cffface->height = (FT_Short)( cffface->ascender - cffface->descender );
700 cffface->underline_position =
701 (FT_Short)( dict->underline_position >> 16 );
702 cffface->underline_thickness =
703 (FT_Short)( dict->underline_thickness >> 16 );
705 /* retrieve font family & style name */
706 cffface->family_name = cff_index_get_name( cff, face_index );
707 if ( cffface->family_name )
709 char* full = cff_index_get_sid_string( cff,
712 char* family = cffface->family_name;
713 char* family_name = NULL;
716 remove_subset_prefix( cffface->family_name );
718 if ( dict->family_name )
720 family_name = cff_index_get_sid_string( cff,
723 family = family_name;
726 /* We try to extract the style name from the full name. */
727 /* We need to ignore spaces and dashes during the search. */
728 if ( full && family )
732 /* skip common characters at the start of both strings */
733 if ( *fullp == *family )
740 /* ignore spaces and dashes in full name during comparison */
741 if ( *fullp == ' ' || *fullp == '-' )
747 /* ignore spaces and dashes in family name during comparison */
748 if ( *family == ' ' || *family == '-' )
754 if ( !*family && *fullp )
756 /* The full name begins with the same characters as the */
757 /* family name, with spaces and dashes removed. In this */
758 /* case, the remaining string in `fullp' will be used as */
759 /* the style name. */
760 style_name = cff_strcpy( memory, fullp );
768 char *cid_font_name =
769 cff_index_get_sid_string( cff,
770 dict->cid_font_name );
773 /* do we have a `/FontName' for a CID-keyed font? */
775 cffface->family_name = cff_strcpy( memory, cid_font_name );
779 cffface->style_name = style_name;
781 /* assume "Regular" style if we don't know better */
782 cffface->style_name = cff_strcpy( memory, (char *)"Regular" );
784 /*******************************************************************/
786 /* Compute face flags. */
788 flags = (FT_UInt32)( FT_FACE_FLAG_SCALABLE | /* scalable outlines */
789 FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
790 FT_FACE_FLAG_HINTER ); /* has native hinter */
793 flags |= (FT_UInt32)FT_FACE_FLAG_SFNT;
795 /* fixed width font? */
796 if ( dict->is_fixed_pitch )
797 flags |= (FT_UInt32)FT_FACE_FLAG_FIXED_WIDTH;
799 /* XXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */
801 /* kerning available? */
802 if ( face->kern_pairs )
803 flags |= (FT_UInt32)FT_FACE_FLAG_KERNING;
806 cffface->face_flags = flags;
808 /*******************************************************************/
810 /* Compute style flags. */
814 if ( dict->italic_angle )
815 flags |= FT_STYLE_FLAG_ITALIC;
818 char *weight = cff_index_get_sid_string( cff,
823 if ( !ft_strcmp( weight, "Bold" ) ||
824 !ft_strcmp( weight, "Black" ) )
825 flags |= FT_STYLE_FLAG_BOLD;
829 if ( !(flags & FT_STYLE_FLAG_BOLD) && cffface->style_name )
830 if ( !ft_strncmp( cffface->style_name, "Bold", 4 ) ||
831 !ft_strncmp( cffface->style_name, "Black", 5 ) )
832 flags |= FT_STYLE_FLAG_BOLD;
834 cffface->style_flags = flags;
838 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
839 /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
840 /* has unset this flag because of the 3.0 `post' table. */
841 if ( dict->cid_registry == 0xFFFFU )
842 cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
845 if ( dict->cid_registry != 0xFFFFU && pure_cff )
846 cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
849 /*******************************************************************/
851 /* Compute char maps. */
854 /* Try to synthesize a Unicode charmap if there is none available */
855 /* already. If an OpenType font contains a Unicode "cmap", we */
856 /* will use it, whatever be in the CFF part of the file. */
858 FT_CharMapRec cmaprec;
861 CFF_Encoding encoding = &cff->encoding;
864 for ( nn = 0; nn < (FT_UInt)cffface->num_charmaps; nn++ )
866 cmap = cffface->charmaps[nn];
868 /* Windows Unicode? */
869 if ( cmap->platform_id == TT_PLATFORM_MICROSOFT &&
870 cmap->encoding_id == TT_MS_ID_UNICODE_CS )
873 /* Apple Unicode platform id? */
874 if ( cmap->platform_id == TT_PLATFORM_APPLE_UNICODE )
875 goto Skip_Unicode; /* Apple Unicode */
878 /* since CID-keyed fonts don't contain glyph names, we can't */
879 /* construct a cmap */
880 if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
883 #ifdef FT_MAX_CHARMAP_CACHEABLE
884 if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE )
886 FT_ERROR(( "cff_face_init: no Unicode cmap is found, "
887 "and too many subtables (%d) to add synthesized cmap\n",
893 /* we didn't find a Unicode charmap -- synthesize one */
894 cmaprec.face = cffface;
895 cmaprec.platform_id = TT_PLATFORM_MICROSOFT;
896 cmaprec.encoding_id = TT_MS_ID_UNICODE_CS;
897 cmaprec.encoding = FT_ENCODING_UNICODE;
899 nn = (FT_UInt)cffface->num_charmaps;
901 error = FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
903 if ( error && FT_Err_No_Unicode_Glyph_Name != error )
907 /* if no Unicode charmap was previously selected, select this one */
908 if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps )
909 cffface->charmap = cffface->charmaps[nn];
912 #ifdef FT_MAX_CHARMAP_CACHEABLE
913 if ( nn > FT_MAX_CHARMAP_CACHEABLE )
915 FT_ERROR(( "cff_face_init: Unicode cmap is found, "
916 "but too many preceding subtables (%d) to access\n",
921 if ( encoding->count > 0 )
926 cmaprec.face = cffface;
927 cmaprec.platform_id = TT_PLATFORM_ADOBE; /* Adobe platform id */
929 if ( encoding->offset == 0 )
931 cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
932 cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
933 clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
935 else if ( encoding->offset == 1 )
937 cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
938 cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
939 clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
943 cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
944 cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
945 clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
948 error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
957 error = CFF_Err_Unknown_File_Format;
963 cff_face_done( FT_Face cffface ) /* CFF_Face */
965 CFF_Face face = (CFF_Face)cffface;
973 memory = cffface->memory;
974 sfnt = (SFNT_Service)face->sfnt;
977 sfnt->done_face( face );
980 CFF_Font cff = (CFF_Font)face->extra.data;
985 cff_font_done( cff );
986 FT_FREE( face->extra.data );
992 FT_LOCAL_DEF( FT_Error )
993 cff_driver_init( FT_Module module )
1001 FT_LOCAL_DEF( void )
1002 cff_driver_done( FT_Module module )
1004 FT_UNUSED( module );