* src/type1/t1objs.c (T1_Face_Init), src/cff/cffobjs.c (CFF_Face_Init), src/cid/cidobjs.c (CID_Face_Init): removing the bug that returned global BBox values in 16.16 fixed format (instead of integer font units).
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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
diff --git a/ChangeLog b/ChangeLog
index c5747a8..23fe537 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-03-05 David Turner <david@freetype.org>
+
+ * src/type1/t1objs.c (T1_Face_Init),
+ src/cff/cffobjs.c (CFF_Face_Init),
+ src/cid/cidobjs.c (CID_Face_Init):
+
+ removing the bug that returned global BBox values in
+ 16.16 fixed format (instead of integer font units).
+
+
2002-03-05 Werner Lemberg <wl@gnu.org>
* builds/unix/aclocal.m4, builds/unix/ltmain.sh: Update to libtool
@@ -41,7 +51,7 @@
typedef PS_StructRec T1_Struct; /* backwards-compatibility */
- hence, we increase the coherency of the source code by effectuively
+ hence, we increase the coherency of the source code by effectively
using the 'Rec' prefix for structure types..
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 0a762f6..51af7d8 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -574,9 +574,14 @@
root->num_glyphs = cff->charstrings_index.count;
/* set global bbox, as well as EM size */
- root->bbox = dict->font_bbox;
- root->ascender = (FT_Short)( root->bbox.yMax >> 16 );
- root->descender = (FT_Short)( root->bbox.yMin >> 16 );
+ root->bbox.xMin = dict->font_bbox.xMin >> 16;
+ root->bbox.yMin = dict->font_bbox.yMin >> 16;
+ root->bbox.xMax = (dict->font_bbox.xMax + 0xFFFFU) >> 16;
+ root->bbox.yMax = (dict->font_bbox.yMax + 0xFFFFU) >> 16;
+
+
+ root->ascender = (FT_Short)( root->bbox.yMax );
+ root->descender = (FT_Short)( root->bbox.yMin );
root->height = (FT_Short)(
( ( root->ascender - root->descender ) * 12 ) / 10 );
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 27b384b..8cd91f3 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -381,41 +381,21 @@
root->num_fixed_sizes = 0;
root->available_sizes = 0;
- root->bbox = face->cid.font_bbox;
+ root->bbox.xMin = face->cid.font_bbox.xMin >> 16;
+ root->bbox.yMin = face->cid.font_bbox.yMin >> 16;
+ root->bbox.xMax = (face->cid.font_bbox.xMax + 0xFFFFU) >> 16;
+ root->bbox.yMax = (face->cid.font_bbox.yMax + 0xFFFFU) >> 16;
+
+
if ( !root->units_per_EM )
root->units_per_EM = 1000;
- root->ascender = (FT_Short)( face->cid.font_bbox.yMax >> 16 );
- root->descender = (FT_Short)( face->cid.font_bbox.yMin >> 16 );
+ root->ascender = (FT_Short)( face->cid.font_bbox.yMax );
+ root->descender = (FT_Short)( face->cid.font_bbox.yMin );
root->height = (FT_Short)(
( ( root->ascender + root->descender ) * 12 ) / 10 );
-#if 0
-
- /* now compute the maximum advance width */
-
- root->max_advance_width = face->type1.private_dict.standard_width[0];
-
- /* compute max advance width for proportional fonts */
- if ( !face->type1.font_info.is_fixed_pitch )
- {
- FT_Int max_advance;
-
-
- error = CID_Compute_Max_Advance( face, &max_advance );
-
- /* in case of error, keep the standard width */
- if ( !error )
- root->max_advance_width = max_advance;
- else
- error = 0; /* clear error */
- }
-
- root->max_advance_height = root->height;
-
-#endif /* 0 */
-
root->underline_position = face->cid.font_info.underline_position;
root->underline_thickness = face->cid.font_info.underline_thickness;
@@ -424,74 +404,6 @@
}
}
-#if 0
-
- /* charmap support - synthetize unicode charmap when possible */
- {
- FT_Face root = &face->root;
- FT_CharMap charmap = face->charmaprecs;
-
-
- /* synthesize a Unicode charmap if there is support in the `psnames' */
- /* module */
- if ( face->psnames )
- {
- PSNames_Service psnames = (PSNames_Service)face->psnames;
-
-
- if ( psnames->unicode_value )
- {
- error = psnames->build_unicodes(
- root->memory,
- face->type1.num_glyphs,
- (const char**)face->type1.glyph_names,
- &face->unicode_map );
- if ( !error )
- {
- root->charmap = charmap;
- charmap->face = (FT_Face)face;
- charmap->encoding = ft_encoding_unicode;
- charmap->platform_id = 3;
- charmap->encoding_id = 1;
- charmap++;
- }
-
- /* simply clear the error in case of failure (which really */
- /* means that out of memory or no unicode glyph names) */
- error = 0;
- }
- }
-
- /* now, support either the standard, expert, or custom encodings */
- charmap->face = (FT_Face)face;
- charmap->platform_id = 7; /* a new platform id for Adobe fonts? */
-
- switch ( face->type1.encoding_type )
- {
- case T1_ENCODING_TYPE_STANDARD:
- charmap->encoding = ft_encoding_adobe_standard;
- charmap->encoding_id = 0;
- break;
-
- case T1_ENCODING_TYPE_EXPORT:
- charmap->encoding = ft_encoding_adobe_expert;
- charmap->encoding_id = 1;
- break;
-
- default:
- charmap->encoding = ft_encoding_adobe_custom;
- charmap->encoding_id = 2;
- break;
- }
-
- root->charmaps = face->charmaps;
- root->num_charmaps = charmap - face->charmaprecs + 1;
- face->charmaps[0] = &face->charmaprecs[0];
- face->charmaps[1] = &face->charmaprecs[1];
- }
-
-#endif /* 0 */
-
Exit:
return error;
}
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 16ab0fc..4f3e732 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -404,20 +404,23 @@
root->num_fixed_sizes = 0;
root->available_sizes = 0;
- root->bbox = face->type1.font_bbox;
+ root->bbox.xMin = face->type1.font_bbox.xMin >> 16;
+ root->bbox.yMin = face->type1.font_bbox.yMin >> 16;
+ root->bbox.xMax = (face->type1.font_bbox.xMax + 0xFFFFU) >> 16;
+ root->bbox.yMax = (face->type1.font_bbox.yMax + 0xFFFFU) >> 16;
/* Set units_per_EM if we didn't set it in parse_font_matrix. */
if ( !root->units_per_EM )
root->units_per_EM = 1000;
- root->ascender = (FT_Short)( face->type1.font_bbox.yMax >> 16 );
- root->descender = (FT_Short)( face->type1.font_bbox.yMin >> 16 );
+ root->ascender = (FT_Short)( face->type1.font_bbox.yMax );
+ root->descender = (FT_Short)( face->type1.font_bbox.yMin );
root->height = (FT_Short)(
( ( root->ascender - root->descender ) * 12 ) / 10 );
/* now compute the maximum advance width */
root->max_advance_width =
- (FT_Short)( face->type1.font_bbox.xMax >> 16 );
+ (FT_Short)( face->type1.font_bbox.xMax );
{
FT_Int max_advance;