summaryrefslogtreecommitdiffstats
path: root/src/cff/cffobjs.c
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2011-08-24 05:32:14 +0200
committerArne Coucheron <arco68@gmail.com>2011-08-24 05:32:14 +0200
commit6a26dd05f335a4ebab267657ae31bb7ee7114625 (patch)
treef5a0d98f1d887b8063987f5e9b58a4ed2931833e /src/cff/cffobjs.c
parent1db8a080668ca5428a7f000f668ebf8bec20ad08 (diff)
downloadandroid_external_freetype-gb-release-7.2.tar.gz
android_external_freetype-gb-release-7.2.tar.bz2
android_external_freetype-gb-release-7.2.zip
CHANGES BETWEEN 2.4.5 and 2.4.6 I. IMPORTANT BUG FIXES - For TrueType based fonts, the ascender and descender values were incorrect sometimes (off by a pixel if the ppem value was not a multiple of 5). Depending on the use you might now experience a different layout; the change should result in better, more consistent line spacing. - Fix CVE-2011-0226 which causes a vulnerability while handling Type 1 fonts. - BDF fonts containing glyphs with negative values for ENCODING were incorrectly rejected. This bug has been introduced in FreeType version 2.2.0. - David Bevan contributed a major revision of the FreeType stroker code: . The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected. . A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been introduced to support PostScript and PDF miter joins. . FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an alias for FT_STROKER_LINEJOIN_MITER. . Various stroking glitches has been fixed. II. MISCELLANEOUS - SFNT bitmap fonts which contain an outline glyph for `.notdef' only no longer set the FT_FACE_FLAG_SCALABLE flag. CHANGES BETWEEN 2.4.4 and 2.4.5 I. IMPORTANT BUG FIXES - A rendering regression for second-order Bézier curves has been fixed, introduced in 2.4.3. II. IMPORTANT CHANGES - If autohinting is not explicitly disabled, FreeType now uses the autohinter if a TrueType based font doesn't contain native hints. - The load flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH has been made redundant and is simply ignored; this means that FreeType now ignores the global advance width value in TrueType fonts. III. MISCELLANEOUS - `FT_Sfnt_Table_Info' can now return the number of SFNT tables of a font. - Support for PCF files compressed with bzip2 has been contributed by Joel Klinghed. To make this work, the OS must provide a bzip2 library. - Bradley Grainger contributed project and solution files in Visual Studio 2010 format. - Again some fixes to better handle broken fonts. - Some improvements to the B/W rasterizer. - Fixes to the cache module to improve robustness. - Just Fill Bugs contributed (experimental) code to compute blue zones for CJK Ideographs, improving the alignment of horizontal stems at the top or bottom edges. - The `ftgrid' demo program can now display autohinter segments, to be toggled on and off with key `s'. CHANGES BETWEEN 2.4.3 and 2.4.4 I. IMPORTANT BUG FIXES - UVS support (TrueType/OpenType cmap format 14) support is fixed. This regression has been introduced in version 2.4.0. II. MISCELLANEOUS - Detect tricky fonts (e.g. MingLiU) by the lengths and checksums of Type42-persistent subtables (`cvt ', `fpgm', and `prep') when a TrueType font without family name is given. The previous fix, introduced in 2.4.3, was too rigorous, causing many subsetted fonts (mainly from PDF files) displayed badly because FreeType forced rendering with the TrueType bytecode engine instead of the autohinter. - Better support for 64bit platforms. - More fixes to improve handling of broken fonts. CHANGES BETWEEN 2.4.2 and 2.4.3 I. IMPORTANT BUG FIXES - Fix rendering of certain cubic, S-shaped arcs. This regression has been introduced in version 2.4.0. II. MISCELLANEOUS - To fix the above mentioned rendering issue, a new spline flattening algorithm has been introduced which speeds up both conic and cubic arcs. - Handling of broken fonts has been further improved. Change-Id: Ie06b74b29738a34d686ab1132e9fa44d5d258d1c
Diffstat (limited to 'src/cff/cffobjs.c')
-rw-r--r--src/cff/cffobjs.c62
1 files changed, 55 insertions, 7 deletions
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index f8b07c3..cd38676 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -4,8 +4,7 @@
/* */
/* OpenType objects manager (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
-/* 2010 by */
+/* Copyright 1996-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -162,7 +161,7 @@
{
CFF_Face face = (CFF_Face)cffsize->face;
CFF_Font font = (CFF_Font)face->extra.data;
- CFF_Internal internal;
+ CFF_Internal internal = NULL;
PS_PrivateRec priv;
FT_Memory memory = cffsize->face->memory;
@@ -421,6 +420,7 @@
{
for ( idx = 7; idx < length; idx++ )
name[idx - 7] = name[idx];
+ length -= 7;
}
}
else
@@ -429,6 +429,51 @@
}
+ /* Remove the style part from the family name (if present). */
+
+ static void
+ remove_style( FT_String* family_name,
+ const FT_String* style_name )
+ {
+ FT_Int32 family_name_length, style_name_length;
+
+
+ family_name_length = strlen( family_name );
+ style_name_length = strlen( style_name );
+
+ if ( family_name_length > style_name_length )
+ {
+ FT_Int idx;
+
+
+ for ( idx = 1; idx <= style_name_length; ++idx )
+ {
+ if ( family_name[family_name_length - idx] !=
+ style_name[style_name_length - idx] )
+ break;
+ }
+
+ if ( idx > style_name_length )
+ {
+ /* family_name ends with style_name; remove it */
+ idx = family_name_length - style_name_length - 1;
+
+ /* also remove special characters */
+ /* between real family name and style */
+ while ( idx > 0 &&
+ ( family_name[idx] == '-' ||
+ family_name[idx] == ' ' ||
+ family_name[idx] == '_' ||
+ family_name[idx] == '+' ) )
+ --idx;
+
+ if ( idx > 0 )
+ family_name[idx + 1] = '\0';
+ }
+ }
+ }
+
+
FT_LOCAL_DEF( FT_Error )
cff_face_init( FT_Stream stream,
FT_Face cffface, /* CFF_Face */
@@ -436,14 +481,14 @@
FT_Int num_params,
FT_Parameter* params )
{
- CFF_Face face = (CFF_Face)cffface;
+ CFF_Face face = (CFF_Face)cffface;
FT_Error error;
SFNT_Service sfnt;
FT_Service_PsCMaps psnames;
PSHinter_Service pshinter;
FT_Bool pure_cff = 1;
FT_Bool sfnt_format = 0;
- FT_Library library = cffface->driver->root.library;
+ FT_Library library = cffface->driver->root.library;
sfnt = (SFNT_Service)FT_Get_Module_Interface(
@@ -523,7 +568,7 @@
/* now load and parse the CFF table in the file */
{
- CFF_Font cff;
+ CFF_Font cff = NULL;
CFF_FontRecDict dict;
FT_Memory memory = cffface->memory;
FT_Int32 flags;
@@ -677,7 +722,7 @@
/* compute number of glyphs */
if ( dict->cid_registry != 0xFFFFU )
- cffface->num_glyphs = cff->charset.max_cid;
+ cffface->num_glyphs = cff->charset.max_cid + 1;
else
cffface->num_glyphs = cff->charstrings_index.count;
@@ -758,6 +803,9 @@
/* case, the remaining string in `fullp' will be used as */
/* the style name. */
style_name = cff_strcpy( memory, fullp );
+
+ /* remove the style part from the family name (if present) */
+ remove_style( cffface->family_name, style_name );
}
break;
}