summaryrefslogtreecommitdiffstats
path: root/src/cff/cffobjs.c
diff options
context:
space:
mode:
authorOlivier Bailly <olivier@google.com>2011-11-07 15:47:04 -0800
committerGeremy Condra <gcondra@google.com>2011-11-11 10:43:54 -0800
commitbff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc (patch)
tree720489aa1d9176e568acf0f8cb441a3f8cb0663f /src/cff/cffobjs.c
parent50571ad2593c5b9c46fc93ea59bfd82a80c1b55c (diff)
downloadandroid_external_freetype-bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc.tar.gz
android_external_freetype-bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc.tar.bz2
android_external_freetype-bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc.zip
DO NOT MERGE Update FreeType library to 2.4.7
Copied common files from upstream repository only. changes to ftoption.h which were intentionally NOT taken: /* contain no glyph data, but supply it via a callback function. */ /* This is required by clients supporting document formats which */ /* supply font data incrementally as the document is parsed, such */ /* as the Ghostscript interpreter for the PostScript language. */ /* */ -/* #define FT_CONFIG_OPTION_INCREMENTAL */ +#define FT_CONFIG_OPTION_INCREMENTAL /*************************************************************************/ /* */ /* The size in bytes of the render pool used by the scan-line converter */ @@ -553,11 +553,11 @@ FT_BEGIN_HEADER /* TrueType glyphs without hinting. */ /* */ /* Do not #undef this macro here, since the build system might */ /* define it for certain configurations only. */ /* */ -/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER /*************************************************************************/ /* */ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ @@ -603,11 +603,11 @@ FT_BEGIN_HEADER /* */ /* error = FT_Open_Face( library, &open_args, index, &face ); */ /* ... */ /* } */ /* */ -#define TT_CONFIG_OPTION_UNPATENTED_HINTING +/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ Manual changes to ftmodule.h: +/* + * New modules in 2.4.7: +FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) +FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) +FT_USE_MODULE( FT_Module_Class, psaux_module_class ) +FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) + */ + These lines were added for 2.4.7 but we decided to stick with our current use. Change-Id: Ic1b52909580c78ead44cf4f882be06f2837539db
Diffstat (limited to 'src/cff/cffobjs.c')
-rw-r--r--src/cff/cffobjs.c68
1 files changed, 41 insertions, 27 deletions
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index cd38676..15707a2 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -607,7 +607,25 @@
goto Bad_Format;
}
- if ( !dict->units_per_em )
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_UInt idx;
+ FT_String* s;
+
+
+ FT_TRACE4(( "SIDs\n" ));
+
+ /* dump string index, including default strings for convenience */
+ for ( idx = 0; idx < cff->num_strings + 390; idx++ )
+ {
+ s = cff_index_get_sid_string( cff, idx );
+ if ( s )
+ FT_TRACE4((" %5d %s\n", idx, s ));
+ }
+ }
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+ if ( !dict->has_font_matrix )
dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
/* Normalize the font matrix so that `matrix->xx' is 1; the */
@@ -652,26 +670,32 @@
FT_Fixed temp;
- if ( sub->units_per_em )
+ if ( sub->has_font_matrix )
{
FT_Long scaling;
- if ( top->units_per_em > 1 && sub->units_per_em > 1 )
- scaling = FT_MIN( top->units_per_em, sub->units_per_em );
- else
- scaling = 1;
-
- FT_Matrix_Multiply_Scaled( &top->font_matrix,
- &sub->font_matrix,
- scaling );
- FT_Vector_Transform_Scaled( &sub->font_offset,
- &top->font_matrix,
- scaling );
-
- sub->units_per_em = FT_MulDiv( sub->units_per_em,
- top->units_per_em,
- scaling );
+ /* if we have a top-level matrix, */
+ /* concatenate the subfont matrix */
+
+ if ( top->has_font_matrix )
+ {
+ if ( top->units_per_em > 1 && sub->units_per_em > 1 )
+ scaling = FT_MIN( top->units_per_em, sub->units_per_em );
+ else
+ scaling = 1;
+
+ FT_Matrix_Multiply_Scaled( &top->font_matrix,
+ &sub->font_matrix,
+ scaling );
+ FT_Vector_Transform_Scaled( &sub->font_offset,
+ &top->font_matrix,
+ scaling );
+
+ sub->units_per_em = FT_MulDiv( sub->units_per_em,
+ top->units_per_em,
+ scaling );
+ }
}
else
{
@@ -690,16 +714,6 @@
{
*upm = FT_DivFix( *upm, temp );
- /* if *upm is larger than 100*1000 we divide by 1000 -- */
- /* this can happen if e.g. there is no top-font FontMatrix */
- /* and the subfont FontMatrix already contains the complete */
- /* scaling for the subfont (see section 5.11 of the PLRM) */
-
- /* 100 is a heuristic value */
-
- if ( *upm > 100L * 1000L )
- *upm = ( *upm + 500 ) / 1000;
-
matrix->xx = FT_DivFix( matrix->xx, temp );
matrix->yx = FT_DivFix( matrix->yx, temp );
matrix->xy = FT_DivFix( matrix->xy, temp );