* 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).
This commit is contained in:
parent
8a9c0213d9
commit
7d0f0bafab
12
ChangeLog
12
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>
|
2002-03-05 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* builds/unix/aclocal.m4, builds/unix/ltmain.sh: Update to libtool
|
* builds/unix/aclocal.m4, builds/unix/ltmain.sh: Update to libtool
|
||||||
|
@ -41,7 +51,7 @@
|
||||||
typedef PS_StructRec T1_Struct; /* backwards-compatibility */
|
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..
|
using the 'Rec' prefix for structure types..
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -574,9 +574,14 @@
|
||||||
root->num_glyphs = cff->charstrings_index.count;
|
root->num_glyphs = cff->charstrings_index.count;
|
||||||
|
|
||||||
/* set global bbox, as well as EM size */
|
/* set global bbox, as well as EM size */
|
||||||
root->bbox = dict->font_bbox;
|
root->bbox.xMin = dict->font_bbox.xMin >> 16;
|
||||||
root->ascender = (FT_Short)( root->bbox.yMax >> 16 );
|
root->bbox.yMin = dict->font_bbox.yMin >> 16;
|
||||||
root->descender = (FT_Short)( root->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->height = (FT_Short)(
|
||||||
( ( root->ascender - root->descender ) * 12 ) / 10 );
|
( ( root->ascender - root->descender ) * 12 ) / 10 );
|
||||||
|
|
||||||
|
|
|
@ -381,41 +381,21 @@
|
||||||
root->num_fixed_sizes = 0;
|
root->num_fixed_sizes = 0;
|
||||||
root->available_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 )
|
if ( !root->units_per_EM )
|
||||||
root->units_per_EM = 1000;
|
root->units_per_EM = 1000;
|
||||||
|
|
||||||
root->ascender = (FT_Short)( face->cid.font_bbox.yMax >> 16 );
|
root->ascender = (FT_Short)( face->cid.font_bbox.yMax );
|
||||||
root->descender = (FT_Short)( face->cid.font_bbox.yMin >> 16 );
|
root->descender = (FT_Short)( face->cid.font_bbox.yMin );
|
||||||
root->height = (FT_Short)(
|
root->height = (FT_Short)(
|
||||||
( ( root->ascender + root->descender ) * 12 ) / 10 );
|
( ( 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_position = face->cid.font_info.underline_position;
|
||||||
root->underline_thickness = face->cid.font_info.underline_thickness;
|
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:
|
Exit:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -404,20 +404,23 @@
|
||||||
root->num_fixed_sizes = 0;
|
root->num_fixed_sizes = 0;
|
||||||
root->available_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. */
|
/* Set units_per_EM if we didn't set it in parse_font_matrix. */
|
||||||
if ( !root->units_per_EM )
|
if ( !root->units_per_EM )
|
||||||
root->units_per_EM = 1000;
|
root->units_per_EM = 1000;
|
||||||
|
|
||||||
root->ascender = (FT_Short)( face->type1.font_bbox.yMax >> 16 );
|
root->ascender = (FT_Short)( face->type1.font_bbox.yMax );
|
||||||
root->descender = (FT_Short)( face->type1.font_bbox.yMin >> 16 );
|
root->descender = (FT_Short)( face->type1.font_bbox.yMin );
|
||||||
root->height = (FT_Short)(
|
root->height = (FT_Short)(
|
||||||
( ( root->ascender - root->descender ) * 12 ) / 10 );
|
( ( root->ascender - root->descender ) * 12 ) / 10 );
|
||||||
|
|
||||||
/* now compute the maximum advance width */
|
/* now compute the maximum advance width */
|
||||||
root->max_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;
|
FT_Int max_advance;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue