From 89ea811b8dcf900d14d337c7295c3f702baa4f8f Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 18 Oct 2014 11:02:56 +0200 Subject: [PATCH] Synchronize with FreeType. This correponds to commits c9c33f202ece24390e696a8d91d44f1f6a61a8ed `[autofit] Add blue-zone support for Telugu.' and commit 8f17809b2d1051a50f743b3e38a54add98eebc30 `[autofit] Adjust Devenagari character range.' --- lib/tablue.dat | 12 ++++++++++++ lib/taranges.c | 18 +++++++++++++++++- lib/tastyles.h | 7 +++++++ lib/ttfautohint-scripts.h | 5 +++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/tablue.dat b/lib/tablue.dat index 92785dd..9fc41b5 100644 --- a/lib/tablue.dat +++ b/lib/tablue.dat @@ -122,6 +122,13 @@ TA_BLUE_STRING_ENUM TA_BLUE_STRINGS_ARRAY TA_BLUE_STRING_MAX_LEN: TA_BLUE_STRING_LATIN_SMALL_DESCENDER "pqgjy" + // we separate the letters with spaces to avoid ligatures; + // this is just for convenience to simplify reading + TA_BLUE_STRING_TELUGU_TOP + "ఇ ఌ ఙ ఞ ణ ఱ ౯" + + TA_BLUE_STRING_TELUGU_BOTTOM + "అ క చ ర ఽ ౨ ౬" // The blue zone stringsets, as used in the script styles, cf. `tastyles.h'. // @@ -236,4 +243,9 @@ TA_BLUE_STRINGSET_ENUM TA_BLUE_STRINGSETS_ARRAY TA_BLUE_STRINGSET_MAX_LEN: { TA_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } { TA_BLUE_STRING_MAX, 0 } + TA_BLUE_STRINGSET_TELU + { TA_BLUE_STRING_TELUGU_TOP, TA_BLUE_PROPERTY_LATIN_TOP } + { TA_BLUE_STRING_TELUGU_BOTTOM, 0 } + { TA_BLUE_STRING_MAX, 0 } + // END diff --git a/lib/taranges.c b/lib/taranges.c index cf5dd88..3dac43a 100644 --- a/lib/taranges.c +++ b/lib/taranges.c @@ -29,9 +29,19 @@ const TA_Script_UniRangeRec ta_cyrl_uniranges[] = TA_UNIRANGE_REC( 0UL, 0UL) }; +/* there are some characters in the Devanagari Unicode block that are */ +/* generic to Indic scripts; we omit them so that their presence doesn't */ +/* trigger Devanagari */ + const TA_Script_UniRangeRec ta_deva_uniranges[] = { - TA_UNIRANGE_REC(0x0900UL, 0x097FUL), /* Devanagari */ + TA_UNIRANGE_REC(0x0900UL, 0x093BUL), /* Devanagari */ + /* omitting U+093C nukta */ + TA_UNIRANGE_REC(0x093DUL, 0x0950UL), + /* omitting U+0951 udatta, U+0952 anudatta */ + TA_UNIRANGE_REC(0x0953UL, 0x0963UL), + /* omitting U+0964 danda, U+0965 double danda */ + TA_UNIRANGE_REC(0x0966UL, 0x097FUL), TA_UNIRANGE_REC(0x20B9UL, 0x20B9UL), /* (new) Rupee sign */ TA_UNIRANGE_REC( 0UL, 0UL) }; @@ -78,6 +88,12 @@ const TA_Script_UniRangeRec ta_latn_uniranges[] = TA_UNIRANGE_REC( 0UL, 0UL) }; +const TA_Script_UniRangeRec ta_telu_uniranges[] = +{ + TA_UNIRANGE_REC(0x0C00UL, 0x0C7FUL), /* Telugu */ + TA_UNIRANGE_REC( 0UL, 0UL) +}; + const TA_Script_UniRangeRec ta_none_uniranges[] = { TA_UNIRANGE_REC(0UL, 0UL) diff --git a/lib/tastyles.h b/lib/tastyles.h index 42ce9e2..b7b1e8f 100644 --- a/lib/tastyles.h +++ b/lib/tastyles.h @@ -113,6 +113,13 @@ STYLE(ltn2_dflt, LTN2_DFLT, TA_COVERAGE_DEFAULT) #endif +STYLE(telu_dflt, TELU_DFLT, + "Telugu default style", + TA_WRITING_SYSTEM_LATIN, + TA_SCRIPT_TELU, + TA_BLUE_STRINGSET_TELU, + TA_COVERAGE_DEFAULT) + STYLE(none_dflt, NONE_DFLT, "no style", TA_WRITING_SYSTEM_DUMMY, diff --git a/lib/ttfautohint-scripts.h b/lib/ttfautohint-scripts.h index 500239d..d7ed17f 100644 --- a/lib/ttfautohint-scripts.h +++ b/lib/ttfautohint-scripts.h @@ -53,6 +53,11 @@ SCRIPT(latn, LATN, HB_SCRIPT_LATIN, 'o', 'O', '0') +SCRIPT(telu, TELU, + "Telugu", + HB_SCRIPT_TELUGU, + 0xC19, 0xC12, 0x0) /* ఙ ఒ */ + SCRIPT(none, NONE, "no script", HB_SCRIPT_INVALID, -- 2.11.4.GIT