diff options
author | marha <marha@users.sourceforge.net> | 2011-07-18 08:30:47 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-18 08:30:47 +0200 |
commit | d8e3f99cdf46297afeb26fe15ad30f7c6de8ee7c (patch) | |
tree | 199776414c3aa9aab0a35c1d16d38c7a072d6665 /freetype/src/autofit/afindic.c | |
parent | 7723537ddbe5dd4070f2bebbd4e0c93be3244b18 (diff) | |
download | vcxsrv-d8e3f99cdf46297afeb26fe15ad30f7c6de8ee7c.tar.gz vcxsrv-d8e3f99cdf46297afeb26fe15ad30f7c6de8ee7c.tar.bz2 vcxsrv-d8e3f99cdf46297afeb26fe15ad30f7c6de8ee7c.zip |
Switched to freetype 2.4.5
Diffstat (limited to 'freetype/src/autofit/afindic.c')
-rw-r--r-- | freetype/src/autofit/afindic.c | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/freetype/src/autofit/afindic.c b/freetype/src/autofit/afindic.c index 1d9e9eafb..c232cff78 100644 --- a/freetype/src/autofit/afindic.c +++ b/freetype/src/autofit/afindic.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for Indic scripts (body). */ /* */ -/* Copyright 2007 by */ +/* Copyright 2007, 2011 by */ /* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -27,23 +27,42 @@ #include "afcjk.h" -#ifdef AF_USE_WARPER +#ifdef AF_CONFIG_OPTION_USE_WARPER #include "afwarp.h" #endif static FT_Error - af_indic_metrics_init( AF_LatinMetrics metrics, - FT_Face face ) + af_indic_metrics_init( AF_CJKMetrics metrics, + FT_Face face ) { - /* use CJK routines */ - return af_cjk_metrics_init( metrics, face ); + /* skip blue zone init in CJK routines */ + FT_CharMap oldmap = face->charmap; + + + metrics->units_per_em = face->units_per_EM; + + if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) ) + face->charmap = NULL; + else + { + af_cjk_metrics_init_widths( metrics, face, 0x7530 ); +#if 0 + /* either need indic specific blue_chars[] or just skip blue zones */ + af_cjk_metrics_init_blues( metrics, face, af_cjk_blue_chars ); +#endif + af_cjk_metrics_check_digits( metrics, face ); + } + + FT_Set_Charmap( face, oldmap ); + + return AF_Err_Ok; } static void - af_indic_metrics_scale( AF_LatinMetrics metrics, - AF_Scaler scaler ) + af_indic_metrics_scale( AF_CJKMetrics metrics, + AF_Scaler scaler ) { /* use CJK routines */ af_cjk_metrics_scale( metrics, scaler ); @@ -51,8 +70,8 @@ static FT_Error - af_indic_hints_init( AF_GlyphHints hints, - AF_LatinMetrics metrics ) + af_indic_hints_init( AF_GlyphHints hints, + AF_CJKMetrics metrics ) { /* use CJK routines */ return af_cjk_hints_init( hints, metrics ); @@ -60,9 +79,9 @@ static FT_Error - af_indic_hints_apply( AF_GlyphHints hints, - FT_Outline* outline, - AF_LatinMetrics metrics) + af_indic_hints_apply( AF_GlyphHints hints, + FT_Outline* outline, + AF_CJKMetrics metrics ) { /* use CJK routines */ return af_cjk_hints_apply( hints, outline, metrics ); @@ -84,6 +103,12 @@ AF_UNIRANGE_REC( 0x0100UL, 0xFFFFUL ), /* why this? */ #endif AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL), /* Indic Range */ + AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL), /* Tibetan */ + AF_UNIRANGE_REC( 0x1900UL, 0x194FUL), /* Limbu */ + AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL), /* Sundanese */ + AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL), /* Meetei Mayak */ + AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL), /* Syloti Nagri */ + AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL), /* Sharada */ AF_UNIRANGE_REC( 0UL, 0UL) }; @@ -92,7 +117,7 @@ AF_SCRIPT_INDIC, af_indic_uniranges, - sizeof( AF_LatinMetricsRec ), + sizeof( AF_CJKMetricsRec ), (AF_Script_InitMetricsFunc) af_indic_metrics_init, (AF_Script_ScaleMetricsFunc)af_indic_metrics_scale, @@ -114,7 +139,7 @@ AF_SCRIPT_INDIC, af_indic_uniranges, - sizeof( AF_LatinMetricsRec ), + sizeof( AF_CJKMetricsRec ), (AF_Script_InitMetricsFunc) NULL, (AF_Script_ScaleMetricsFunc)NULL, |