* src/psaux/t1cmap.c (t1_cmap_custom_char_index, t1_cmap_custom_char_next): Fix index computation -- indices start with 0 and not with cmap->first. Provide default charmaps. * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c (PCF_Face_Init), src/pfr/pfrobjs.c (pfr_face_init), src/type1/t1objs (T1_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Implement it.
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 156 157 158 159 160 161 162 163 164 165 166 167
diff --git a/ChangeLog b/ChangeLog
index 5cd786b..9443aaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-06-18 Detlef Würkner <TetiSoft@apg.lahn.de>
+
+ * src/psaux/t1cmap.c (t1_cmap_custom_char_index,
+ t1_cmap_custom_char_next): Fix index computation -- indices start
+ with 0 and not with cmap->first.
+
+ Provide default charmaps.
+
+ * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
+ (PCF_Face_Init), src/pfr/pfrobjs.c (pfr_face_init),
+ src/type1/t1objs (T1_Face_Init), src/winfonts/winfnt.c
+ (FNT_Face_Init): Implement it.
+
2002-06-17 Sven Neumann <sven@gimp.org>
* src/pfr/pfrobjs.c (pfr_face_init): Fix typo.
@@ -43,7 +56,7 @@
2002-06-14 Detlef Würkner <TetiSoft@apg.lahn.de>
- Add new cmap support to BDF driver
+ Add new cmap support to BDF driver.
* src/bdf/bdfdrivr.c (BDF_CMapRec) [FT_CONFIG_OPTION_USE_CMAPS]:
New structure.
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 4a97e3d..e0e894b 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -448,6 +448,10 @@ THE SOFTWARE.
}
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
+
+ /* Select default charmap */
+ if (root->num_charmaps)
+ root->charmap = root->charmaps[0];
}
#else /* !FT_CONFIG_OPTION_USE_CMAPS */
@@ -481,11 +485,15 @@ THE SOFTWARE.
charmap.face = FT_FACE( face );
- charmap.encoding = ft_encoding_none;
- charmap.platform_id = 0;
+ charmap.encoding = ft_encoding_adobe_standard;
+ charmap.platform_id = 7;
charmap.encoding_id = 0;
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
+
+ /* Select default charmap */
+ if (root->num_charmaps)
+ root->charmap = root->charmaps[0];
}
#else /* !FT_CONFIG_OPTION_USE_CMAPS */
diff --git a/src/pcf/pcfdriver.c b/src/pcf/pcfdriver.c
index c9e3972..c86bbfb 100644
--- a/src/pcf/pcfdriver.c
+++ b/src/pcf/pcfdriver.c
@@ -340,6 +340,10 @@ THE SOFTWARE.
}
error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL );
+
+ /* Select default charmap */
+ if (face->root.num_charmaps)
+ face->root.charmap = face->root.charmaps[0];
}
#else /* !FT_CONFIG_OPTION_USE_CMAPS */
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 76a35d5..61e9afc 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -175,6 +175,10 @@
charmap.encoding = ft_encoding_unicode;
FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
+
+ /* Select default charmap */
+ if (root->num_charmaps)
+ root->charmap = root->charmaps[0];
}
}
diff --git a/src/psaux/t1cmap.c b/src/psaux/t1cmap.c
index db3b968..0ddd3f5 100644
--- a/src/psaux/t1cmap.c
+++ b/src/psaux/t1cmap.c
@@ -197,12 +197,11 @@
FT_UInt32 char_code )
{
FT_UInt result = 0;
- FT_UInt32 idx;
- idx = (FT_UInt32)( char_code - cmap->first );
- if ( idx < cmap->count )
- result = cmap->indices[idx];
+ if ( ( char_code >= cmap->first ) &&
+ ( char_code < ( cmap->first + cmap->count ) ) )
+ result = cmap->indices[char_code];
return result;
}
@@ -214,7 +213,6 @@
{
FT_UInt result = 0;
FT_UInt32 char_code = *pchar_code;
- FT_UInt32 idx;
++char_code;
@@ -222,10 +220,9 @@
if ( char_code < cmap->first )
char_code = cmap->first;
- idx = (FT_UInt32)( char_code - cmap->first );
- for ( ; idx < cmap->count; idx++, char_code++ )
+ for ( ; char_code < ( cmap->first + cmap->count ); char_code++ )
{
- result = cmap->indices[idx];
+ result = cmap->indices[char_code];
if ( result != 0 )
goto Exit;
}
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 2755f25..5a6008d 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -485,6 +485,10 @@
if ( clazz )
FT_CMap_New( clazz, NULL, &charmap, NULL );
+
+ /* Select default charmap */
+ if (root->num_charmaps)
+ root->charmap = root->charmaps[0];
}
}
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index b2b44a6..5344c68 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -548,7 +548,12 @@
NULL,
&charmap,
NULL );
- if (error) goto Fail;
+ if ( error )
+ goto Fail;
+
+ /* Select default charmap */
+ if ( root->num_charmaps )
+ root->charmap = root->charmaps[0];
}
#else /* !FT_CONFIG_OPTION_USE_CMAPS */