diff options
author | Victoria Lease <violets@google.com> | 2013-12-12 09:12:18 -0800 |
---|---|---|
committer | Victoria Lease <violets@google.com> | 2013-12-12 09:23:45 -0800 |
commit | ec0bab5697bb31ba980810145f62e3799946ec60 (patch) | |
tree | baa7eea792c50b86250831c67a9f2a6eb5be6a91 /src/autofit/afloader.c | |
parent | 899c67b6cfcd2010784fbf08c5415af16c526e0c (diff) | |
download | android_external_freetype-ec0bab5697bb31ba980810145f62e3799946ec60.tar.gz android_external_freetype-ec0bab5697bb31ba980810145f62e3799946ec60.tar.bz2 android_external_freetype-ec0bab5697bb31ba980810145f62e3799946ec60.zip |
Update freetype to 8bb09b0fe4d9747bcf452a777cabed7d7ef435e2
Integrated patches from freetype2 git repository, up to hashval
8bb09b0fe4d9747bcf452a777cabed7d7ef435e2, which is post-2.5.2.
Most recent commit message from freetype git:
[truetype] Simplify logic of rendering modes.
Noteworthy patches included:
[sfnt] Fix handling of embedded bitmap strikes.
[truetype] Improve handling of buggy embedded bitmap strikes.
Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR.
Change-Id: I4a22d96c9443c7a587475ca0a9c684843e144b18
Diffstat (limited to 'src/autofit/afloader.c')
-rw-r--r-- | src/autofit/afloader.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c index 17a6fb7..400b01e 100644 --- a/src/autofit/afloader.c +++ b/src/autofit/afloader.c @@ -21,6 +21,7 @@ #include "afhints.h" #include "aferrors.h" #include "afmodule.h" +#include "afpic.h" /* Initialize glyph loader. */ @@ -180,10 +181,20 @@ /* now load the slot image into the auto-outline and run the */ /* automatic hinting process */ - if ( metrics->clazz->script_hints_apply ) - metrics->clazz->script_hints_apply( hints, - &gloader->current.outline, - metrics ); + { +#ifdef FT_CONFIG_OPTION_PIC + AF_FaceGlobals globals = loader->globals; +#endif + AF_WritingSystemClass writing_system_class = + AF_WRITING_SYSTEM_CLASSES_GET + [metrics->script_class->writing_system]; + + + if ( writing_system_class->script_hints_apply ) + writing_system_class->script_hints_apply( hints, + &gloader->current.outline, + metrics ); + } /* we now need to adjust the metrics according to the change in */ /* width/positioning that occurred during the hinting process */ @@ -519,33 +530,41 @@ if ( !error ) { AF_ScriptMetrics metrics; - FT_UInt options = 0; + FT_UInt options = AF_SCRIPT_NONE; #ifdef FT_OPTION_AUTOFIT2 - /* XXX: undocumented hook to activate the latin2 hinter */ + /* XXX: undocumented hook to activate the latin2 writing system */ if ( load_flags & ( 1UL << 20 ) ) - options = 2; + options = AF_SCRIPT_LTN2; #endif error = af_face_globals_get_metrics( loader->globals, gindex, options, &metrics ); if ( !error ) { +#ifdef FT_CONFIG_OPTION_PIC + AF_FaceGlobals globals = loader->globals; +#endif + AF_WritingSystemClass writing_system_class = + AF_WRITING_SYSTEM_CLASSES_GET + [metrics->script_class->writing_system]; + + loader->metrics = metrics; - if ( metrics->clazz->script_metrics_scale ) - metrics->clazz->script_metrics_scale( metrics, &scaler ); + if ( writing_system_class->script_metrics_scale ) + writing_system_class->script_metrics_scale( metrics, &scaler ); else metrics->scaler = scaler; load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; load_flags &= ~FT_LOAD_RENDER; - if ( metrics->clazz->script_hints_init ) + if ( writing_system_class->script_hints_init ) { - error = metrics->clazz->script_hints_init( &loader->hints, - metrics ); + error = writing_system_class->script_hints_init( &loader->hints, + metrics ); if ( error ) goto Exit; } |