From ff406e2e588e3a29518b4a5a4e709be65c635e4d Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 6 Aug 2015 07:34:50 +0200 Subject: [PATCH] [autofit] Improve Arabic hinting. Problem reported by Titus Nemeth (by using ttfautohint). * src/autofit/afblue.dat: Add neutral blue zone for the tatweel character. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. --- ChangeLog | 12 +++++++ src/autofit/afblue.c | 9 +++-- src/autofit/afblue.dat | 16 ++++++--- src/autofit/afblue.h | 81 +++++++++++++++++++++--------------------- 4 files changed, 71 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d167f8b0..de55ffa80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2015-08-06 Werner Lemberg + + [autofit] Improve Arabic hinting. + + Problem reported by Titus Nemeth (by using + ttfautohint). + + * src/autofit/afblue.dat: Add neutral blue zone for the tatweel + character. + + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + 2015-08-05 Alexei Podtelezhnikov [truetype] Clean up types. diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c index e2b24519a..62da0f2cb 100644 --- a/src/autofit/afblue.c +++ b/src/autofit/afblue.c @@ -30,6 +30,8 @@ '\0', '\xD8', '\xAA', '\xD8', '\xAB', '\xD8', '\xB7', '\xD8', '\xB8', '\xD9', '\x83', /* ت ث ط ظ ك */ '\0', + '\xD9', '\x80', /* ـ */ + '\0', '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */ '\0', '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */ @@ -139,9 +141,10 @@ af_blue_stringsets[] = { /* */ - { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_ARABIC_JOIN, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ARABIC_BOTTOM, 0 }, + { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }, { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | diff --git a/src/autofit/afblue.dat b/src/autofit/afblue.dat index fd5684e4a..8facfec01 100644 --- a/src/autofit/afblue.dat +++ b/src/autofit/afblue.dat @@ -69,8 +69,15 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_ARABIC_TOP "ا إ ل ك ط ظ" - AF_BLUE_STRING_ARABIC_JOIN + AF_BLUE_STRING_ARABIC_BOTTOM "ت ث ط ظ ك" + // We don't necessarily have access to medial forms via Unicode in case + // Arabic presentational forms are missing. The only character that is + // guaranteed to have the same vertical position with joining (this is, + // non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both + // round and flat curves. + AF_BLUE_STRING_ARABIC_JOIN + "ـ" AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP "БВЕПЗОСЭ" @@ -289,9 +296,10 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: AF_BLUE_STRINGSET_ARAB - { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ARABIC_JOIN, 0 } - { AF_BLUE_STRING_MAX, 0 } + { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARABIC_BOTTOM, 0 } + { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CYRL { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h index 94e33a9a2..2080e31fc 100644 --- a/src/autofit/afblue.h +++ b/src/autofit/afblue.h @@ -75,38 +75,39 @@ FT_BEGIN_HEADER typedef enum AF_Blue_String_ { AF_BLUE_STRING_ARABIC_TOP = 0, - AF_BLUE_STRING_ARABIC_JOIN = 13, - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 24, - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 41, - AF_BLUE_STRING_CYRILLIC_SMALL = 58, - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 75, - AF_BLUE_STRING_DEVANAGARI_BASE = 82, - AF_BLUE_STRING_DEVANAGARI_TOP = 107, - AF_BLUE_STRING_DEVANAGARI_HEAD = 132, - AF_BLUE_STRING_DEVANAGARI_BOTTOM = 157, - AF_BLUE_STRING_GREEK_CAPITAL_TOP = 164, - AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 179, - AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 192, - AF_BLUE_STRING_GREEK_SMALL = 205, - AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 222, - AF_BLUE_STRING_HEBREW_TOP = 239, - AF_BLUE_STRING_HEBREW_BOTTOM = 256, - AF_BLUE_STRING_HEBREW_DESCENDER = 269, - AF_BLUE_STRING_LATIN_CAPITAL_TOP = 280, - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 289, - AF_BLUE_STRING_LATIN_SMALL_F_TOP = 298, - AF_BLUE_STRING_LATIN_SMALL = 306, - AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 314, - AF_BLUE_STRING_TELUGU_TOP = 320, - AF_BLUE_STRING_TELUGU_BOTTOM = 342, - AF_BLUE_STRING_THAI_TOP = 364, - AF_BLUE_STRING_THAI_BOTTOM = 383, - AF_BLUE_STRING_THAI_ASCENDER = 405, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 415, - AF_BLUE_STRING_THAI_DESCENDER = 425, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 438, - AF_BLUE_STRING_THAI_DIGIT_TOP = 445, - af_blue_1_1 = 454, + AF_BLUE_STRING_ARABIC_BOTTOM = 13, + AF_BLUE_STRING_ARABIC_JOIN = 24, + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 27, + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 44, + AF_BLUE_STRING_CYRILLIC_SMALL = 61, + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 78, + AF_BLUE_STRING_DEVANAGARI_BASE = 85, + AF_BLUE_STRING_DEVANAGARI_TOP = 110, + AF_BLUE_STRING_DEVANAGARI_HEAD = 135, + AF_BLUE_STRING_DEVANAGARI_BOTTOM = 160, + AF_BLUE_STRING_GREEK_CAPITAL_TOP = 167, + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 182, + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 195, + AF_BLUE_STRING_GREEK_SMALL = 208, + AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 225, + AF_BLUE_STRING_HEBREW_TOP = 242, + AF_BLUE_STRING_HEBREW_BOTTOM = 259, + AF_BLUE_STRING_HEBREW_DESCENDER = 272, + AF_BLUE_STRING_LATIN_CAPITAL_TOP = 283, + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 292, + AF_BLUE_STRING_LATIN_SMALL_F_TOP = 301, + AF_BLUE_STRING_LATIN_SMALL = 309, + AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 317, + AF_BLUE_STRING_TELUGU_TOP = 323, + AF_BLUE_STRING_TELUGU_BOTTOM = 345, + AF_BLUE_STRING_THAI_TOP = 367, + AF_BLUE_STRING_THAI_BOTTOM = 386, + AF_BLUE_STRING_THAI_ASCENDER = 408, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 418, + AF_BLUE_STRING_THAI_DESCENDER = 428, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 441, + AF_BLUE_STRING_THAI_DIGIT_TOP = 448, + af_blue_1_1 = 457, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153, @@ -165,14 +166,14 @@ FT_BEGIN_HEADER typedef enum AF_Blue_Stringset_ { AF_BLUE_STRINGSET_ARAB = 0, - AF_BLUE_STRINGSET_CYRL = 3, - AF_BLUE_STRINGSET_DEVA = 9, - AF_BLUE_STRINGSET_GREK = 15, - AF_BLUE_STRINGSET_HEBR = 22, - AF_BLUE_STRINGSET_LATN = 26, - AF_BLUE_STRINGSET_TELU = 33, - AF_BLUE_STRINGSET_THAI = 36, - af_blue_2_1 = 44, + AF_BLUE_STRINGSET_CYRL = 4, + AF_BLUE_STRINGSET_DEVA = 10, + AF_BLUE_STRINGSET_GREK = 16, + AF_BLUE_STRINGSET_HEBR = 23, + AF_BLUE_STRINGSET_LATN = 27, + AF_BLUE_STRINGSET_TELU = 34, + AF_BLUE_STRINGSET_THAI = 37, + af_blue_2_1 = 45, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 2,