[autofit] Disunify Cyrillic and Greek handling from Latin.

* src/autofit/afscript.h: Add Cyrillic and Greek.

* src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK,
AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic.
(AF_BLUE_STRINGSET_LATN): Fix typo.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.

* src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New
arrays.
(af_grek_script_class, af_cyrl_script_class): New scripts.
* src/autofit/aflatin.h: Updated.
This commit is contained in:
Werner Lemberg 2013-09-22 22:37:26 +02:00
parent 2cca96694f
commit 5a4c5a5b23
7 changed files with 149 additions and 19 deletions

View File

@ -1,3 +1,19 @@
2013-09-22 Werner Lemberg <wl@gnu.org>
[autofit] Disunify Cyrillic and Greek handling from Latin.
* src/autofit/afscript.h: Add Cyrillic and Greek.
* src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK,
AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic.
(AF_BLUE_STRINGSET_LATN): Fix typo.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New
arrays.
(af_grek_script_class, af_cyrl_script_class): New scripts.
* src/autofit/aflatin.h: Updated.
2013-09-20 Werner Lemberg <wl@gnu.org>
* docs/CHANGES: Updated.

View File

@ -36,6 +36,24 @@
'\0',
'p', 'q', 'g', 'j', 'y', /* pqgjy */
'\0',
'\xCE', '\x93', '\xCE', '\x92', '\xCE', '\x95', '\xCE', '\x96', '\xCE', '\x98', '\xCE', '\x9F', '\xCE', '\xA9', /* ΓΒΕΖΘΟΩ */
'\0',
'\xCE', '\x92', '\xCE', '\x94', '\xCE', '\x96', '\xCE', '\x9E', '\xCE', '\x98', '\xCE', '\x9F', /* ΒΔΖΞΘΟ */
'\0',
'\xCE', '\xB2', '\xCE', '\xB8', '\xCE', '\xB4', '\xCE', '\xB6', '\xCE', '\xBB', '\xCE', '\xBE', /* βθδζλξ */
'\0',
'\xCE', '\xB1', '\xCE', '\xB5', '\xCE', '\xB9', '\xCE', '\xBF', '\xCF', '\x80', '\xCF', '\x83', '\xCF', '\x84', '\xCF', '\x89', /* αειοπστω */
'\0',
'\xCE', '\xB2', '\xCE', '\xB3', '\xCE', '\xB7', '\xCE', '\xBC', '\xCF', '\x81', '\xCF', '\x86', '\xCF', '\x87', '\xCF', '\x88', /* βγημρφχψ */
'\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', /* БВЕШЗОСЭ */
'\0',
'\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81', /* хпншезос */
'\0',
'\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84', /* руф */
'\0',
'\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', /* בדהחךכםס */
'\0',
'\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6', /* בטכםסצ */
@ -97,12 +115,27 @@
/* */
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_SMALL_TOP },
{ AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_SMALL, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_MINOR, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_SMALL_TOP },
{ AF_BLUE_STRING_GREEK_SMALL, 0 },
{ AF_BLUE_STRING_GREEK_SMALL_MINOR, 0 },
{ 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 |
AF_BLUE_PROPERTY_LATIN_SMALL_TOP },
{ AF_BLUE_STRING_CYRILLIC_SMALL, 0 },
{ AF_BLUE_STRING_CYRILLIC_SMALL_MINOR, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_LONG },
{ AF_BLUE_STRING_HEBREW_BOTTOM, 0 },

View File

@ -76,6 +76,26 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_LATIN_SMALL_MINOR
"pqgjy"
AF_BLUE_STRING_GREEK_CAPITAL_TOP
"ΓΒΕΖΘΟΩ"
AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
"ΒΔΖΞΘΟ"
AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
"βθδζλξ"
AF_BLUE_STRING_GREEK_SMALL
"αειοπστω"
AF_BLUE_STRING_GREEK_SMALL_MINOR
"βγημρφχψ"
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
"БВЕПЗОСЭ"
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
"БВЕШЗОСЭ"
AF_BLUE_STRING_CYRILLIC_SMALL
"хпншезос"
AF_BLUE_STRING_CYRILLIC_SMALL_MINOR
"руф"
AF_BLUE_STRING_HEBREW_TOP
"בדהחךכםס"
AF_BLUE_STRING_HEBREW_BOTTOM
@ -139,13 +159,32 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
AF_BLUE_STRINGSET_LATN
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_SMALL_TOP }
{ AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_SMALL, 0 }
{ AF_BLUE_STRING_LATIN_SMALL_MINOR, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GREK
{ AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_SMALL_TOP }
{ AF_BLUE_STRING_GREEK_SMALL, 0 }
{ AF_BLUE_STRING_GREEK_SMALL_MINOR, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CYRL
{ 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 |
AF_BLUE_PROPERTY_LATIN_SMALL_TOP }
{ AF_BLUE_STRING_CYRILLIC_SMALL, 0 }
{ AF_BLUE_STRING_CYRILLIC_SMALL_MINOR, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_HEBR
{ AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_LONG }

View File

@ -79,10 +79,19 @@ FT_BEGIN_HEADER
AF_BLUE_STRING_LATIN_SMALL_F_TOP = 18,
AF_BLUE_STRING_LATIN_SMALL = 26,
AF_BLUE_STRING_LATIN_SMALL_MINOR = 34,
AF_BLUE_STRING_HEBREW_TOP = 40,
AF_BLUE_STRING_HEBREW_BOTTOM = 57,
AF_BLUE_STRING_HEBREW_DESCENDER = 70,
af_blue_1_1 = 80,
AF_BLUE_STRING_GREEK_CAPITAL_TOP = 40,
AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 55,
AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 68,
AF_BLUE_STRING_GREEK_SMALL = 81,
AF_BLUE_STRING_GREEK_SMALL_MINOR = 98,
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 115,
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 132,
AF_BLUE_STRING_CYRILLIC_SMALL = 149,
AF_BLUE_STRING_CYRILLIC_SMALL_MINOR = 166,
AF_BLUE_STRING_HEBREW_TOP = 173,
AF_BLUE_STRING_HEBREW_BOTTOM = 190,
AF_BLUE_STRING_HEBREW_DESCENDER = 203,
af_blue_1_1 = 213,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRING_CJK_TOP_FILL = af_blue_1_1 + 1,
AF_BLUE_STRING_CJK_TOP_UNFILL = af_blue_1_1 + 77,
@ -145,8 +154,10 @@ FT_BEGIN_HEADER
typedef enum AF_Blue_Stringset_
{
AF_BLUE_STRINGSET_LATN = 0,
AF_BLUE_STRINGSET_HEBR = 7,
af_blue_2_1 = 11,
AF_BLUE_STRINGSET_GREK = 7,
AF_BLUE_STRINGSET_CYRL = 14,
AF_BLUE_STRINGSET_HEBR = 20,
af_blue_2_1 = 24,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
af_blue_2_1_1 = af_blue_2_1 + 4,

View File

@ -2647,23 +2647,17 @@
AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */
AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */
AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */
AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */
AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */
AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */
AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */
AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */
AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */
AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */
AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */
AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */
AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */
AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */
AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */
AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */
AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */
AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */
AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */
AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */
AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */
AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */
@ -2671,6 +2665,19 @@
AF_UNIRANGE_REC( 0UL, 0UL )
};
static const AF_Script_UniRangeRec af_grek_uniranges[] =
{
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */
AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */
};
static const AF_Script_UniRangeRec af_cyrl_uniranges[] =
{
AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */
AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */
AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */
AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */
};
static const AF_Script_UniRangeRec af_hebr_uniranges[] =
{
@ -2691,6 +2698,28 @@
'o'
)
AF_DEFINE_SCRIPT_CLASS(
af_grek_script_class,
AF_SCRIPT_GREK,
AF_BLUE_STRINGSET_GREK,
AF_WRITING_SYSTEM_LATIN,
af_grek_uniranges,
0x3BF /* ο */
)
AF_DEFINE_SCRIPT_CLASS(
af_cyrl_script_class,
AF_SCRIPT_CYRL,
AF_BLUE_STRINGSET_CYRL,
AF_WRITING_SYSTEM_LATIN,
af_cyrl_uniranges,
0x43E /* о */
)
AF_DEFINE_SCRIPT_CLASS(
af_hebr_script_class,

View File

@ -31,12 +31,12 @@ FT_BEGIN_HEADER
/* the latin-specific script classes */
AF_DECLARE_SCRIPT_CLASS( af_latn_script_class ) /* XXX */
AF_DECLARE_SCRIPT_CLASS( af_cyrl_script_class )
AF_DECLARE_SCRIPT_CLASS( af_grek_script_class )
AF_DECLARE_SCRIPT_CLASS( af_latn_script_class )
AF_DECLARE_SCRIPT_CLASS( af_hebr_script_class )
#if 0
AF_DECLARE_SCRIPT_CLASS( af_armn_script_class )
AF_DECLARE_SCRIPT_CLASS( af_cyrl_script_class )
AF_DECLARE_SCRIPT_CLASS( af_grek_script_class )
#endif

View File

@ -22,8 +22,10 @@
/* Add new scripts here. */
SCRIPT( cyrl, CYRL )
SCRIPT( deva, DEVA )
SCRIPT( dflt, DFLT )
SCRIPT( grek, GREK )
SCRIPT( hani, HANI )
SCRIPT( hebr, HEBR )
SCRIPT( latn, LATN )