* src/cff/cffobjs.c: small fix to allow OpenType fonts to support Adobe charmaps when needed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
diff --git a/ChangeLog b/ChangeLog
index 467a5ad..8a732fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2002-07-10 David Turner <david@freetype.org>
+ * src/cff/cffobjs.c: small fix to allow OpenType fonts to support Adobe
+ charmaps when needed.
+
* src/cff/cffcmap.c, src/cff/cffcmap.h, Jamfile, rules.mk: new files added
to support charmaps for CFF fonts
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 5d809e1..faca759 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -446,81 +446,80 @@
flags |= FT_STYLE_FLAG_BOLD;
root->style_flags = flags;
+ }
- /*******************************************************************/
- /* */
- /* Compute char maps. */
- /* */
+ /*******************************************************************/
+ /* */
+ /* Compute char maps. */
+ /* */
+
+ /* try to synthetize a Unicode charmap if there is none available */
+ /* already. If an OpenType font contains a Unicode "cmap", we */
+ /* will use it, wathever be in the CFF part of the file.. */
+ {
+ FT_CharMapRec cmaprec;
+ FT_CharMap cmap;
+ FT_UInt nn;
+ CFF_Encoding encoding = &cff->encoding;
- /* try to synthetize a Unicode charmap if there is none available */
- /* already. If an OpenType font contains a Unicode "cmap", we */
- /* will use it, wathever be in the CFF part of the file.. */
+ for ( nn = 0; nn < (FT_UInt) root->num_charmaps; nn++ )
{
- FT_CharMapRec cmaprec;
- FT_CharMap cmap;
- FT_UInt nn;
- CFF_Encoding encoding = &cff->encoding;
+ cmap = root->charmaps[nn];
- for ( nn = 0; nn < (FT_UInt) root->num_charmaps; nn++ )
- {
- cmap = root->charmaps[nn];
+ /* Windows Unicode (3,1) ? */
+ if ( cmap->platform_id == 3 && cmap->encoding_id == 1 )
+ goto Skip_Unicode;
- /* Windows Unicode (3,1) ? */
- if ( cmap->platform_id == 3 && cmap->platform_id == 1 )
- goto Skip_Unicode;
-
- /* Deprecated Unicode platform id ?? */
- if ( cmap->platform_id == 0 )
- break; /* Standard Unicode (deprecated) */
- }
-
- /* we didn't find a Unicode charmap, synthetize one */
+ /* Deprecated Unicode platform id ?? */
+ if ( cmap->platform_id == 0 )
+ goto Skip_Unicode; /* Standard Unicode (deprecated) */
+ }
+
+ /* we didn't find a Unicode charmap, synthetize one */
#ifdef FT_CONFIG_OPTION_USE_CMAPS
- cmaprec.face = root;
- cmaprec.platform_id = 3;
- cmaprec.encoding_id = 1;
- cmaprec.encoding = ft_encoding_unicode;
+ cmaprec.face = root;
+ cmaprec.platform_id = 3;
+ cmaprec.encoding_id = 1;
+ cmaprec.encoding = ft_encoding_unicode;
+
+ FT_CMap_New( &cff_cmap_unicode_class_rec, NULL, &cmaprec, NULL );
- FT_CMap_New( &cff_cmap_unicode_class_rec, NULL, &cmaprec, NULL );
+ Skip_Unicode:
+ if ( encoding->count > 0 )
+ {
+ FT_CMap_Class clazz;
+
+ cmaprec.face = root;
+ cmaprec.platform_id = 7; /* Adobe platform id */
- Skip_Unicode:
- if ( encoding->count > 0 )
+ switch( encoding->offset )
{
- FT_CMap_Class clazz;
+ case 0:
+ cmaprec.encoding_id = 0;
+ cmaprec.encoding = ft_encoding_adobe_standard;
+ clazz = &cff_cmap_encoding_class_rec;
+ break;
- cmaprec.face = root;
- cmaprec.platform_id = 7; /* Adobe platform id */
-
- switch( encoding->offset )
- {
- case 0:
- cmaprec.encoding_id = 0;
- cmaprec.encoding = ft_encoding_adobe_standard;
- clazz = &cff_cmap_encoding_class_rec;
- break;
-
- case 1:
- cmaprec.encoding_id = 1;
- cmaprec.encoding = ft_encoding_adobe_expert;
- clazz = &cff_cmap_encoding_class_rec;
- break;
-
- default:
- cmaprec.encoding_id = 3;
- cmaprec.encoding = ft_encoding_adobe_custom;
- clazz = &cff_cmap_encoding_class_rec;
- }
+ case 1:
+ cmaprec.encoding_id = 1;
+ cmaprec.encoding = ft_encoding_adobe_expert;
+ clazz = &cff_cmap_encoding_class_rec;
+ break;
- FT_CMap_New( clazz, NULL, &cmaprec, NULL );
+ default:
+ cmaprec.encoding_id = 3;
+ cmaprec.encoding = ft_encoding_adobe_custom;
+ clazz = &cff_cmap_encoding_class_rec;
+ }
+
+ FT_CMap_New( clazz, NULL, &cmaprec, NULL );
#else /* !FT_CONFIG_OPTION_USE_CMAPS */
/* unimplemented !! */
#endif /* !FT_CONFIG_OPTION_USE_CMAPS */
-
- }
}
}