diff options
author | Jungshik Shin <jungshik@google.com> | 2016-09-18 03:50:36 -0700 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2017-05-01 01:10:57 +0200 |
commit | c158e6ad29b5df89aa04417832cdfd750ce294b2 (patch) | |
tree | 546b0f704cc42b92feb2938a947560ef6ed57ce1 /src/autofit | |
parent | 0e222f91031c74e3e12b7df18d39a50dbe0c640a (diff) | |
download | android_external_freetype-cm-11.0.tar.gz android_external_freetype-cm-11.0.tar.bz2 android_external_freetype-cm-11.0.zip |
Update FreeType from 2.6.2 to c38be52bf8de (2.7 + a few post-2.7 CLs)cm-11.0
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=c38be52b
Keep all the configuration options as before.
Likewise, exclude unused files (Jamfiles, various mk files, builds/,
docs/, ChangeLog*, directories under src/ for disabled modules, etc).
Update README.android to record the configurations.
Besides, disable a new option (TT_CONFIG_OPTION_SUBPIXEL_HINTING) for
branches. Note that a bulk of changes in this CL come from the code to
implement this option.
BUG: 31470908
AOSP-Change-Id: I1ca90aec171d9580415b8531e2b767e9dd31164c
CVE-2016-10244
Change-Id: I4485d2ea543c52f8145ab23372cf3e5c7345879b
(cherry picked from commit 055aee28cedc3631434b2636fc6093c0d4d818ab)
Diffstat (limited to 'src/autofit')
41 files changed, 1843 insertions, 1349 deletions
diff --git a/src/autofit/afangles.c b/src/autofit/afangles.c index 1b1eb31..b856e57 100644 --- a/src/autofit/afangles.c +++ b/src/autofit/afangles.c @@ -5,7 +5,7 @@ /* Routines used to compute vector angles with limited accuracy */ /* and very high speed. It also contains sorting routines (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c index 104ee17..7719c02 100644 --- a/src/autofit/afblue.c +++ b/src/autofit/afblue.c @@ -7,7 +7,7 @@ /* */ /* Auto-fitter data for blue strings (body). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -32,6 +32,32 @@ '\0', '\xD9', '\x80', /* ـ */ '\0', + '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x8D', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ա Մ Ւ Ս Բ Գ Դ Օ */ + '\0', + '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Ւ Ո Դ Ճ Շ Ս Տ Օ */ + '\0', + '\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x86', ' ', '\xD5', '\xB3', /* ե է ի մ վ ֆ ճ */ + '\0', + '\xD5', '\xA1', ' ', '\xD5', '\xB5', ' ', '\xD6', '\x82', ' ', '\xD5', '\xBD', ' ', '\xD5', '\xA3', ' ', '\xD5', '\xB7', ' ', '\xD6', '\x80', ' ', '\xD6', '\x85', /* ա յ ւ ս գ շ ր օ */ + '\0', + '\xD5', '\xB0', ' ', '\xD5', '\xB8', ' ', '\xD5', '\xB3', ' ', '\xD5', '\xA1', ' ', '\xD5', '\xA5', ' ', '\xD5', '\xAE', ' ', '\xD5', '\xBD', ' ', '\xD6', '\x85', /* հ ո ճ ա ե ծ ս օ */ + '\0', + '\xD5', '\xA2', ' ', '\xD5', '\xA8', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xAC', ' ', '\xD5', '\xB2', ' ', '\xD5', '\xBA', ' ', '\xD6', '\x83', ' ', '\xD6', '\x81', /* բ ը ի լ ղ պ փ ց */ + '\0', + '\xE0', '\xA6', '\x85', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xAD', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* অ ড ত ন ব ভ ল ক */ + '\0', + '\xE0', '\xA6', '\x87', ' ', '\xE0', '\xA6', '\x9F', ' ', '\xE0', '\xA6', '\xA0', ' ', '\xE0', '\xA6', '\xBF', ' ', '\xE0', '\xA7', '\x80', ' ', '\xE0', '\xA7', '\x88', ' ', '\xE0', '\xA7', '\x97', /* ই ট ঠ ি ী ৈ ৗ */ + '\0', + '\xE0', '\xA6', '\x93', ' ', '\xE0', '\xA6', '\x8F', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* ও এ ড ত ন ব ল ক */ + '\0', + '\xE1', '\x8F', '\x86', ' ', '\xE1', '\x8E', '\xBB', ' ', '\xE1', '\x8E', '\xAC', ' ', '\xE1', '\x8F', '\x83', ' ', '\xE1', '\x8E', '\xA4', ' ', '\xE1', '\x8F', '\xA3', ' ', '\xE1', '\x8E', '\xA6', ' ', '\xE1', '\x8F', '\x95', /* Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ */ + '\0', + '\xEA', '\xAE', '\x92', ' ', '\xEA', '\xAE', '\xA4', ' ', '\xEA', '\xAE', '\xB6', ' ', '\xEA', '\xAD', '\xB4', ' ', '\xEA', '\xAD', '\xBE', ' ', '\xEA', '\xAE', '\x97', ' ', '\xEA', '\xAE', '\x9D', ' ', '\xEA', '\xAE', '\xBF', /* ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ */ + '\0', + '\xEA', '\xAE', '\x96', ' ', '\xEA', '\xAD', '\xBC', ' ', '\xEA', '\xAE', '\x93', ' ', '\xEA', '\xAE', '\xA0', ' ', '\xEA', '\xAE', '\xB3', ' ', '\xEA', '\xAD', '\xB6', ' ', '\xEA', '\xAE', '\xA5', ' ', '\xEA', '\xAE', '\xBB', /* ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ */ + '\0', + '\xE1', '\x8F', '\xB8', ' ', '\xEA', '\xAE', '\x90', ' ', '\xEA', '\xAD', '\xB9', ' ', '\xEA', '\xAD', '\xBB', /* ᏸ ꮐ ꭹ ꭻ */ + '\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', /* Б В Е Ш З О С Э */ @@ -48,6 +74,30 @@ '\0', '\xE0', '\xA5', '\x81', ' ', '\xE0', '\xA5', '\x83', /* ु ृ */ '\0', + '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\x83', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x8D', '\x90', ' ', '\xE1', '\x88', '\x9B', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x8B', ' ', '\xE1', '\x8B', '\x90', /* ሀ ሃ ዘ ፐ ማ በ ዋ ዐ */ + '\0', + '\xE1', '\x88', '\x88', ' ', '\xE1', '\x88', '\x90', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\xAA', ' ', '\xE1', '\x8B', '\x90', ' ', '\xE1', '\x8C', '\xA8', /* ለ ሐ በ ዘ ሀ ሪ ዐ ጨ */ + '\0', + '\xE1', '\x83', '\x92', ' ', '\xE1', '\x83', '\x93', ' ', '\xE1', '\x83', '\x94', ' ', '\xE1', '\x83', '\x95', ' ', '\xE1', '\x83', '\x97', ' ', '\xE1', '\x83', '\x98', ' ', '\xE1', '\x83', '\x9D', ' ', '\xE1', '\x83', '\xA6', /* გ დ ე ვ თ ი ო ღ */ + '\0', + '\xE1', '\x83', '\x90', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xAB', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\x9E', /* ა ზ მ ს შ ძ ხ პ */ + '\0', + '\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\xA5', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xA9', ' ', '\xE1', '\x83', '\xAC', /* ს ხ ქ ზ მ შ ჩ წ */ + '\0', + '\xE1', '\x83', '\x94', ' ', '\xE1', '\x83', '\x95', ' ', '\xE1', '\x83', '\x9F', ' ', '\xE1', '\x83', '\xA2', ' ', '\xE1', '\x83', '\xA3', ' ', '\xE1', '\x83', '\xA4', ' ', '\xE1', '\x83', '\xA5', ' ', '\xE1', '\x83', '\xA7', /* ე ვ ჟ ტ უ ფ ქ ყ */ + '\0', + '\xE1', '\x82', '\xB1', ' ', '\xE1', '\x82', '\xA7', ' ', '\xE1', '\x82', '\xB9', ' ', '\xE1', '\x82', '\xBC', ' ', '\xE1', '\x82', '\xA4', ' ', '\xE1', '\x82', '\xA5', ' ', '\xE1', '\x82', '\xB3', ' ', '\xE1', '\x82', '\xBA', /* Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ */ + '\0', + '\xE1', '\x82', '\xA4', ' ', '\xE1', '\x82', '\xA5', ' ', '\xE1', '\x82', '\xA7', ' ', '\xE1', '\x82', '\xA8', ' ', '\xE1', '\x82', '\xA6', ' ', '\xE1', '\x82', '\xB1', ' ', '\xE1', '\x82', '\xAA', ' ', '\xE1', '\x82', '\xAB', /* Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ */ + '\0', + '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x97', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x87', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x96', /* ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ */ + '\0', + '\xE2', '\xB4', '\x88', ' ', '\xE2', '\xB4', '\x8C', ' ', '\xE2', '\xB4', '\x96', ' ', '\xE2', '\xB4', '\x8E', ' ', '\xE2', '\xB4', '\x83', ' ', '\xE2', '\xB4', '\x86', ' ', '\xE2', '\xB4', '\x8B', ' ', '\xE2', '\xB4', '\xA2', /* ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ */ + '\0', + '\xE2', '\xB4', '\x90', ' ', '\xE2', '\xB4', '\x91', ' ', '\xE2', '\xB4', '\x93', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x99', ' ', '\xE2', '\xB4', '\x9B', ' ', '\xE2', '\xB4', '\xA1', ' ', '\xE2', '\xB4', '\xA3', /* ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ */ + '\0', + '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ */ + '\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', /* Β Δ Ζ Ξ Θ Ο */ @@ -58,12 +108,36 @@ '\0', '\xCE', '\xB2', ' ', '\xCE', '\xB3', ' ', '\xCE', '\xB7', ' ', '\xCE', '\xBC', ' ', '\xCF', '\x81', ' ', '\xCF', '\x86', ' ', '\xCF', '\x87', ' ', '\xCF', '\x88', /* β γ η μ ρ φ χ ψ */ '\0', + '\xE0', '\xAA', '\xA4', ' ', '\xE0', '\xAA', '\xA8', ' ', '\xE0', '\xAA', '\x8B', ' ', '\xE0', '\xAA', '\x8C', ' ', '\xE0', '\xAA', '\x9B', ' ', '\xE0', '\xAA', '\x9F', ' ', '\xE0', '\xAA', '\xB0', ' ', '\xE0', '\xAB', '\xA6', /* ત ન ઋ ઌ છ ટ ર ૦ */ + '\0', + '\xE0', '\xAA', '\x96', ' ', '\xE0', '\xAA', '\x97', ' ', '\xE0', '\xAA', '\x98', ' ', '\xE0', '\xAA', '\x9E', ' ', '\xE0', '\xAA', '\x87', ' ', '\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\xA0', ' ', '\xE0', '\xAA', '\x9C', /* ખ ગ ઘ ઞ ઇ ઈ ઠ જ */ + '\0', + '\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\x8A', ' ', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB2', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB6', '\xE0', '\xAB', '\x8D', '\xE0', '\xAA', '\x9A', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\x9C', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\xB8', '\xE0', '\xAB', '\x80', /* ઈ ઊ િ ી લી શ્ચિ જિ સી */ + '\0', + '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAB', '\x84', ' ', '\xE0', '\xAA', '\x96', '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x84', /* ુ ૃ ૄ ખુ છૃ છૄ */ + '\0', + '\xE0', '\xAB', '\xA6', ' ', '\xE0', '\xAB', '\xA7', ' ', '\xE0', '\xAB', '\xA8', ' ', '\xE0', '\xAB', '\xA9', ' ', '\xE0', '\xAB', '\xAD', /* ૦ ૧ ૨ ૩ ૭ */ + '\0', + '\xE0', '\xA8', '\x95', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x99', ' ', '\xE0', '\xA8', '\x9A', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA4', ' ', '\xE0', '\xA8', '\xA7', ' ', '\xE0', '\xA8', '\xB8', /* ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ */ + '\0', + '\xE0', '\xA8', '\x95', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x99', ' ', '\xE0', '\xA8', '\x9A', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA4', ' ', '\xE0', '\xA8', '\xA7', ' ', '\xE0', '\xA8', '\xB8', /* ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ */ + '\0', + '\xE0', '\xA8', '\x87', ' ', '\xE0', '\xA8', '\x88', ' ', '\xE0', '\xA8', '\x89', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA9', '\xB3', ' ', '\xE0', '\xA8', '\xBF', ' ', '\xE0', '\xA9', '\x80', /* ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ */ + '\0', + '\xE0', '\xA8', '\x85', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA0', ' ', '\xE0', '\xA8', '\xB0', ' ', '\xE0', '\xA8', '\xB8', /* ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ */ + '\0', + '\xE0', '\xA9', '\xA6', ' ', '\xE0', '\xA9', '\xA7', ' ', '\xE0', '\xA9', '\xA8', ' ', '\xE0', '\xA9', '\xA9', ' ', '\xE0', '\xA9', '\xAD', /* ੦ ੧ ੨ ੩ ੭ */ + '\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', /* ב ט כ ם ס צ */ '\0', '\xD7', '\xA7', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9F', ' ', '\xD7', '\xA3', ' ', '\xD7', '\xA5', /* ק ך ן ף ץ */ '\0', + '\xE0', '\xB2', '\x87', ' ', '\xE0', '\xB2', '\x8A', ' ', '\xE0', '\xB2', '\x90', ' ', '\xE0', '\xB2', '\xA3', ' ', '\xE0', '\xB2', '\xB8', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xA8', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xA6', '\xE0', '\xB2', '\xBE', ' ', '\xE0', '\xB2', '\xB0', '\xE0', '\xB2', '\xBE', /* ಇ ಊ ಐ ಣ ಸಾ ನಾ ದಾ ರಾ */ + '\0', + '\xE0', '\xB2', '\x85', ' ', '\xE0', '\xB2', '\x89', ' ', '\xE0', '\xB2', '\x8E', ' ', '\xE0', '\xB2', '\xB2', ' ', '\xE0', '\xB3', '\xA6', ' ', '\xE0', '\xB3', '\xA8', ' ', '\xE0', '\xB3', '\xAC', ' ', '\xE0', '\xB3', '\xAD', /* ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭ */ + '\0', '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x91', ' ', '\xE1', '\x9E', '\x93', ' ', '\xE1', '\x9E', '\xA7', ' ', '\xE1', '\x9E', '\xA9', ' ', '\xE1', '\x9E', '\xB6', /* ខ ទ ន ឧ ឩ ា */ '\0', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x80', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x82', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x90', /* ក្ក ក្ខ ក្គ ក្ថ */ @@ -118,6 +192,10 @@ '\0', '\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ ᵍ */ '\0', + '\xE0', '\xB4', '\x92', ' ', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xB1', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', ' ', '\xE0', '\xB4', '\x9A', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\xAA', /* ഒ ട ഠ റ ച പ ച്ച പ്പ */ + '\0', + '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2', /* ട ഠ ധ ശ ഘ ച ഥ ല */ + '\0', '\xE1', '\x80', '\x81', ' ', '\xE1', '\x80', '\x82', ' ', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\xA5', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* ခ ဂ င ဒ ဝ ၥ ၊ ။ */ '\0', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x8E', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x95', ' ', '\xE1', '\x80', '\x97', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* င ဎ ဒ ပ ဗ ဝ ၊ ။ */ @@ -126,6 +204,16 @@ '\0', '\xE1', '\x80', '\x89', ' ', '\xE1', '\x80', '\x8A', ' ', '\xE1', '\x80', '\xA5', ' ', '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xA8', ' ', '\xE1', '\x81', '\x82', ' ', '\xE1', '\x81', '\x85', ' ', '\xE1', '\x81', '\x89', /* ဉ ည ဥ ဩ ဨ ၂ ၅ ၉ */ '\0', + '\xE0', '\xB6', '\x89', ' ', '\xE0', '\xB6', '\x9A', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\xB4', ' ', '\xE0', '\xB6', '\xBA', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB7', '\x86', /* ඉ ක ඝ ඳ ප ය ල ෆ */ + '\0', + '\xE0', '\xB6', '\x91', ' ', '\xE0', '\xB6', '\x94', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xA2', ' ', '\xE0', '\xB6', '\xA7', ' ', '\xE0', '\xB6', '\xAE', ' ', '\xE0', '\xB6', '\xB0', ' ', '\xE0', '\xB6', '\xBB', /* එ ඔ ඝ ජ ට ථ ධ ර */ + '\0', + '\xE0', '\xB6', '\xAF', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\x8B', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x96', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xB6', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xAF', '\xE0', '\xB7', '\x94', /* ද ඳ උ ල තූ තු බු දු */ + '\0', + '\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x92', ' ', '\xE0', '\xAE', '\x93', ' ', '\xE0', '\xAE', '\xB1', ' ', '\xE0', '\xAE', '\x88', ' ', '\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9A', /* உ ஒ ஓ ற ஈ க ங ச */ + '\0', + '\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x9A', ' ', '\xE0', '\xAE', '\xB2', ' ', '\xE0', '\xAE', '\xB6', ' ', '\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9F', ' ', '\xE0', '\xAE', '\xAA', /* க ச ல ஶ உ ங ட ப */ + '\0', '\xE0', '\xB0', '\x87', ' ', '\xE0', '\xB0', '\x8C', ' ', '\xE0', '\xB0', '\x99', ' ', '\xE0', '\xB0', '\x9E', ' ', '\xE0', '\xB0', '\xA3', ' ', '\xE0', '\xB0', '\xB1', ' ', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */ '\0', '\xE0', '\xB0', '\x85', ' ', '\xE0', '\xB0', '\x95', ' ', '\xE0', '\xB0', '\x9A', ' ', '\xE0', '\xB0', '\xB0', ' ', '\xE0', '\xB0', '\xBD', ' ', '\xE0', '\xB1', '\xA8', ' ', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */ @@ -197,6 +285,29 @@ { AF_BLUE_STRING_ARABIC_BOTTOM, 0 }, { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 }, + { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_BENGALI_BASE, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 }, + { AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_CHEROKEE_SMALL, 0 }, + { AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 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 | @@ -212,6 +323,23 @@ { AF_BLUE_STRING_DEVANAGARI_BASE, 0 }, { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 }, + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 }, + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 }, + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 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 }, @@ -220,11 +348,29 @@ { AF_BLUE_STRING_GREEK_SMALL, 0 }, { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GUJARATI_BOTTOM, 0 }, + { AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GUJARATI_DESCENDER, 0 }, + { AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 }, + { AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { 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 }, { AF_BLUE_STRING_HEBREW_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_KANNADA_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_KHMER_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP, AF_BLUE_PROPERTY_LATIN_SUB_TOP }, @@ -236,13 +382,13 @@ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_LAO_BOTTOM, 0 }, - { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LAO_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_LAO_BOTTOM, 0 }, + { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LAO_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { 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 }, @@ -267,12 +413,23 @@ { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }, { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_MYANMAR_BOTTOM, 0 }, { AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MYANMAR_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_SINHALA_BOTTOM, 0 }, + { AF_BLUE_STRING_SINHALA_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_TAMIL_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_TELUGU_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, diff --git a/src/autofit/afblue.cin b/src/autofit/afblue.cin index b303a4b..0c3cae8 100644 --- a/src/autofit/afblue.cin +++ b/src/autofit/afblue.cin @@ -4,7 +4,7 @@ /* */ /* Auto-fitter data for blue strings (body). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/afblue.dat b/src/autofit/afblue.dat index 5ffb852..f5f04f2 100644 --- a/src/autofit/afblue.dat +++ b/src/autofit/afblue.dat @@ -2,7 +2,7 @@ // // Auto-fitter data for blue strings. // -// Copyright 2013-2015 by +// Copyright 2013-2016 by // David Turner, Robert Wilhelm, and Werner Lemberg. // // This file is part of the FreeType project, and may only be used, @@ -65,8 +65,8 @@ // values; this essentially means that the maximum values can easily be too // large. Given that the purpose of those values is to create local // fixed-size arrays at compile time for further processing of the blue zone -// data, this isn't a problem. Note the the final zero byte of a string is -// not counted. Note also that the count holds the number of UTF-8 encoded +// data, this isn't a problem. Note the final zero byte of a string is not +// counted. Note also that the count holds the number of UTF-8 encoded // characters, not bytes. @@ -86,6 +86,35 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_ARABIC_JOIN "ـ" + AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP + "Ա Մ Ւ Ս Բ Գ Դ Օ" + AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM + "Ւ Ո Դ Ճ Շ Ս Տ Օ" + AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER + "ե է ի մ վ ֆ ճ" + AF_BLUE_STRING_ARMENIAN_SMALL_TOP + "ա յ ւ ս գ շ ր օ" + AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM + "հ ո ճ ա ե ծ ս օ" + AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER + "բ ը ի լ ղ պ փ ց" + + AF_BLUE_STRING_BENGALI_BASE + "অ ড ত ন ব ভ ল ক" + AF_BLUE_STRING_BENGALI_TOP + "ই ট ঠ ি ী ৈ ৗ" + AF_BLUE_STRING_BENGALI_HEAD + "ও এ ড ত ন ব ল ক" + + AF_BLUE_STRING_CHEROKEE_CAPITAL + "Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ" + AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER + "ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ" + AF_BLUE_STRING_CHEROKEE_SMALL + "ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ" + AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER + "ᏸ ꮐ ꭹ ꭻ" + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP "Б В Е П З О С Э" AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM @@ -107,6 +136,34 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_DEVANAGARI_BOTTOM "ु ृ" + AF_BLUE_STRING_ETHIOPIC_TOP + "ሀ ሃ ዘ ፐ ማ በ ዋ ዐ" + AF_BLUE_STRING_ETHIOPIC_BOTTOM + "ለ ሐ በ ዘ ሀ ሪ ዐ ጨ" + + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP + "გ დ ე ვ თ ი ო ღ" + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM + "ა ზ მ ს შ ძ ხ პ" + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER + "ს ხ ქ ზ მ შ ჩ წ" + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER + "ე ვ ჟ ტ უ ფ ქ ყ" + + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP + "Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ" + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM + "Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ" + + AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP + "ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ" + AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM + "ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ" + AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER + "ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ" + AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER + "ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ" + AF_BLUE_STRING_GREEK_CAPITAL_TOP "Γ Β Ε Ζ Θ Ο Ω" AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM @@ -118,6 +175,28 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_GREEK_SMALL_DESCENDER "β γ η μ ρ φ χ ψ" + AF_BLUE_STRING_GUJARATI_TOP + "ત ન ઋ ઌ છ ટ ર ૦" + AF_BLUE_STRING_GUJARATI_BOTTOM + "ખ ગ ઘ ઞ ઇ ઈ ઠ જ" + AF_BLUE_STRING_GUJARATI_ASCENDER + "ઈ ઊ િ ી લી શ્ચિ જિ સી" + AF_BLUE_STRING_GUJARATI_DESCENDER + "ુ ૃ ૄ ખુ છૃ છૄ" + AF_BLUE_STRING_GUJARATI_DIGIT_TOP + "૦ ૧ ૨ ૩ ૭" + + AF_BLUE_STRING_GURMUKHI_BASE + "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ" + AF_BLUE_STRING_GURMUKHI_HEAD + "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ" + AF_BLUE_STRING_GURMUKHI_TOP + "ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ" + AF_BLUE_STRING_GURMUKHI_BOTTOM + "ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ" + AF_BLUE_STRING_GURMUKHI_DIGIT_TOP + "੦ ੧ ੨ ੩ ੭" + AF_BLUE_STRING_HEBREW_TOP "ב ד ה ח ך כ ם ס" AF_BLUE_STRING_HEBREW_BOTTOM @@ -125,6 +204,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_HEBREW_DESCENDER "ק ך ן ף ץ" + AF_BLUE_STRING_KANNADA_TOP + "ಇ ಊ ಐ ಣ ಸಾ ನಾ ದಾ ರಾ" + AF_BLUE_STRING_KANNADA_BOTTOM + "ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭" + AF_BLUE_STRING_KHMER_TOP "ខ ទ ន ឧ ឩ ា" AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP @@ -188,6 +272,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER "ᵖ ʸ ᵍ" + AF_BLUE_STRING_MALAYALAM_TOP + "ഒ ട ഠ റ ച പ ച്ച പ്പ" + AF_BLUE_STRING_MALAYALAM_BOTTOM + "ട ഠ ധ ശ ഘ ച ഥ ല" + AF_BLUE_STRING_MYANMAR_TOP "ခ ဂ င ဒ ဝ ၥ ၊ ။" AF_BLUE_STRING_MYANMAR_BOTTOM @@ -197,6 +286,18 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_MYANMAR_DESCENDER "ဉ ည ဥ ဩ ဨ ၂ ၅ ၉" + AF_BLUE_STRING_SINHALA_TOP + "ඉ ක ඝ ඳ ප ය ල ෆ" + AF_BLUE_STRING_SINHALA_BOTTOM + "එ ඔ ඝ ජ ට ථ ධ ර" + AF_BLUE_STRING_SINHALA_DESCENDER + "ද ඳ උ ල තූ තු බු දු" + + AF_BLUE_STRING_TAMIL_TOP + "உ ஒ ஓ ற ஈ க ங ச" + AF_BLUE_STRING_TAMIL_BOTTOM + "க ச ல ஶ உ ங ட ப" + AF_BLUE_STRING_TELUGU_TOP "ఇ ఌ ఙ ఞ ణ ఱ ౯" AF_BLUE_STRING_TELUGU_BOTTOM @@ -388,6 +489,35 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_ARMN + { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_BENG + { AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_BENGALI_BASE, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CHER + { AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 } + { AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CHEROKEE_SMALL, 0 } + { AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 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 } @@ -407,6 +537,30 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_ETHI + { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + // blue zones for Mtavruli are missing (not yet defined in Unicode) + AF_BLUE_STRINGSET_GEOR + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 } + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GEOK + { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 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 } @@ -417,6 +571,25 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_GUJR + { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GUJARATI_BOTTOM, 0 } + { AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GUJARATI_DESCENDER, 0 } + { AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GURU + { AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 } + { AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_HEBR { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_LONG } @@ -424,6 +597,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_HEBREW_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_KNDA + { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_KANNADA_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_KHMR { AF_BLUE_STRING_KHMER_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT } @@ -440,13 +618,13 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_LAO - { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LAO_BOTTOM, 0 } - { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LAO_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LAO_BOTTOM, 0 } + { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LAO_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_LATN { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -478,6 +656,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_MLYM + { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_MYMR { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT } @@ -486,6 +669,20 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MYANMAR_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_NONE + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_SINH + { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_SINHALA_BOTTOM, 0 } + { AF_BLUE_STRING_SINHALA_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_TAML + { AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TAMIL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_TELU { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_TELUGU_BOTTOM, 0 } diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h index 34f90e9..75c3ab5 100644 --- a/src/autofit/afblue.h +++ b/src/autofit/afblue.h @@ -7,7 +7,7 @@ /* */ /* Auto-fitter data for blue strings (specification). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,8 +19,8 @@ /***************************************************************************/ -#ifndef __AFBLUE_H__ -#define __AFBLUE_H__ +#ifndef AFBLUE_H_ +#define AFBLUE_H_ FT_BEGIN_HEADER @@ -80,63 +80,107 @@ FT_BEGIN_HEADER AF_BLUE_STRING_ARABIC_TOP = 0, AF_BLUE_STRING_ARABIC_BOTTOM = 18, AF_BLUE_STRING_ARABIC_JOIN = 33, - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 36, - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 60, - AF_BLUE_STRING_CYRILLIC_SMALL = 84, - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 108, - AF_BLUE_STRING_DEVANAGARI_BASE = 117, - AF_BLUE_STRING_DEVANAGARI_TOP = 149, - AF_BLUE_STRING_DEVANAGARI_HEAD = 181, - AF_BLUE_STRING_DEVANAGARI_BOTTOM = 213, - AF_BLUE_STRING_GREEK_CAPITAL_TOP = 221, - AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 242, - AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 260, - AF_BLUE_STRING_GREEK_SMALL = 278, - AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 302, - AF_BLUE_STRING_HEBREW_TOP = 326, - AF_BLUE_STRING_HEBREW_BOTTOM = 350, - AF_BLUE_STRING_HEBREW_DESCENDER = 368, - AF_BLUE_STRING_KHMER_TOP = 383, - AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 407, - AF_BLUE_STRING_KHMER_BOTTOM = 447, - AF_BLUE_STRING_KHMER_DESCENDER = 479, - AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 513, - AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 600, - AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 608, - AF_BLUE_STRING_LAO_TOP = 616, - AF_BLUE_STRING_LAO_BOTTOM = 648, - AF_BLUE_STRING_LAO_ASCENDER = 680, - AF_BLUE_STRING_LAO_LARGE_ASCENDER = 696, - AF_BLUE_STRING_LAO_DESCENDER = 708, - AF_BLUE_STRING_LATIN_CAPITAL_TOP = 732, - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 748, - AF_BLUE_STRING_LATIN_SMALL_F_TOP = 764, - AF_BLUE_STRING_LATIN_SMALL = 778, - AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 792, - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 802, - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 822, - AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 842, - AF_BLUE_STRING_LATIN_SUBS_SMALL = 862, - AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 898, - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 918, - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 949, - AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 978, - AF_BLUE_STRING_LATIN_SUPS_SMALL = 1004, - AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 1029, - AF_BLUE_STRING_MYANMAR_TOP = 1040, - AF_BLUE_STRING_MYANMAR_BOTTOM = 1072, - AF_BLUE_STRING_MYANMAR_ASCENDER = 1104, - AF_BLUE_STRING_MYANMAR_DESCENDER = 1132, - AF_BLUE_STRING_TELUGU_TOP = 1164, - AF_BLUE_STRING_TELUGU_BOTTOM = 1192, - AF_BLUE_STRING_THAI_TOP = 1220, - AF_BLUE_STRING_THAI_BOTTOM = 1244, - AF_BLUE_STRING_THAI_ASCENDER = 1272, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1284, - AF_BLUE_STRING_THAI_DESCENDER = 1296, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1312, - AF_BLUE_STRING_THAI_DIGIT_TOP = 1320, - af_blue_1_1 = 1331, + AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP = 36, + AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM = 60, + AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER = 84, + AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 105, + AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 129, + AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 153, + AF_BLUE_STRING_BENGALI_BASE = 177, + AF_BLUE_STRING_BENGALI_TOP = 209, + AF_BLUE_STRING_BENGALI_HEAD = 237, + AF_BLUE_STRING_CHEROKEE_CAPITAL = 269, + AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 301, + AF_BLUE_STRING_CHEROKEE_SMALL = 333, + AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 365, + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 381, + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 405, + AF_BLUE_STRING_CYRILLIC_SMALL = 429, + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 453, + AF_BLUE_STRING_DEVANAGARI_BASE = 462, + AF_BLUE_STRING_DEVANAGARI_TOP = 494, + AF_BLUE_STRING_DEVANAGARI_HEAD = 526, + AF_BLUE_STRING_DEVANAGARI_BOTTOM = 558, + AF_BLUE_STRING_ETHIOPIC_TOP = 566, + AF_BLUE_STRING_ETHIOPIC_BOTTOM = 598, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 630, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 662, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 694, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 726, + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 758, + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 790, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 822, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 854, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 886, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 918, + AF_BLUE_STRING_GREEK_CAPITAL_TOP = 950, + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 971, + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 989, + AF_BLUE_STRING_GREEK_SMALL = 1007, + AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 1031, + AF_BLUE_STRING_GUJARATI_TOP = 1055, + AF_BLUE_STRING_GUJARATI_BOTTOM = 1087, + AF_BLUE_STRING_GUJARATI_ASCENDER = 1119, + AF_BLUE_STRING_GUJARATI_DESCENDER = 1169, + AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 1202, + AF_BLUE_STRING_GURMUKHI_BASE = 1222, + AF_BLUE_STRING_GURMUKHI_HEAD = 1254, + AF_BLUE_STRING_GURMUKHI_TOP = 1286, + AF_BLUE_STRING_GURMUKHI_BOTTOM = 1318, + AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 1350, + AF_BLUE_STRING_HEBREW_TOP = 1370, + AF_BLUE_STRING_HEBREW_BOTTOM = 1394, + AF_BLUE_STRING_HEBREW_DESCENDER = 1412, + AF_BLUE_STRING_KANNADA_TOP = 1427, + AF_BLUE_STRING_KANNADA_BOTTOM = 1471, + AF_BLUE_STRING_KHMER_TOP = 1503, + AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 1527, + AF_BLUE_STRING_KHMER_BOTTOM = 1567, + AF_BLUE_STRING_KHMER_DESCENDER = 1599, + AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 1633, + AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 1720, + AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 1728, + AF_BLUE_STRING_LAO_TOP = 1736, + AF_BLUE_STRING_LAO_BOTTOM = 1768, + AF_BLUE_STRING_LAO_ASCENDER = 1800, + AF_BLUE_STRING_LAO_LARGE_ASCENDER = 1816, + AF_BLUE_STRING_LAO_DESCENDER = 1828, + AF_BLUE_STRING_LATIN_CAPITAL_TOP = 1852, + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 1868, + AF_BLUE_STRING_LATIN_SMALL_F_TOP = 1884, + AF_BLUE_STRING_LATIN_SMALL = 1898, + AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 1912, + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 1922, + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 1942, + AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1962, + AF_BLUE_STRING_LATIN_SUBS_SMALL = 1982, + AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 2018, + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 2038, + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 2069, + AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 2098, + AF_BLUE_STRING_LATIN_SUPS_SMALL = 2124, + AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 2149, + AF_BLUE_STRING_MALAYALAM_TOP = 2160, + AF_BLUE_STRING_MALAYALAM_BOTTOM = 2204, + AF_BLUE_STRING_MYANMAR_TOP = 2236, + AF_BLUE_STRING_MYANMAR_BOTTOM = 2268, + AF_BLUE_STRING_MYANMAR_ASCENDER = 2300, + AF_BLUE_STRING_MYANMAR_DESCENDER = 2328, + AF_BLUE_STRING_SINHALA_TOP = 2360, + AF_BLUE_STRING_SINHALA_BOTTOM = 2392, + AF_BLUE_STRING_SINHALA_DESCENDER = 2424, + AF_BLUE_STRING_TAMIL_TOP = 2468, + AF_BLUE_STRING_TAMIL_BOTTOM = 2500, + AF_BLUE_STRING_TELUGU_TOP = 2532, + AF_BLUE_STRING_TELUGU_BOTTOM = 2560, + AF_BLUE_STRING_THAI_TOP = 2588, + AF_BLUE_STRING_THAI_BOTTOM = 2612, + AF_BLUE_STRING_THAI_ASCENDER = 2640, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 2652, + AF_BLUE_STRING_THAI_DESCENDER = 2664, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 2680, + AF_BLUE_STRING_THAI_DIGIT_TOP = 2688, + af_blue_1_1 = 2699, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, @@ -196,20 +240,33 @@ FT_BEGIN_HEADER typedef enum AF_Blue_Stringset_ { AF_BLUE_STRINGSET_ARAB = 0, - AF_BLUE_STRINGSET_CYRL = 4, - AF_BLUE_STRINGSET_DEVA = 10, - AF_BLUE_STRINGSET_GREK = 16, - AF_BLUE_STRINGSET_HEBR = 23, - AF_BLUE_STRINGSET_KHMR = 27, - AF_BLUE_STRINGSET_KHMS = 33, - AF_BLUE_STRINGSET_LAO = 36, - AF_BLUE_STRINGSET_LATN = 42, - AF_BLUE_STRINGSET_LATB = 49, - AF_BLUE_STRINGSET_LATP = 56, - AF_BLUE_STRINGSET_MYMR = 63, - AF_BLUE_STRINGSET_TELU = 68, - AF_BLUE_STRINGSET_THAI = 71, - af_blue_2_1 = 79, + AF_BLUE_STRINGSET_ARMN = 4, + AF_BLUE_STRINGSET_BENG = 11, + AF_BLUE_STRINGSET_CHER = 16, + AF_BLUE_STRINGSET_CYRL = 23, + AF_BLUE_STRINGSET_DEVA = 29, + AF_BLUE_STRINGSET_ETHI = 35, + AF_BLUE_STRINGSET_GEOR = 38, + AF_BLUE_STRINGSET_GEOK = 43, + AF_BLUE_STRINGSET_GREK = 50, + AF_BLUE_STRINGSET_GUJR = 57, + AF_BLUE_STRINGSET_GURU = 63, + AF_BLUE_STRINGSET_HEBR = 69, + AF_BLUE_STRINGSET_KNDA = 73, + AF_BLUE_STRINGSET_KHMR = 76, + AF_BLUE_STRINGSET_KHMS = 82, + AF_BLUE_STRINGSET_LAO = 85, + AF_BLUE_STRINGSET_LATN = 91, + AF_BLUE_STRINGSET_LATB = 98, + AF_BLUE_STRINGSET_LATP = 105, + AF_BLUE_STRINGSET_MLYM = 112, + AF_BLUE_STRINGSET_MYMR = 115, + AF_BLUE_STRINGSET_NONE = 120, + AF_BLUE_STRINGSET_SINH = 121, + AF_BLUE_STRINGSET_TAML = 125, + AF_BLUE_STRINGSET_TELU = 128, + AF_BLUE_STRINGSET_THAI = 131, + af_blue_2_1 = 139, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 2, @@ -245,7 +302,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFBLUE_H__ */ +#endif /* AFBLUE_H_ */ /* END */ diff --git a/src/autofit/afblue.hin b/src/autofit/afblue.hin index 1eb9172..dd44e77 100644 --- a/src/autofit/afblue.hin +++ b/src/autofit/afblue.hin @@ -4,7 +4,7 @@ /* */ /* Auto-fitter data for blue strings (specification). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFBLUE_H__ -#define __AFBLUE_H__ +#ifndef AFBLUE_H_ +#define AFBLUE_H_ FT_BEGIN_HEADER @@ -140,7 +140,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFBLUE_H__ */ +#endif /* AFBLUE_H_ */ /* END */ diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 73d75ae..4823c1d 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK writing system (body). */ /* */ -/* Copyright 2006-2015 by */ +/* Copyright 2006-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -104,7 +104,7 @@ const char* p; #ifdef FT_DEBUG_LEVEL_TRACE - FT_ULong ch; + FT_ULong ch = 0; #endif p = script_class->standard_charstring; @@ -966,15 +966,12 @@ if ( seg2 ) { - seg2->num_linked++; if ( seg2->link != seg1 ) { seg1->link = NULL; if ( seg2->score < dist_threshold || seg1->score < seg2->score * 4 ) seg1->serif = seg2->link; - else - seg2->num_linked--; } } } @@ -1091,7 +1088,7 @@ /* insert a new edge in the list and */ /* sort according to the position */ error = af_axis_hints_new_edge( axis, seg->pos, - (AF_Direction)seg->dir, + (AF_Direction)seg->dir, 0, memory, &edge ); if ( error ) goto Exit; @@ -1528,7 +1525,7 @@ } if ( dist < 54 ) - dist += ( 54 - dist ) / 2 ; + dist += ( 54 - dist ) / 2; else if ( dist < 3 * 64 ) { FT_Pos delta; diff --git a/src/autofit/afcjk.h b/src/autofit/afcjk.h index e395e74..40d1184 100644 --- a/src/autofit/afcjk.h +++ b/src/autofit/afcjk.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK writing system (specification). */ /* */ -/* Copyright 2006-2015 by */ +/* Copyright 2006-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFCJK_H__ -#define __AFCJK_H__ +#ifndef AFCJK_H_ +#define AFCJK_H_ #include "afhints.h" #include "aflatin.h" @@ -135,7 +135,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFCJK_H__ */ +#endif /* AFCJK_H_ */ /* END */ diff --git a/src/autofit/afcover.h b/src/autofit/afcover.h index 520e8a4..1c39a70 100644 --- a/src/autofit/afcover.h +++ b/src/autofit/afcover.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter coverages (specification only). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/afdummy.c b/src/autofit/afdummy.c index 9142c78..f3960c8 100644 --- a/src/autofit/afdummy.c +++ b/src/autofit/afdummy.c @@ -5,7 +5,7 @@ /* Auto-fitter dummy routines to be used if no hinting should be */ /* performed (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/afdummy.h b/src/autofit/afdummy.h index b4fdc78..7e58d1a 100644 --- a/src/autofit/afdummy.h +++ b/src/autofit/afdummy.h @@ -5,7 +5,7 @@ /* Auto-fitter dummy routines to be used if no hinting should be */ /* performed (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,8 +17,8 @@ /***************************************************************************/ -#ifndef __AFDUMMY_H__ -#define __AFDUMMY_H__ +#ifndef AFDUMMY_H_ +#define AFDUMMY_H_ #include "aftypes.h" @@ -34,7 +34,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFDUMMY_H__ */ +#endif /* AFDUMMY_H_ */ /* END */ diff --git a/src/autofit/aferrors.h b/src/autofit/aferrors.h index 7b416e4..53c01f6 100644 --- a/src/autofit/aferrors.h +++ b/src/autofit/aferrors.h @@ -4,7 +4,7 @@ /* */ /* Autofitter error codes (specification only). */ /* */ -/* Copyright 2005-2015 by */ +/* Copyright 2005-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,12 +23,12 @@ /* */ /*************************************************************************/ -#ifndef __AFERRORS_H__ -#define __AFERRORS_H__ +#ifndef AFERRORS_H_ +#define AFERRORS_H_ #include FT_MODULE_ERRORS_H -#undef __FTERRORS_H__ +#undef FTERRORS_H_ #undef FT_ERR_PREFIX #define FT_ERR_PREFIX AF_Err_ @@ -36,6 +36,7 @@ #include FT_ERRORS_H -#endif /* __AFERRORS_H__ */ +#endif /* AFERRORS_H_ */ + /* END */ diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c index 3223358..ac6dcaf 100644 --- a/src/autofit/afglobal.c +++ b/src/autofit/afglobal.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter routines to compute global hinting values (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -42,12 +42,13 @@ #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ AF_DEFINE_SCRIPT_CLASS( \ af_ ## s ## _script_class, \ AF_SCRIPT_ ## S, \ af_ ## s ## _uniranges, \ af_ ## s ## _nonbase_uniranges, \ + AF_ ## H, \ ss ) #include "afscript.h" @@ -83,7 +84,7 @@ #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ &af_ ## s ## _script_class, FT_LOCAL_ARRAY_DEF( AF_ScriptClass ) @@ -240,23 +241,23 @@ else { /* get glyphs not directly addressable by cmap */ - af_shaper_get_coverage( globals, style_class, gstyles ); + af_shaper_get_coverage( globals, style_class, gstyles, 0 ); } } - /* handle the default OpenType features of the default script ... */ - af_shaper_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles ); - - /* ... and the remaining default OpenType features */ + /* handle the remaining default OpenType features ... */ for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ ) { AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss]; - if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT ) - af_shaper_get_coverage( globals, style_class, gstyles ); + if ( style_class->coverage == AF_COVERAGE_DEFAULT ) + af_shaper_get_coverage( globals, style_class, gstyles, 0 ); } + /* ... and finally the default OpenType features of the default script */ + af_shaper_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles, 1 ); + /* mark ASCII digits */ for ( i = 0x30; i <= 0x39; i++ ) { diff --git a/src/autofit/afglobal.h b/src/autofit/afglobal.h index 5b4e439..ce6b9e8 100644 --- a/src/autofit/afglobal.h +++ b/src/autofit/afglobal.h @@ -5,7 +5,7 @@ /* Auto-fitter routines to compute global hinting values */ /* (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,8 +17,8 @@ /***************************************************************************/ -#ifndef __AFGLOBAL_H__ -#define __AFGLOBAL_H__ +#ifndef AFGLOBAL_H_ +#define AFGLOBAL_H_ #include "aftypes.h" @@ -34,7 +34,7 @@ FT_BEGIN_HEADER #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class ) #include "afscript.h" @@ -167,7 +167,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFGLOBAL_H__ */ +#endif /* AFGLOBAL_H_ */ /* END */ diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c index 56c8220..0f7f6e5 100644 --- a/src/autofit/afhints.c +++ b/src/autofit/afhints.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -99,6 +99,7 @@ af_axis_hints_new_edge( AF_AxisHints axis, FT_Int fpos, AF_Direction dir, + FT_Bool top_to_bottom_hinting, FT_Memory memory, AF_Edge *anedge ) { @@ -153,7 +154,8 @@ while ( edge > edges ) { - if ( edge[-1].fpos < fpos ) + if ( top_to_bottom_hinting ? ( edge[-1].fpos > fpos ) + : ( edge[-1].fpos < fpos ) ) break; /* we want the edge with same position and minor direction */ @@ -302,16 +304,18 @@ af_glyph_hints_dump_points( AF_GlyphHints hints, FT_Bool to_stdout ) { - AF_Point points = hints->points; - AF_Point limit = points + hints->num_points; - AF_Point point; + AF_Point points = hints->points; + AF_Point limit = points + hints->num_points; + AF_Point* contour = hints->contours; + AF_Point* climit = contour + hints->num_contours; + AF_Point point; AF_DUMP(( "Table of points:\n" )); if ( hints->num_points ) - AF_DUMP(( " index hedge hseg vedge vseg flags" - " xorg yorg xscale yscale xfit yfit\n" )); + AF_DUMP(( " index hedge hseg vedge vseg flags " + " xorg yorg xscale yscale xfit yfit" )); else AF_DUMP(( " (none)\n" )); @@ -324,7 +328,14 @@ char buf1[16], buf2[16], buf3[16], buf4[16]; - AF_DUMP(( " %5d %5s %5s %5s %5s %s " + /* insert extra newline at the beginning of a contour */ + if ( contour < climit && *contour == point ) + { + AF_DUMP(( "\n" )); + contour++; + } + + AF_DUMP(( " %5d %5s %5s %5s %5s %s" " %5d %5d %7.2f %7.2f %7.2f %7.2f\n", point_idx, af_print_idx( buf1, @@ -333,8 +344,11 @@ af_print_idx( buf3, af_get_edge_index( hints, segment_idx_0, 0 ) ), af_print_idx( buf4, segment_idx_0 ), - ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? "weak" - : " -- ", + ( point->flags & AF_FLAG_NEAR ) + ? " near " + : ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) + ? " weak " + : "strong", point->fx, point->fy, @@ -406,20 +420,19 @@ dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" )); if ( axis->num_segments ) - AF_DUMP(( " index pos dir from to" - " link serif edge" + AF_DUMP(( " index pos delta dir from to " + " link serif edge" " height extra flags\n" )); else AF_DUMP(( " (none)\n" )); for ( seg = segments; seg < limit; seg++ ) - AF_DUMP(( " %5d %5.2g %5s %4d %4d" + AF_DUMP(( " %5d %5d %5d %5s %4d %4d" " %4s %5s %4s" " %6d %5d %11s\n", AF_INDEX_NUM( seg, segments ), - dimension == AF_DIMENSION_HORZ - ? (int)seg->first->ox / 64.0 - : (int)seg->first->oy / 64.0, + seg->pos, + seg->delta, af_dir_str( (AF_Direction)seg->dir ), AF_INDEX_NUM( seg->first, points ), AF_INDEX_NUM( seg->last, points ), @@ -539,18 +552,26 @@ * note: AF_DIMENSION_HORZ corresponds to _vertical_ edges * since they have a constant X coordinate. */ - AF_DUMP(( "Table of %s edges:\n", - dimension == AF_DIMENSION_HORZ ? "vertical" - : "horizontal" )); + if ( dimension == AF_DIMENSION_HORZ ) + AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n", + "vertical", + 65536.0 * 64.0 / hints->x_scale, + 10.0 * hints->x_scale / 65536.0 / 64.0 )); + else + AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n", + "horizontal", + 65536.0 * 64.0 / hints->y_scale, + 10.0 * hints->y_scale / 65536.0 / 64.0 )); + if ( axis->num_edges ) - AF_DUMP(( " index pos dir link serif" - " blue opos pos flags\n" )); + AF_DUMP(( " index pos dir link serif" + " blue opos pos flags\n" )); else AF_DUMP(( " (none)\n" )); for ( edge = edges; edge < limit; edge++ ) - AF_DUMP(( " %5d %5.2g %5s %4s %5s" - " %c %5.2f %5.2f %11s\n", + AF_DUMP(( " %5d %7.2f %5s %4s %5s" + " %c %7.2f %7.2f %11s\n", AF_INDEX_NUM( edge, edges ), (int)edge->opos / 64.0, af_dir_str( (AF_Direction)edge->dir ), @@ -802,18 +823,26 @@ AF_Point point; AF_Point point_limit = points + hints->num_points; + /* value 20 in `near_limit' is heuristic */ + FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM; + FT_Int near_limit = 20 * units_per_em / 2048; + /* compute coordinates & Bezier flags, next and prev */ { FT_Vector* vec = outline->points; char* tag = outline->tags; - AF_Point end = points + outline->contours[0]; + FT_Short endpoint = outline->contours[0]; + AF_Point end = points + endpoint; AF_Point prev = end; FT_Int contour_index = 0; for ( point = points; point < point_limit; point++, vec++, tag++ ) { + FT_Pos out_x, out_y; + + point->in_dir = (FT_Char)AF_DIR_NONE; point->out_dir = (FT_Char)AF_DIR_NONE; @@ -822,6 +851,9 @@ point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta; point->oy = point->y = FT_MulFix( vec->y, y_scale ) + y_delta; + end->fx = (FT_Short)outline->points[endpoint].x; + end->fy = (FT_Short)outline->points[endpoint].y; + switch ( FT_CURVE_TAG( *tag ) ) { case FT_CURVE_TAG_CONIC: @@ -834,6 +866,12 @@ point->flags = AF_FLAG_NONE; } + out_x = point->fx - prev->fx; + out_y = point->fy - prev->fy; + + if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit ) + prev->flags |= AF_FLAG_NEAR; + point->prev = prev; prev->next = point; prev = point; @@ -842,8 +880,9 @@ { if ( ++contour_index < outline->n_contours ) { - end = points + outline->contours[contour_index]; - prev = end; + endpoint = outline->contours[contour_index]; + end = points + endpoint; + prev = end; } } } @@ -869,17 +908,15 @@ * Compute directions of `in' and `out' vectors. * * Note that distances between points that are very near to each - * other are accumulated. In other words, the auto-hinter + * other are accumulated. In other words, the auto-hinter either * prepends the small vectors between near points to the first - * non-near vector. All intermediate points are tagged as - * weak; the directions are adjusted also to be equal to the - * accumulated one. + * non-near vector, or the sum of small vector lengths exceeds a + * threshold, thus `grouping' the small vectors. All intermediate + * points are tagged as weak; the directions are adjusted also to + * be equal to the accumulated one. */ - /* value 20 in `near_limit' is heuristic */ - FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM; - FT_Int near_limit = 20 * units_per_em / 2048; - FT_Int near_limit2 = 2 * near_limit - 1; + FT_Int near_limit2 = 2 * near_limit - 1; AF_Point* contour; AF_Point* contour_limit = hints->contours + hints->num_contours; @@ -926,7 +963,7 @@ /* now loop over all points of the contour to get */ /* `in' and `out' vector directions */ - curr = first; + curr = first; /* * We abuse the `u' and `v' fields to store index deltas to the @@ -949,7 +986,7 @@ point = next; - next = point->next; + next = point->next; out_x += next->fx - point->fx; out_y += next->fy - point->fy; diff --git a/src/autofit/afhints.h b/src/autofit/afhints.h index a64c7a4..4fdf732 100644 --- a/src/autofit/afhints.h +++ b/src/autofit/afhints.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFHINTS_H__ -#define __AFHINTS_H__ +#ifndef AFHINTS_H_ +#define AFHINTS_H_ #include "aftypes.h" @@ -221,6 +221,9 @@ FT_BEGIN_HEADER /* candidates for weak interpolation have this flag set */ #define AF_FLAG_WEAK_INTERPOLATION ( 1U << 4 ) + /* the distance to the next point is very small */ +#define AF_FLAG_NEAR ( 1U << 5 ) + /* edge hint flags */ #define AF_EDGE_NORMAL 0 @@ -257,6 +260,7 @@ FT_BEGIN_HEADER FT_Byte flags; /* edge/segment flags for this segment */ FT_Char dir; /* segment direction */ FT_Short pos; /* position of segment */ + FT_Short delta; /* deviation from segment position */ FT_Short min_coord; /* minimum coordinate of segment */ FT_Short max_coord; /* maximum coordinate of segment */ FT_Short height; /* the hinted segment height */ @@ -266,7 +270,6 @@ FT_BEGIN_HEADER AF_Segment link; /* (stem) link segment */ AF_Segment serif; /* primary segment for serifs */ - FT_Pos num_linked; /* number of linked segments */ FT_Pos score; /* used during stem matching */ FT_Pos len; /* used during stem matching */ @@ -289,7 +292,6 @@ FT_BEGIN_HEADER AF_Width blue_edge; /* non-NULL if this is a blue edge */ AF_Edge link; /* link edge */ AF_Edge serif; /* primary edge for serifs */ - FT_Short num_linked; /* number of linked edges */ FT_Int score; /* used during stem matching */ AF_Segment first; /* first segment in edge */ @@ -419,6 +421,7 @@ FT_BEGIN_HEADER af_axis_hints_new_edge( AF_AxisHints axis, FT_Int fpos, AF_Direction dir, + FT_Bool top_to_bottom_hinting, FT_Memory memory, AF_Edge *edge ); @@ -472,7 +475,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFHINTS_H__ */ +#endif /* AFHINTS_H_ */ /* END */ diff --git a/src/autofit/afindic.c b/src/autofit/afindic.c index 59b14d7..097a2b2 100644 --- a/src/autofit/afindic.c +++ b/src/autofit/afindic.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for Indic writing system (body). */ /* */ -/* Copyright 2007-2015 by */ +/* Copyright 2007-2016 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, */ diff --git a/src/autofit/afindic.h b/src/autofit/afindic.h index 4c36908..0772e07 100644 --- a/src/autofit/afindic.h +++ b/src/autofit/afindic.h @@ -5,7 +5,7 @@ /* Auto-fitter hinting routines for Indic writing system */ /* (specification). */ /* */ -/* Copyright 2007-2015 by */ +/* Copyright 2007-2016 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, */ @@ -17,8 +17,8 @@ /***************************************************************************/ -#ifndef __AFINDIC_H__ -#define __AFINDIC_H__ +#ifndef AFINDIC_H_ +#define AFINDIC_H_ #include "afhints.h" @@ -35,7 +35,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFINDIC_H__ */ +#endif /* AFINDIC_H_ */ /* END */ diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index 9c9f370..db7aaff 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin writing system (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -95,7 +95,7 @@ const char* p; #ifdef FT_DEBUG_LEVEL_TRACE - FT_ULong ch; + FT_ULong ch = 0; #endif p = script_class->standard_charstring; @@ -1076,7 +1076,7 @@ FT_UInt ppem; - scaled = FT_MulFix( blue->shoot.org, scaler->y_scale ); + scaled = FT_MulFix( blue->shoot.org, scale ); ppem = metrics->root.scaler.face->size->metrics.x_ppem; limit = metrics->root.globals->increase_x_height; threshold = 40; @@ -1123,8 +1123,6 @@ if ( dist == 0 ) { - scale = new_scale; - FT_TRACE5(( "af_latin_metrics_scale_dim:" " x height alignment (style `%s'):\n" @@ -1132,9 +1130,11 @@ " vertical scaling changed from %.4f to %.4f (by %d%%)\n" "\n", af_style_names[metrics->root.style_class->style], - axis->org_scale / 65536.0, scale / 65536.0, + new_scale / 65536.0, ( fitted - scaled ) * 100 / scaled )); + + scale = new_scale; } #ifdef FT_DEBUG_LEVEL_TRACE else @@ -1436,19 +1436,36 @@ /* do each contour separately */ for ( ; contour < contour_limit; contour++ ) { - AF_Point point = contour[0]; - AF_Point last = point->prev; - int on_edge = 0; - FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */ - FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */ - FT_Pos min_on_pos = 32000; - FT_Pos max_on_pos = -32000; - FT_Bool passed; + AF_Point point = contour[0]; + AF_Point last = point->prev; + int on_edge = 0; + + /* we call values measured along a segment (point->v) */ + /* `coordinates', and values orthogonal to it (point->u) */ + /* `positions' */ + FT_Pos min_pos = 32000; + FT_Pos max_pos = -32000; + FT_Pos min_coord = 32000; + FT_Pos max_coord = -32000; + FT_UShort min_flags = AF_FLAG_NONE; + FT_UShort max_flags = AF_FLAG_NONE; + FT_Pos min_on_coord = 32000; + FT_Pos max_on_coord = -32000; + + FT_Bool passed; + + AF_Segment prev_segment = NULL; + + FT_Pos prev_min_pos = min_pos; + FT_Pos prev_max_pos = max_pos; + FT_Pos prev_min_coord = min_coord; + FT_Pos prev_max_coord = max_coord; + FT_UShort prev_min_flags = min_flags; + FT_UShort prev_max_flags = max_flags; + FT_Pos prev_min_on_coord = min_on_coord; + FT_Pos prev_max_on_coord = max_on_coord; - if ( point == last ) /* skip singletons -- just in case */ - continue; - if ( FT_ABS( last->out_dir ) == major_dir && FT_ABS( point->out_dir ) == major_dir ) { @@ -1478,51 +1495,182 @@ if ( on_edge ) { + /* get minimum and maximum position */ u = point->u; if ( u < min_pos ) min_pos = u; if ( u > max_pos ) max_pos = u; - /* get minimum and maximum coordinate of on points */ + /* get minimum and maximum coordinate together with flags */ + v = point->v; + if ( v < min_coord ) + { + min_coord = v; + min_flags = point->flags; + } + if ( v > max_coord ) + { + max_coord = v; + max_flags = point->flags; + } + + /* get minimum and maximum coordinate of `on' points */ if ( !( point->flags & AF_FLAG_CONTROL ) ) { v = point->v; - if ( v < min_on_pos ) - min_on_pos = v; - if ( v > max_on_pos ) - max_on_pos = v; + if ( v < min_on_coord ) + min_on_coord = v; + if ( v > max_on_coord ) + max_on_coord = v; } if ( point->out_dir != segment_dir || point == last ) { - /* we are just leaving an edge; record a new segment! */ - segment->last = point; - segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 ); - - /* a segment is round if either its first or last point */ - /* is a control point, and the length of the on points */ - /* inbetween doesn't exceed a heuristic limit */ - if ( ( segment->first->flags | point->flags ) & AF_FLAG_CONTROL && - ( max_on_pos - min_on_pos ) < flat_threshold ) - segment->flags |= AF_EDGE_ROUND; + /* check whether the new segment's start point is identical to */ + /* the previous segment's end point; for example, this might */ + /* happen for spikes */ - /* compute segment size */ - min_pos = max_pos = point->v; + if ( !prev_segment || segment->first != prev_segment->last ) + { + /* points are different: we are just leaving an edge, thus */ + /* record a new segment */ + + segment->last = point; + segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 ); + segment->delta = (FT_Short)( ( max_pos - min_pos ) >> 1 ); + + /* a segment is round if either its first or last point */ + /* is a control point, and the length of the on points */ + /* inbetween doesn't exceed a heuristic limit */ + if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL && + ( max_on_coord - min_on_coord ) < flat_threshold ) + segment->flags |= AF_EDGE_ROUND; + + segment->min_coord = (FT_Short)min_coord; + segment->max_coord = (FT_Short)max_coord; + segment->height = segment->max_coord - segment->min_coord; + + prev_segment = segment; + prev_min_pos = min_pos; + prev_max_pos = max_pos; + prev_min_coord = min_coord; + prev_max_coord = max_coord; + prev_min_flags = min_flags; + prev_max_flags = max_flags; + prev_min_on_coord = min_on_coord; + prev_max_on_coord = max_on_coord; + } + else + { + /* points are the same: we don't create a new segment but */ + /* merge the current segment with the previous one */ + + if ( prev_segment->last->in_dir == point->in_dir ) + { + /* we have identical directions (this can happen for */ + /* degenerate outlines that move zig-zag along the main */ + /* axis without changing the coordinate value of the other */ + /* axis, and where the segments have just been merged): */ + /* unify segments */ + + /* update constraints */ + + if ( prev_min_pos < min_pos ) + min_pos = prev_min_pos; + if ( prev_max_pos > max_pos ) + max_pos = prev_max_pos; + + if ( prev_min_coord < min_coord ) + { + min_coord = prev_min_coord; + min_flags = prev_min_flags; + } + if ( prev_max_coord > max_coord ) + { + max_coord = prev_max_coord; + max_flags = prev_max_flags; + } - v = segment->first->v; - if ( v < min_pos ) - min_pos = v; - if ( v > max_pos ) - max_pos = v; + if ( prev_min_on_coord < min_on_coord ) + min_on_coord = prev_min_on_coord; + if ( prev_max_on_coord > max_on_coord ) + max_on_coord = prev_max_on_coord; + + prev_segment->last = point; + prev_segment->pos = (FT_Short)( ( min_pos + + max_pos ) >> 1 ); + + if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL && + ( max_on_coord - min_on_coord ) < flat_threshold ) + prev_segment->flags |= AF_EDGE_ROUND; + else + prev_segment->flags &= ~AF_EDGE_ROUND; + + prev_segment->min_coord = (FT_Short)min_coord; + prev_segment->max_coord = (FT_Short)max_coord; + prev_segment->height = prev_segment->max_coord - + prev_segment->min_coord; + } + else + { + /* we have different directions; use the properties of the */ + /* longer segment and discard the other one */ - segment->min_coord = (FT_Short)min_pos; - segment->max_coord = (FT_Short)max_pos; - segment->height = (FT_Short)( segment->max_coord - - segment->min_coord ); + if ( FT_ABS( prev_max_coord - prev_min_coord ) > + FT_ABS( max_coord - min_coord ) ) + { + /* discard current segment */ + + if ( min_pos < prev_min_pos ) + prev_min_pos = min_pos; + if ( max_pos > prev_max_pos ) + prev_max_pos = max_pos; + + prev_segment->last = point; + prev_segment->pos = (FT_Short)( ( prev_min_pos + + prev_max_pos ) >> 1 ); + } + else + { + /* discard previous segment */ + + if ( prev_min_pos < min_pos ) + min_pos = prev_min_pos; + if ( prev_max_pos > max_pos ) + max_pos = prev_max_pos; + + segment->last = point; + segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 ); + + if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL && + ( max_on_coord - min_on_coord ) < flat_threshold ) + segment->flags |= AF_EDGE_ROUND; + + segment->min_coord = (FT_Short)min_coord; + segment->max_coord = (FT_Short)max_coord; + segment->height = segment->max_coord - + segment->min_coord; + + *prev_segment = *segment; + + prev_min_pos = min_pos; + prev_max_pos = max_pos; + prev_min_coord = min_coord; + prev_max_coord = max_coord; + prev_min_flags = min_flags; + prev_max_flags = max_flags; + prev_min_on_coord = min_on_coord; + prev_max_on_coord = max_on_coord; + } + } + + axis->num_segments--; + } on_edge = 0; segment = NULL; + /* fall through */ } } @@ -1535,7 +1683,12 @@ passed = 1; } - if ( !on_edge && FT_ABS( point->out_dir ) == major_dir ) + /* if we are not on an edge, check whether the major direction */ + /* coincides with the current point's `out' direction, or */ + /* whether we have a single-point contour */ + if ( !on_edge && + ( FT_ABS( point->out_dir ) == major_dir || + point == point->prev ) ) { /* this is the start of a new segment! */ segment_dir = (AF_Direction)point->out_dir; @@ -1551,17 +1704,42 @@ segment->first = point; segment->last = point; - min_pos = max_pos = point->u; + /* `af_axis_hints_new_segment' reallocates memory, */ + /* thus we have to refresh the `prev_segment' pointer */ + if ( prev_segment ) + prev_segment = segment - 1; + + min_pos = max_pos = point->u; + min_coord = max_coord = point->v; + min_flags = max_flags = point->flags; if ( point->flags & AF_FLAG_CONTROL ) { - min_on_pos = 32000; - max_on_pos = -32000; + min_on_coord = 32000; + max_on_coord = -32000; } else - min_on_pos = max_on_pos = point->v; + min_on_coord = max_on_coord = point->v; on_edge = 1; + + if ( point == point->prev ) + { + /* we have a one-point segment: this is a one-point */ + /* contour with `in' and `out' direction set to */ + /* AF_DIR_NONE */ + segment->pos = (FT_Short)min_pos; + + if (point->flags & AF_FLAG_CONTROL) + segment->flags |= AF_EDGE_ROUND; + + segment->min_coord = (FT_Short)point->v; + segment->max_coord = (FT_Short)point->v; + segment->height = 0; + + on_edge = 0; + segment = NULL; + } } point = point->next; @@ -1773,6 +1951,12 @@ FT_Memory memory = hints->memory; AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim]; + AF_StyleClass style_class = hints->metrics->style_class; + AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET + [style_class->script]; + + FT_Bool top_to_bottom_hinting = 0; + AF_Segment segments = axis->segments; AF_Segment segment_limit = segments + axis->num_segments; AF_Segment seg; @@ -1783,6 +1967,7 @@ FT_Fixed scale; FT_Pos edge_distance_threshold; FT_Pos segment_length_threshold; + FT_Pos segment_width_threshold; axis->num_edges = 0; @@ -1795,15 +1980,24 @@ : AF_DIR_RIGHT; #endif + if ( dim == AF_DIMENSION_VERT ) + top_to_bottom_hinting = script_class->top_to_bottom_hinting; + /* * We ignore all segments that are less than 1 pixel in length * to avoid many problems with serif fonts. We compute the * corresponding threshold in font units. */ if ( dim == AF_DIMENSION_HORZ ) - segment_length_threshold = FT_DivFix( 64, hints->y_scale ); + segment_length_threshold = FT_DivFix( 64, hints->y_scale ); else - segment_length_threshold = 0; + segment_length_threshold = 0; + + /* + * Similarly, we ignore segments that have a width delta + * larger than 0.5px (i.e., a width larger than 1px). + */ + segment_width_threshold = FT_DivFix( 32, scale ); /*********************************************************************/ /* */ @@ -1836,7 +2030,11 @@ FT_Int ee; - if ( seg->height < segment_length_threshold ) + /* ignore too short segments, too wide ones, and, in this loop, */ + /* one-point segments without a direction */ + if ( seg->height < segment_length_threshold || + seg->delta > segment_width_threshold || + seg->dir == AF_DIR_NONE ) continue; /* A special case for serif edges: If they are smaller than */ @@ -1872,6 +2070,7 @@ /* sort according to the position */ error = af_axis_hints_new_edge( axis, seg->pos, (AF_Direction)seg->dir, + top_to_bottom_hinting, memory, &edge ); if ( error ) goto Exit; @@ -1897,6 +2096,44 @@ } } + /* we loop again over all segments to catch one-point segments */ + /* without a direction: if possible, link them to existing edges */ + for ( seg = segments; seg < segment_limit; seg++ ) + { + AF_Edge found = NULL; + FT_Int ee; + + + if ( seg->dir != AF_DIR_NONE ) + continue; + + /* look for an edge corresponding to the segment */ + for ( ee = 0; ee < axis->num_edges; ee++ ) + { + AF_Edge edge = axis->edges + ee; + FT_Pos dist; + + + dist = seg->pos - edge->fpos; + if ( dist < 0 ) + dist = -dist; + + if ( dist < edge_distance_threshold ) + { + found = edge; + break; + } + } + + /* one-point segments without a match are ignored */ + if ( found ) + { + seg->edge_next = found->first; + found->last->edge_next = seg; + found->last = seg; + } + } + /******************************************************************/ /* */ @@ -2337,6 +2574,7 @@ af_latin_compute_stem_width( AF_GlyphHints hints, AF_Dimension dim, FT_Pos width, + FT_Pos base_delta, FT_UInt base_flags, FT_UInt stem_flags ) { @@ -2414,7 +2652,39 @@ dist += delta; } else - dist = ( dist + 32 ) & ~63; + { + /* A stem's end position depends on two values: the start */ + /* position and the stem length. The former gets usually */ + /* rounded to the grid, while the latter gets rounded also if it */ + /* exceeds a certain length (see below in this function). This */ + /* `double rounding' can lead to a great difference to the */ + /* original, unhinted position; this normally doesn't matter for */ + /* large PPEM values, but for small sizes it can easily make */ + /* outlines collide. For this reason, we adjust the stem length */ + /* by a small amount depending on the PPEM value in case the */ + /* former and latter rounding both point into the same */ + /* direction. */ + + FT_Pos bdelta = 0; + + + if ( ( ( width > 0 ) && ( base_delta > 0 ) ) || + ( ( width < 0 ) && ( base_delta < 0 ) ) ) + { + FT_UInt ppem = metrics->root.scaler.face->size->metrics.x_ppem; + + + if ( ppem < 10 ) + bdelta = base_delta; + else if ( ppem < 30 ) + bdelta = ( base_delta * (FT_Pos)( 30 - ppem ) ) / 20; + + if ( bdelta < 0 ) + bdelta = -bdelta; + } + + dist = ( dist - bdelta + 32 ) & ~63; + } } } else @@ -2503,11 +2773,17 @@ AF_Edge base_edge, AF_Edge stem_edge ) { - FT_Pos dist = stem_edge->opos - base_edge->opos; + FT_Pos dist, base_delta; + FT_Pos fitted_width; + - FT_Pos fitted_width = af_latin_compute_stem_width( hints, dim, dist, - base_edge->flags, - stem_edge->flags ); + dist = stem_edge->opos - base_edge->opos; + base_delta = base_edge->pos - base_edge->opos; + + fitted_width = af_latin_compute_stem_width( hints, dim, + dist, base_delta, + base_edge->flags, + stem_edge->flags ); stem_edge->pos = base_edge->pos + fitted_width; @@ -2558,8 +2834,14 @@ AF_Edge anchor = NULL; FT_Int has_serifs = 0; + AF_StyleClass style_class = hints->metrics->style_class; + AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET + [style_class->script]; + + FT_Bool top_to_bottom_hinting = 0; + #ifdef FT_DEBUG_LEVEL_TRACE - FT_UInt num_actions = 0; + FT_UInt num_actions = 0; #endif @@ -2567,6 +2849,9 @@ dim == AF_DIMENSION_VERT ? "horizontal" : "vertical", af_style_names[hints->metrics->style_class->style] )); + if ( dim == AF_DIMENSION_VERT ) + top_to_bottom_hinting = script_class->top_to_bottom_hinting; + /* we begin by aligning all stems relative to the blue zone */ /* if needed -- that's only for horizontal edges */ @@ -2702,7 +2987,8 @@ org_len = edge2->opos - edge->opos; - cur_len = af_latin_compute_stem_width( hints, dim, org_len, + cur_len = af_latin_compute_stem_width( hints, dim, + org_len, 0, edge->flags, edge2->flags ); @@ -2771,7 +3057,8 @@ org_len = edge2->opos - edge->opos; org_center = org_pos + ( org_len >> 1 ); - cur_len = af_latin_compute_stem_width( hints, dim, org_len, + cur_len = af_latin_compute_stem_width( hints, dim, + org_len, 0, edge->flags, edge2->flags ); @@ -2831,7 +3118,8 @@ org_len = edge2->opos - edge->opos; org_center = org_pos + ( org_len >> 1 ); - cur_len = af_latin_compute_stem_width( hints, dim, org_len, + cur_len = af_latin_compute_stem_width( hints, dim, + org_len, 0, edge->flags, edge2->flags ); @@ -2862,16 +3150,25 @@ edge->flags |= AF_EDGE_DONE; edge2->flags |= AF_EDGE_DONE; - if ( edge > edges && edge->pos < edge[-1].pos ) + if ( edge > edges && + ( top_to_bottom_hinting ? ( edge->pos > edge[-1].pos ) + : ( edge->pos < edge[-1].pos ) ) ) { + /* don't move if stem would (almost) disappear otherwise; */ + /* the ad-hoc value 16 corresponds to 1/4px */ + if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) + { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", - edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 )); + FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", + edge - edges, + edge->pos / 64.0, + edge[-1].pos / 64.0 )); - num_actions++; + num_actions++; #endif - edge->pos = edge[-1].pos; + edge->pos = edge[-1].pos; + } } } } @@ -3023,29 +3320,46 @@ #endif edge->flags |= AF_EDGE_DONE; - if ( edge > edges && edge->pos < edge[-1].pos ) + if ( edge > edges && + ( top_to_bottom_hinting ? ( edge->pos > edge[-1].pos ) + : ( edge->pos < edge[-1].pos ) ) ) { + /* don't move if stem would (almost) disappear otherwise; */ + /* the ad-hoc value 16 corresponds to 1/4px */ + if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) + { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", - edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 )); + FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", + edge - edges, + edge->pos / 64.0, + edge[-1].pos / 64.0 )); - num_actions++; + num_actions++; #endif - edge->pos = edge[-1].pos; + edge->pos = edge[-1].pos; + } } - if ( edge + 1 < edge_limit && - edge[1].flags & AF_EDGE_DONE && - edge->pos > edge[1].pos ) + if ( edge + 1 < edge_limit && + edge[1].flags & AF_EDGE_DONE && + ( top_to_bottom_hinting ? ( edge->pos < edge[1].pos ) + : ( edge->pos > edge[1].pos ) ) ) { + /* don't move if stem would (almost) disappear otherwise; */ + /* the ad-hoc value 16 corresponds to 1/4px */ + if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) + { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", - edge - edges, edge->pos / 64.0, edge[1].pos / 64.0 )); + FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", + edge - edges, + edge->pos / 64.0, + edge[1].pos / 64.0 )); - num_actions++; + num_actions++; #endif - edge->pos = edge[1].pos; + edge->pos = edge[1].pos; + } } } } diff --git a/src/autofit/aflatin.h b/src/autofit/aflatin.h index 414060f..fe6bbd8 100644 --- a/src/autofit/aflatin.h +++ b/src/autofit/aflatin.h @@ -5,7 +5,7 @@ /* Auto-fitter hinting routines for latin writing system */ /* (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,8 +17,8 @@ /***************************************************************************/ -#ifndef __AFLATIN_H__ -#define __AFLATIN_H__ +#ifndef AFLATIN_H_ +#define AFLATIN_H_ #include "afhints.h" @@ -188,7 +188,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFLATIN_H__ */ +#endif /* AFLATIN_H_ */ /* END */ diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c index 2fb7d1d..5db4a41 100644 --- a/src/autofit/aflatin2.c +++ b/src/autofit/aflatin2.c @@ -1,10 +1,15 @@ +/* ATTENTION: This file doesn't compile. It is only here as a reference */ +/* of an alternative latin hinting algorithm that was always */ +/* marked as experimental. */ + + /***************************************************************************/ /* */ /* aflatin2.c */ /* */ /* Auto-fitter hinting routines for latin writing system (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1195,7 +1200,7 @@ /* insert a new edge in the list and */ /* sort according to the position */ - error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, + error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, 0, memory, &edge ); if ( error ) goto Exit; diff --git a/src/autofit/aflatin2.h b/src/autofit/aflatin2.h index 9326753..f83f704 100644 --- a/src/autofit/aflatin2.h +++ b/src/autofit/aflatin2.h @@ -1,3 +1,8 @@ +/* ATTENTION: This file doesn't compile. It is only here as a reference */ +/* of an alternative latin hinting algorithm that was always */ +/* marked as experimental. */ + + /***************************************************************************/ /* */ /* aflatin2.h */ @@ -5,7 +10,7 @@ /* Auto-fitter hinting routines for latin writing system */ /* (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,8 +22,8 @@ /***************************************************************************/ -#ifndef __AFLATIN2_H__ -#define __AFLATIN2_H__ +#ifndef AFLATIN2_H_ +#define AFLATIN2_H_ #include "afhints.h" @@ -35,7 +40,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFLATIN_H__ */ +#endif /* AFLATIN_H_ */ /* END */ diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c index aa5b8fd..26bba06 100644 --- a/src/autofit/afloader.c +++ b/src/autofit/afloader.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter glyph loading routines (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/afloader.h b/src/autofit/afloader.h index 4c4affc..0062eb9 100644 --- a/src/autofit/afloader.h +++ b/src/autofit/afloader.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter glyph loading routines (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFLOADER_H__ -#define __AFLOADER_H__ +#ifndef AFLOADER_H_ +#define AFLOADER_H_ #include "afhints.h" #include "afmodule.h" @@ -85,7 +85,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFLOADER_H__ */ +#endif /* AFLOADER_H_ */ /* END */ diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c index 45fd360..e8f8ff4 100644 --- a/src/autofit/afmodule.c +++ b/src/autofit/afmodule.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module implementation (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -107,18 +107,29 @@ static FT_Error af_property_set( FT_Module ft_module, const char* property_name, - const void* value ) + const void* value, + FT_Bool value_is_string ) { FT_Error error = FT_Err_Ok; AF_Module module = (AF_Module)ft_module; +#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_UNUSED( value_is_string ); +#endif + if ( !ft_strcmp( property_name, "fallback-script" ) ) { - FT_UInt* fallback_script = (FT_UInt*)value; + FT_UInt* fallback_script; + FT_UInt ss; + - FT_UInt ss; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + return FT_THROW( Invalid_Argument ); +#endif + fallback_script = (FT_UInt*)value; /* We translate the fallback script to a fallback style that uses */ /* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */ @@ -147,19 +158,33 @@ } else if ( !ft_strcmp( property_name, "default-script" ) ) { - FT_UInt* default_script = (FT_UInt*)value; + FT_UInt* default_script; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + return FT_THROW( Invalid_Argument ); +#endif + + default_script = (FT_UInt*)value; + module->default_script = *default_script; return error; } else if ( !ft_strcmp( property_name, "increase-x-height" ) ) { - FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value; + FT_Prop_IncreaseXHeight* prop; AF_FaceGlobals globals; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + return FT_THROW( Invalid_Argument ); +#endif + + prop = (FT_Prop_IncreaseXHeight*)value; + error = af_property_get_face_globals( prop->face, &globals, module ); if ( !error ) globals->increase_x_height = prop->limit; @@ -169,27 +194,76 @@ #ifdef AF_CONFIG_OPTION_USE_WARPER else if ( !ft_strcmp( property_name, "warping" ) ) { - FT_Bool* warping = (FT_Bool*)value; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; + long w = ft_strtol( s, NULL, 10 ); + + + if ( w == 0 ) + module->warping = 0; + else if ( w == 1 ) + module->warping = 1; + else + return FT_THROW( Invalid_Argument ); + } + else +#endif + { + FT_Bool* warping = (FT_Bool*)value; - module->warping = *warping; + module->warping = *warping; + } return error; } #endif /* AF_CONFIG_OPTION_USE_WARPER */ else if ( !ft_strcmp( property_name, "darkening-parameters" ) ) { - FT_Int* darken_params = (FT_Int*)value; + FT_Int* darken_params; + FT_Int x1, y1, x2, y2, x3, y3, x4, y4; + +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_Int dp[8]; + + + if ( value_is_string ) + { + const char* s = (const char*)value; + char* ep; + int i; + + + /* eight comma-separated numbers */ + for ( i = 0; i < 7; i++ ) + { + dp[i] = (FT_Int)ft_strtol( s, &ep, 10 ); + if ( *ep != ',' || s == ep ) + return FT_THROW( Invalid_Argument ); + + s = ep + 1; + } - FT_Int x1 = darken_params[0]; - FT_Int y1 = darken_params[1]; - FT_Int x2 = darken_params[2]; - FT_Int y2 = darken_params[3]; - FT_Int x3 = darken_params[4]; - FT_Int y3 = darken_params[5]; - FT_Int x4 = darken_params[6]; - FT_Int y4 = darken_params[7]; + dp[7] = (FT_Int)ft_strtol( s, &ep, 10 ); + if ( !( *ep == '\0' || *ep == ' ' ) || s == ep ) + return FT_THROW( Invalid_Argument ); + darken_params = dp; + } + else +#endif + darken_params = (FT_Int*)value; + + x1 = darken_params[0]; + y1 = darken_params[1]; + x2 = darken_params[2]; + y2 = darken_params[3]; + x3 = darken_params[4]; + y3 = darken_params[5]; + x4 = darken_params[6]; + y4 = darken_params[7]; if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 || y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 || @@ -210,10 +284,28 @@ } else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) { - FT_Bool* no_stem_darkening = (FT_Bool*)value; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; + long nsd = ft_strtol( s, NULL, 10 ); + + if ( nsd == 0 ) + module->no_stem_darkening = 0; + else if ( nsd == 1 ) + module->no_stem_darkening = 1; + else + return FT_THROW( Invalid_Argument ); + } + else +#endif + { + FT_Bool* no_stem_darkening = (FT_Bool*)value; - module->no_stem_darkening = *no_stem_darkening; + + module->no_stem_darkening = *no_stem_darkening; + } return error; } diff --git a/src/autofit/afmodule.h b/src/autofit/afmodule.h index 3c61d89..e65db5f 100644 --- a/src/autofit/afmodule.h +++ b/src/autofit/afmodule.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module implementation (specification). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFMODULE_H__ -#define __AFMODULE_H__ +#ifndef AFMODULE_H_ +#define AFMODULE_H_ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H @@ -52,7 +52,7 @@ FT_DECLARE_MODULE( autofit_module_class ) FT_END_HEADER -#endif /* __AFMODULE_H__ */ +#endif /* AFMODULE_H_ */ /* END */ diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c index 37254a2..3cbd916 100644 --- a/src/autofit/afpic.c +++ b/src/autofit/afpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009-2015 by */ +/* Copyright 2009-2016 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -122,7 +122,7 @@ #include "afwrtsys.h" #undef SCRIPT -#define SCRIPT( s, S, d, h, sss ) \ +#define SCRIPT( s, S, d, h, H, sss ) \ FT_Init_Class_af_ ## s ## _script_class( \ &container->af_script_classes_rec[ss++] ); diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h index 9b45069..98a45a2 100644 --- a/src/autofit/afpic.h +++ b/src/autofit/afpic.h @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009-2015 by */ +/* Copyright 2009-2016 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFPIC_H__ -#define __AFPIC_H__ +#ifndef AFPIC_H_ +#define AFPIC_H_ #include FT_INTERNAL_PIC_H @@ -99,7 +99,7 @@ FT_END_HEADER /* */ -#endif /* __AFPIC_H__ */ +#endif /* AFPIC_H_ */ /* END */ diff --git a/src/autofit/afranges.c b/src/autofit/afranges.c index cf8bb7c..732f3d1 100644 --- a/src/autofit/afranges.c +++ b/src/autofit/afranges.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter Unicode script ranges (body). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,55 +58,101 @@ const AF_Script_UniRangeRec af_arab_uniranges[] = { - AF_UNIRANGE_REC( 0x0600UL, 0x06FFUL ), /* Arabic */ - AF_UNIRANGE_REC( 0x0750UL, 0x07FFUL ), /* Arabic Supplement */ - AF_UNIRANGE_REC( 0x08A0UL, 0x08FFUL ), /* Arabic Extended-A */ - AF_UNIRANGE_REC( 0xFB50UL, 0xFDFFUL ), /* Arabic Presentation Forms-A */ - AF_UNIRANGE_REC( 0xFE70UL, 0xFEFFUL ), /* Arabic Presentation Forms-B */ - AF_UNIRANGE_REC( 0x1EE00UL, 0x1EEFFUL ), /* Arabic Mathematical Alphabetic Symbols */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0600, 0x06FF ), /* Arabic */ + AF_UNIRANGE_REC( 0x0750, 0x07FF ), /* Arabic Supplement */ + AF_UNIRANGE_REC( 0x08A0, 0x08FF ), /* Arabic Extended-A */ + AF_UNIRANGE_REC( 0xFB50, 0xFDFF ), /* Arabic Presentation Forms-A */ + AF_UNIRANGE_REC( 0xFE70, 0xFEFF ), /* Arabic Presentation Forms-B */ + AF_UNIRANGE_REC( 0x1EE00, 0x1EEFF ), /* Arabic Mathematical Alphabetic Symbols */ + AF_UNIRANGE_REC( 0, 0 ) }; const AF_Script_UniRangeRec af_arab_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0600UL, 0x0605UL ), - AF_UNIRANGE_REC( 0x0610UL, 0x061AUL ), - AF_UNIRANGE_REC( 0x064BUL, 0x065FUL ), - AF_UNIRANGE_REC( 0x0670UL, 0x0670UL ), - AF_UNIRANGE_REC( 0x06D6UL, 0x06DCUL ), - AF_UNIRANGE_REC( 0x06DFUL, 0x06E4UL ), - AF_UNIRANGE_REC( 0x06E7UL, 0x06E8UL ), - AF_UNIRANGE_REC( 0x06EAUL, 0x06EDUL ), - AF_UNIRANGE_REC( 0x08E3UL, 0x08FFUL ), - AF_UNIRANGE_REC( 0xFBB2UL, 0xFBC1UL ), - AF_UNIRANGE_REC( 0xFE70UL, 0xFE70UL ), - AF_UNIRANGE_REC( 0xFE72UL, 0xFE72UL ), - AF_UNIRANGE_REC( 0xFE74UL, 0xFE74UL ), - AF_UNIRANGE_REC( 0xFE76UL, 0xFE76UL ), - AF_UNIRANGE_REC( 0xFE78UL, 0xFE78UL ), - AF_UNIRANGE_REC( 0xFE7AUL, 0xFE7AUL ), - AF_UNIRANGE_REC( 0xFE7CUL, 0xFE7CUL ), - AF_UNIRANGE_REC( 0xFE7EUL, 0xFE7EUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0600, 0x0605 ), + AF_UNIRANGE_REC( 0x0610, 0x061A ), + AF_UNIRANGE_REC( 0x064B, 0x065F ), + AF_UNIRANGE_REC( 0x0670, 0x0670 ), + AF_UNIRANGE_REC( 0x06D6, 0x06DC ), + AF_UNIRANGE_REC( 0x06DF, 0x06E4 ), + AF_UNIRANGE_REC( 0x06E7, 0x06E8 ), + AF_UNIRANGE_REC( 0x06EA, 0x06ED ), + AF_UNIRANGE_REC( 0x08D4, 0x08E1 ), + AF_UNIRANGE_REC( 0x08E3, 0x08FF ), + AF_UNIRANGE_REC( 0xFBB2, 0xFBC1 ), + AF_UNIRANGE_REC( 0xFE70, 0xFE70 ), + AF_UNIRANGE_REC( 0xFE72, 0xFE72 ), + AF_UNIRANGE_REC( 0xFE74, 0xFE74 ), + AF_UNIRANGE_REC( 0xFE76, 0xFE76 ), + AF_UNIRANGE_REC( 0xFE78, 0xFE78 ), + AF_UNIRANGE_REC( 0xFE7A, 0xFE7A ), + AF_UNIRANGE_REC( 0xFE7C, 0xFE7C ), + AF_UNIRANGE_REC( 0xFE7E, 0xFE7E ), + AF_UNIRANGE_REC( 0, 0 ) + }; + + + const AF_Script_UniRangeRec af_armn_uniranges[] = + { + AF_UNIRANGE_REC( 0x0530, 0x058F ), /* Armenian */ + AF_UNIRANGE_REC( 0xFB13, 0xFB17 ), /* Alphab. Present. Forms (Armenian) */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_armn_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0x0559, 0x055F ), + AF_UNIRANGE_REC( 0, 0 ) + }; + + + const AF_Script_UniRangeRec af_beng_uniranges[] = + { + AF_UNIRANGE_REC( 0x0980, 0x09FF ), /* Bengali */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_beng_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0x0981, 0x0981 ), + AF_UNIRANGE_REC( 0x09BC, 0x09BC ), + AF_UNIRANGE_REC( 0x09C1, 0x09C4 ), + AF_UNIRANGE_REC( 0x09CD, 0x09CD ), + AF_UNIRANGE_REC( 0x09E2, 0x09E3 ), + AF_UNIRANGE_REC( 0, 0 ) + }; + + + const AF_Script_UniRangeRec af_cher_uniranges[] = + { + AF_UNIRANGE_REC( 0x13A0, 0x13FF ), /* Cherokee */ + AF_UNIRANGE_REC( 0xAB70, 0xABBF ), /* Cherokee Supplement */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_cher_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0, 0 ) }; 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 */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0400, 0x04FF ), /* Cyrillic */ + AF_UNIRANGE_REC( 0x0500, 0x052F ), /* Cyrillic Supplement */ + AF_UNIRANGE_REC( 0x2DE0, 0x2DFF ), /* Cyrillic Extended-A */ + AF_UNIRANGE_REC( 0xA640, 0xA69F ), /* Cyrillic Extended-B */ + AF_UNIRANGE_REC( 0x1C80, 0x1C8F ), /* Cyrillic Extended-C */ + AF_UNIRANGE_REC( 0, 0 ) }; const AF_Script_UniRangeRec af_cyrl_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0483UL, 0x0489UL ), - AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), - AF_UNIRANGE_REC( 0xA66FUL, 0xA67FUL ), - AF_UNIRANGE_REC( 0xA69EUL, 0xA69FUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0483, 0x0489 ), + AF_UNIRANGE_REC( 0x2DE0, 0x2DFF ), + AF_UNIRANGE_REC( 0xA66F, 0xA67F ), + AF_UNIRANGE_REC( 0xA69E, 0xA69F ), + AF_UNIRANGE_REC( 0, 0 ) }; @@ -116,474 +162,503 @@ const AF_Script_UniRangeRec af_deva_uniranges[] = { - AF_UNIRANGE_REC( 0x0900UL, 0x093BUL ), /* Devanagari */ + AF_UNIRANGE_REC( 0x0900, 0x093B ), /* Devanagari */ /* omitting U+093C nukta */ - AF_UNIRANGE_REC( 0x093DUL, 0x0950UL ), /* ... continued */ + AF_UNIRANGE_REC( 0x093D, 0x0950 ), /* ... continued */ /* omitting U+0951 udatta, U+0952 anudatta */ - AF_UNIRANGE_REC( 0x0953UL, 0x0963UL ), /* ... continued */ + AF_UNIRANGE_REC( 0x0953, 0x0963 ), /* ... continued */ /* omitting U+0964 danda, U+0965 double danda */ - AF_UNIRANGE_REC( 0x0966UL, 0x097FUL ), /* ... continued */ - AF_UNIRANGE_REC( 0x20B9UL, 0x20B9UL ), /* (new) Rupee sign */ - AF_UNIRANGE_REC( 0xA8E0UL, 0xA8FFUL ), /* Devanagari Extended */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0966, 0x097F ), /* ... continued */ + AF_UNIRANGE_REC( 0x20B9, 0x20B9 ), /* (new) Rupee sign */ + AF_UNIRANGE_REC( 0xA8E0, 0xA8FF ), /* Devanagari Extended */ + AF_UNIRANGE_REC( 0, 0 ) }; const AF_Script_UniRangeRec af_deva_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0900UL, 0x0902UL ), - AF_UNIRANGE_REC( 0x093AUL, 0x093AUL ), - AF_UNIRANGE_REC( 0x0941UL, 0x0948UL ), - AF_UNIRANGE_REC( 0x094DUL, 0x094DUL ), - AF_UNIRANGE_REC( 0x0953UL, 0x0957UL ), - AF_UNIRANGE_REC( 0x0962UL, 0x0963UL ), - AF_UNIRANGE_REC( 0xA8E0UL, 0xA8F1UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0900, 0x0902 ), + AF_UNIRANGE_REC( 0x093A, 0x093A ), + AF_UNIRANGE_REC( 0x0941, 0x0948 ), + AF_UNIRANGE_REC( 0x094D, 0x094D ), + AF_UNIRANGE_REC( 0x0953, 0x0957 ), + AF_UNIRANGE_REC( 0x0962, 0x0963 ), + AF_UNIRANGE_REC( 0xA8E0, 0xA8F1 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_grek_uniranges[] = + const AF_Script_UniRangeRec af_ethi_uniranges[] = { - AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ - AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1200, 0x137F ), /* Ethiopic */ + AF_UNIRANGE_REC( 0x1380, 0x139F ), /* Ethiopic Supplement */ + AF_UNIRANGE_REC( 0x2D80, 0x2DDF ), /* Ethiopic Extended */ + AF_UNIRANGE_REC( 0xAB00, 0xAB2F ), /* Ethiopic Extended-A */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_grek_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_ethi_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x037AUL, 0x037AUL ), - AF_UNIRANGE_REC( 0x0384UL, 0x0385UL ), - AF_UNIRANGE_REC( 0x1FBDUL, 0x1FC1UL ), - AF_UNIRANGE_REC( 0x1FCDUL, 0x1FCFUL ), - AF_UNIRANGE_REC( 0x1FDDUL, 0x1FDFUL ), - AF_UNIRANGE_REC( 0x1FEDUL, 0x1FEFUL ), - AF_UNIRANGE_REC( 0x1FFDUL, 0x1FFEUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x135D, 0x135F ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_hebr_uniranges[] = + const AF_Script_UniRangeRec af_geor_uniranges[] = { - AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */ - AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x10D0, 0x10FF ), /* Georgian (Mkhedruli) */ +#if 0 + /* the following range is proposed for inclusion in Unicode */ + AF_UNIRANGE_REC( 0x1C90, 0x1CBF ), /* Georgian (Mtavruli) */ +#endif + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_hebr_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_geor_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0591UL, 0x05BFUL ), - AF_UNIRANGE_REC( 0x05C1UL, 0x05C2UL ), - AF_UNIRANGE_REC( 0x05C4UL, 0x05C5UL ), - AF_UNIRANGE_REC( 0x05C7UL, 0x05C7UL ), - AF_UNIRANGE_REC( 0xFB1EUL, 0xFB1EUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_khmr_uniranges[] = + const AF_Script_UniRangeRec af_geok_uniranges[] = { - AF_UNIRANGE_REC( 0x1780UL, 0x17FFUL ), /* Khmer */ - AF_UNIRANGE_REC( 0UL, 0UL ) + /* Khutsuri */ + AF_UNIRANGE_REC( 0x10A0, 0x10CD ), /* Georgian (Asomtavruli) */ + AF_UNIRANGE_REC( 0x2D00, 0x2D2D ), /* Georgian (Nuskhuri) */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_khmr_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_geok_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x17B7UL, 0x17BDUL ), - AF_UNIRANGE_REC( 0x17C6UL, 0x17C6UL ), - AF_UNIRANGE_REC( 0x17C9UL, 0x17D3UL ), - AF_UNIRANGE_REC( 0x17DDUL, 0x17DDUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_khms_uniranges[] = + const AF_Script_UniRangeRec af_grek_uniranges[] = { - AF_UNIRANGE_REC( 0x19E0UL, 0x19FFUL ), /* Khmer Symbols */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0370, 0x03FF ), /* Greek and Coptic */ + AF_UNIRANGE_REC( 0x1F00, 0x1FFF ), /* Greek Extended */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_khms_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_grek_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x037A, 0x037A ), + AF_UNIRANGE_REC( 0x0384, 0x0385 ), + AF_UNIRANGE_REC( 0x1FBD, 0x1FC1 ), + AF_UNIRANGE_REC( 0x1FCD, 0x1FCF ), + AF_UNIRANGE_REC( 0x1FDD, 0x1FDF ), + AF_UNIRANGE_REC( 0x1FED, 0x1FEF ), + AF_UNIRANGE_REC( 0x1FFD, 0x1FFE ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_lao_uniranges[] = + const AF_Script_UniRangeRec af_gujr_uniranges[] = { - AF_UNIRANGE_REC( 0x0E80UL, 0x0EFFUL ), /* Lao */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0A80, 0x0AFF ), /* Gujarati */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_lao_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_gujr_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0EB1UL, 0x0EB1UL ), - AF_UNIRANGE_REC( 0x0EB4UL, 0x0EBCUL ), - AF_UNIRANGE_REC( 0x0EC8UL, 0x0ECDUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0A81, 0x0A82 ), + AF_UNIRANGE_REC( 0x0ABC, 0x0ABC ), + AF_UNIRANGE_REC( 0x0AC1, 0x0AC8 ), + AF_UNIRANGE_REC( 0x0ACD, 0x0ACD ), + AF_UNIRANGE_REC( 0x0AE2, 0x0AE3 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_latn_uniranges[] = + const AF_Script_UniRangeRec af_guru_uniranges[] = { - AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ - AF_UNIRANGE_REC( 0x00A0UL, 0x00A9UL ), /* Latin-1 Supplement (no control chars) */ - AF_UNIRANGE_REC( 0x00ABUL, 0x00B1UL ), /* ... continued */ - AF_UNIRANGE_REC( 0x00B4UL, 0x00B8UL ), /* ... continued */ - AF_UNIRANGE_REC( 0x00BBUL, 0x00FFUL ), /* ... continued */ - AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ - AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ - AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ - AF_UNIRANGE_REC( 0x02B9UL, 0x02DFUL ), /* Spacing Modifier Letters */ - AF_UNIRANGE_REC( 0x02E5UL, 0x02FFUL ), /* ... continued */ - AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ - AF_UNIRANGE_REC( 0x1AB0UL, 0x1ABEUL ), /* Combining Diacritical Marks Extended */ - AF_UNIRANGE_REC( 0x1D00UL, 0x1D2BUL ), /* Phonetic Extensions */ - AF_UNIRANGE_REC( 0x1D6BUL, 0x1D77UL ), /* ... continued */ - AF_UNIRANGE_REC( 0x1D79UL, 0x1D7FUL ), /* ... continued */ - AF_UNIRANGE_REC( 0x1D80UL, 0x1D9AUL ), /* Phonetic Extensions Supplement */ - AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ - AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ - AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ - AF_UNIRANGE_REC( 0x20A0UL, 0x20B8UL ), /* Currency Symbols ... */ - AF_UNIRANGE_REC( 0x20BAUL, 0x20CFUL ), /* ... except new Rupee sign */ - AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ - AF_UNIRANGE_REC( 0x2C60UL, 0x2C7BUL ), /* Latin Extended-C */ - AF_UNIRANGE_REC( 0x2C7EUL, 0x2C7FUL ), /* ... continued */ - AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ - AF_UNIRANGE_REC( 0xA720UL, 0xA76FUL ), /* Latin Extended-D */ - AF_UNIRANGE_REC( 0xA771UL, 0xA7F7UL ), /* ... continued */ - AF_UNIRANGE_REC( 0xA7FAUL, 0xA7FFUL ), /* ... continued */ - AF_UNIRANGE_REC( 0xAB30UL, 0xAB5BUL ), /* Latin Extended-E */ - AF_UNIRANGE_REC( 0xAB60UL, 0xAB6FUL ), /* ... continued */ - AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ - AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0A00, 0x0A7F ), /* Gurmukhi */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_latn_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_guru_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x005EUL, 0x0060UL ), - AF_UNIRANGE_REC( 0x007EUL, 0x007EUL ), - AF_UNIRANGE_REC( 0x00A8UL, 0x00A9UL ), - AF_UNIRANGE_REC( 0x00AEUL, 0x00B0UL ), - AF_UNIRANGE_REC( 0x00B4UL, 0x00B4UL ), - AF_UNIRANGE_REC( 0x00B8UL, 0x00B8UL ), - AF_UNIRANGE_REC( 0x00BCUL, 0x00BEUL ), - AF_UNIRANGE_REC( 0x02B9UL, 0x02DFUL ), - AF_UNIRANGE_REC( 0x02E5UL, 0x02FFUL ), - AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), - AF_UNIRANGE_REC( 0x1AB0UL, 0x1ABEUL ), - AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), - AF_UNIRANGE_REC( 0x2017UL, 0x2017UL ), - AF_UNIRANGE_REC( 0x203EUL, 0x203EUL ), - AF_UNIRANGE_REC( 0xA788UL, 0xA788UL ), - AF_UNIRANGE_REC( 0xA7F8UL, 0xA7FAUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0A01, 0x0A02 ), + AF_UNIRANGE_REC( 0x0A3C, 0x0A3C ), + AF_UNIRANGE_REC( 0x0A41, 0x0A51 ), + AF_UNIRANGE_REC( 0x0A70, 0x0A71 ), + AF_UNIRANGE_REC( 0x0A75, 0x0A75 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_latb_uniranges[] = + const AF_Script_UniRangeRec af_hebr_uniranges[] = { - AF_UNIRANGE_REC( 0x1D62UL, 0x1D6AUL ), /* some small subscript letters */ - AF_UNIRANGE_REC( 0x2080UL, 0x209CUL ), /* subscript digits and letters */ - AF_UNIRANGE_REC( 0x2C7CUL, 0x2C7CUL ), /* latin subscript small letter j */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0590, 0x05FF ), /* Hebrew */ + AF_UNIRANGE_REC( 0xFB1D, 0xFB4F ), /* Alphab. Present. Forms (Hebrew) */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_latb_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_hebr_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0591, 0x05BF ), + AF_UNIRANGE_REC( 0x05C1, 0x05C2 ), + AF_UNIRANGE_REC( 0x05C4, 0x05C5 ), + AF_UNIRANGE_REC( 0x05C7, 0x05C7 ), + AF_UNIRANGE_REC( 0xFB1E, 0xFB1E ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_latp_uniranges[] = + const AF_Script_UniRangeRec af_knda_uniranges[] = { - AF_UNIRANGE_REC( 0x00AAUL, 0x00AAUL ), /* feminine ordinal indicator */ - AF_UNIRANGE_REC( 0x00B2UL, 0x00B3UL ), /* superscript two and three */ - AF_UNIRANGE_REC( 0x00B9UL, 0x00BAUL ), /* superscript one, masc. ord. indic. */ - AF_UNIRANGE_REC( 0x02B0UL, 0x02B8UL ), /* some latin superscript mod. letters */ - AF_UNIRANGE_REC( 0x02E0UL, 0x02E4UL ), /* some IPA modifier letters */ - AF_UNIRANGE_REC( 0x1D2CUL, 0x1D61UL ), /* latin superscript modifier letters */ - AF_UNIRANGE_REC( 0x1D78UL, 0x1D78UL ), /* modifier letter cyrillic en */ - AF_UNIRANGE_REC( 0x1D9BUL, 0x1DBFUL ), /* more modifier letters */ - AF_UNIRANGE_REC( 0x2070UL, 0x207FUL ), /* superscript digits and letters */ - AF_UNIRANGE_REC( 0x2C7DUL, 0x2C7DUL ), /* modifier letter capital v */ - AF_UNIRANGE_REC( 0xA770UL, 0xA770UL ), /* modifier letter us */ - AF_UNIRANGE_REC( 0xA7F8UL, 0xA7F9UL ), /* more modifier letters */ - AF_UNIRANGE_REC( 0xAB5CUL, 0xAB5FUL ), /* more modifier letters */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0C80, 0x0CFF ), /* Kannada */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_latp_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_knda_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0C81, 0x0C81 ), + AF_UNIRANGE_REC( 0x0CBC, 0x0CBC ), + AF_UNIRANGE_REC( 0x0CBF, 0x0CBF ), + AF_UNIRANGE_REC( 0x0CC6, 0x0CC6 ), + AF_UNIRANGE_REC( 0x0CCC, 0x0CCD ), + AF_UNIRANGE_REC( 0x0CE2, 0x0CE3 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_mymr_uniranges[] = + const AF_Script_UniRangeRec af_khmr_uniranges[] = { - AF_UNIRANGE_REC( 0x1000UL, 0x109FUL ), /* Myanmar */ - AF_UNIRANGE_REC( 0xA9E0UL, 0xA9FFUL ), /* Myanmar Extended-B */ - AF_UNIRANGE_REC( 0xAA60UL, 0xAA7FUL ), /* Myanmar Extended-A */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1780, 0x17FF ), /* Khmer */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_mymr_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_khmr_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x102DUL, 0x1030UL ), - AF_UNIRANGE_REC( 0x1032UL, 0x1037UL ), - AF_UNIRANGE_REC( 0x103AUL, 0x103AUL ), - AF_UNIRANGE_REC( 0x103DUL, 0x103EUL ), - AF_UNIRANGE_REC( 0x1058UL, 0x1059UL ), - AF_UNIRANGE_REC( 0x105EUL, 0x1060UL ), - AF_UNIRANGE_REC( 0x1071UL, 0x1074UL ), - AF_UNIRANGE_REC( 0x1082UL, 0x1082UL ), - AF_UNIRANGE_REC( 0x1085UL, 0x1086UL ), - AF_UNIRANGE_REC( 0x108DUL, 0x108DUL ), - AF_UNIRANGE_REC( 0xA9E5UL, 0xA9E5UL ), - AF_UNIRANGE_REC( 0xAA7CUL, 0xAA7CUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x17B7, 0x17BD ), + AF_UNIRANGE_REC( 0x17C6, 0x17C6 ), + AF_UNIRANGE_REC( 0x17C9, 0x17D3 ), + AF_UNIRANGE_REC( 0x17DD, 0x17DD ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_none_uniranges[] = + const AF_Script_UniRangeRec af_khms_uniranges[] = { - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x19E0, 0x19FF ), /* Khmer Symbols */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_none_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_khms_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_telu_uniranges[] = + const AF_Script_UniRangeRec af_lao_uniranges[] = { - AF_UNIRANGE_REC( 0x0C00UL, 0x0C7FUL ), /* Telugu */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0E80, 0x0EFF ), /* Lao */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_telu_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_lao_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0C00UL, 0x0C00UL ), - AF_UNIRANGE_REC( 0x0C3EUL, 0x0C40UL ), - AF_UNIRANGE_REC( 0x0C46UL, 0x0C56UL ), - AF_UNIRANGE_REC( 0x0C62UL, 0x0C63UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0EB1, 0x0EB1 ), + AF_UNIRANGE_REC( 0x0EB4, 0x0EBC ), + AF_UNIRANGE_REC( 0x0EC8, 0x0ECD ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_thai_uniranges[] = + const AF_Script_UniRangeRec af_latn_uniranges[] = { - AF_UNIRANGE_REC( 0x0E00UL, 0x0E7FUL ), /* Thai */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0020, 0x007F ), /* Basic Latin (no control chars) */ + AF_UNIRANGE_REC( 0x00A0, 0x00A9 ), /* Latin-1 Supplement (no control chars) */ + AF_UNIRANGE_REC( 0x00AB, 0x00B1 ), /* ... continued */ + AF_UNIRANGE_REC( 0x00B4, 0x00B8 ), /* ... continued */ + AF_UNIRANGE_REC( 0x00BB, 0x00FF ), /* ... continued */ + AF_UNIRANGE_REC( 0x0100, 0x017F ), /* Latin Extended-A */ + AF_UNIRANGE_REC( 0x0180, 0x024F ), /* Latin Extended-B */ + AF_UNIRANGE_REC( 0x0250, 0x02AF ), /* IPA Extensions */ + AF_UNIRANGE_REC( 0x02B9, 0x02DF ), /* Spacing Modifier Letters */ + AF_UNIRANGE_REC( 0x02E5, 0x02FF ), /* ... continued */ + AF_UNIRANGE_REC( 0x0300, 0x036F ), /* Combining Diacritical Marks */ + AF_UNIRANGE_REC( 0x1AB0, 0x1ABE ), /* Combining Diacritical Marks Extended */ + AF_UNIRANGE_REC( 0x1D00, 0x1D2B ), /* Phonetic Extensions */ + AF_UNIRANGE_REC( 0x1D6B, 0x1D77 ), /* ... continued */ + AF_UNIRANGE_REC( 0x1D79, 0x1D7F ), /* ... continued */ + AF_UNIRANGE_REC( 0x1D80, 0x1D9A ), /* Phonetic Extensions Supplement */ + AF_UNIRANGE_REC( 0x1DC0, 0x1DFF ), /* Combining Diacritical Marks Supplement */ + AF_UNIRANGE_REC( 0x1E00, 0x1EFF ), /* Latin Extended Additional */ + AF_UNIRANGE_REC( 0x2000, 0x206F ), /* General Punctuation */ + AF_UNIRANGE_REC( 0x20A0, 0x20B8 ), /* Currency Symbols ... */ + AF_UNIRANGE_REC( 0x20BA, 0x20CF ), /* ... except new Rupee sign */ + AF_UNIRANGE_REC( 0x2150, 0x218F ), /* Number Forms */ + AF_UNIRANGE_REC( 0x2C60, 0x2C7B ), /* Latin Extended-C */ + AF_UNIRANGE_REC( 0x2C7E, 0x2C7F ), /* ... continued */ + AF_UNIRANGE_REC( 0x2E00, 0x2E7F ), /* Supplemental Punctuation */ + AF_UNIRANGE_REC( 0xA720, 0xA76F ), /* Latin Extended-D */ + AF_UNIRANGE_REC( 0xA771, 0xA7F7 ), /* ... continued */ + AF_UNIRANGE_REC( 0xA7FA, 0xA7FF ), /* ... continued */ + AF_UNIRANGE_REC( 0xAB30, 0xAB5B ), /* Latin Extended-E */ + AF_UNIRANGE_REC( 0xAB60, 0xAB6F ), /* ... continued */ + AF_UNIRANGE_REC( 0xFB00, 0xFB06 ), /* Alphab. Present. Forms (Latin Ligs) */ + AF_UNIRANGE_REC( 0x1D400, 0x1D7FF ), /* Mathematical Alphanumeric Symbols */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_thai_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_latn_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0E31UL, 0x0E31UL ), - AF_UNIRANGE_REC( 0x0E34UL, 0x0E3AUL ), - AF_UNIRANGE_REC( 0x0E47UL, 0x0E4EUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x005E, 0x0060 ), + AF_UNIRANGE_REC( 0x007E, 0x007E ), + AF_UNIRANGE_REC( 0x00A8, 0x00A9 ), + AF_UNIRANGE_REC( 0x00AE, 0x00B0 ), + AF_UNIRANGE_REC( 0x00B4, 0x00B4 ), + AF_UNIRANGE_REC( 0x00B8, 0x00B8 ), + AF_UNIRANGE_REC( 0x00BC, 0x00BE ), + AF_UNIRANGE_REC( 0x02B9, 0x02DF ), + AF_UNIRANGE_REC( 0x02E5, 0x02FF ), + AF_UNIRANGE_REC( 0x0300, 0x036F ), + AF_UNIRANGE_REC( 0x1AB0, 0x1ABE ), + AF_UNIRANGE_REC( 0x1DC0, 0x1DFF ), + AF_UNIRANGE_REC( 0x2017, 0x2017 ), + AF_UNIRANGE_REC( 0x203E, 0x203E ), + AF_UNIRANGE_REC( 0xA788, 0xA788 ), + AF_UNIRANGE_REC( 0xA7F8, 0xA7FA ), + AF_UNIRANGE_REC( 0, 0 ) }; -#ifdef AF_CONFIG_OPTION_INDIC + const AF_Script_UniRangeRec af_latb_uniranges[] = + { + AF_UNIRANGE_REC( 0x1D62, 0x1D6A ), /* some small subscript letters */ + AF_UNIRANGE_REC( 0x2080, 0x209C ), /* subscript digits and letters */ + AF_UNIRANGE_REC( 0x2C7C, 0x2C7C ), /* latin subscript small letter j */ + AF_UNIRANGE_REC( 0, 0 ) + }; - const AF_Script_UniRangeRec af_beng_uniranges[] = + const AF_Script_UniRangeRec af_latb_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_beng_nonbase_uniranges[] = + + const AF_Script_UniRangeRec af_latp_uniranges[] = + { + AF_UNIRANGE_REC( 0x00AA, 0x00AA ), /* feminine ordinal indicator */ + AF_UNIRANGE_REC( 0x00B2, 0x00B3 ), /* superscript two and three */ + AF_UNIRANGE_REC( 0x00B9, 0x00BA ), /* superscript one, masc. ord. indic. */ + AF_UNIRANGE_REC( 0x02B0, 0x02B8 ), /* some latin superscript mod. letters */ + AF_UNIRANGE_REC( 0x02E0, 0x02E4 ), /* some IPA modifier letters */ + AF_UNIRANGE_REC( 0x1D2C, 0x1D61 ), /* latin superscript modifier letters */ + AF_UNIRANGE_REC( 0x1D78, 0x1D78 ), /* modifier letter cyrillic en */ + AF_UNIRANGE_REC( 0x1D9B, 0x1DBF ), /* more modifier letters */ + AF_UNIRANGE_REC( 0x2070, 0x207F ), /* superscript digits and letters */ + AF_UNIRANGE_REC( 0x2C7D, 0x2C7D ), /* modifier letter capital v */ + AF_UNIRANGE_REC( 0xA770, 0xA770 ), /* modifier letter us */ + AF_UNIRANGE_REC( 0xA7F8, 0xA7F9 ), /* more modifier letters */ + AF_UNIRANGE_REC( 0xAB5C, 0xAB5F ), /* more modifier letters */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_latp_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0981UL, 0x0981UL ), - AF_UNIRANGE_REC( 0x09BCUL, 0x09BCUL ), - AF_UNIRANGE_REC( 0x09C1UL, 0x09C4UL ), - AF_UNIRANGE_REC( 0x09CDUL, 0x09CDUL ), - AF_UNIRANGE_REC( 0x09E2UL, 0x09E3UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_gujr_uniranges[] = + const AF_Script_UniRangeRec af_mlym_uniranges[] = { - AF_UNIRANGE_REC( 0x0A80UL, 0x0AFFUL ), /* Gujarati */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0D00, 0x0D7F ), /* Malayalam */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_gujr_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_mlym_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0A81UL, 0x0A82UL ), - AF_UNIRANGE_REC( 0x0ABCUL, 0x0ABCUL ), - AF_UNIRANGE_REC( 0x0AC1UL, 0x0AC8UL ), - AF_UNIRANGE_REC( 0x0ACDUL, 0x0ACDUL ), - AF_UNIRANGE_REC( 0x0AE2UL, 0x0AE3UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0D01, 0x0D01 ), + AF_UNIRANGE_REC( 0x0D4D, 0x0D4E ), + AF_UNIRANGE_REC( 0x0D62, 0x0D63 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_guru_uniranges[] = + const AF_Script_UniRangeRec af_mymr_uniranges[] = { - AF_UNIRANGE_REC( 0x0A00UL, 0x0A7FUL ), /* Gurmukhi */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1000, 0x109F ), /* Myanmar */ + AF_UNIRANGE_REC( 0xA9E0, 0xA9FF ), /* Myanmar Extended-B */ + AF_UNIRANGE_REC( 0xAA60, 0xAA7F ), /* Myanmar Extended-A */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_guru_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_mymr_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0A01UL, 0x0A02UL ), - AF_UNIRANGE_REC( 0x0A3CUL, 0x0A3EUL ), - AF_UNIRANGE_REC( 0x0A41UL, 0x0A51UL ), - AF_UNIRANGE_REC( 0x0A70UL, 0x0A71UL ), - AF_UNIRANGE_REC( 0x0A75UL, 0x0A75UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x102D, 0x1030 ), + AF_UNIRANGE_REC( 0x1032, 0x1037 ), + AF_UNIRANGE_REC( 0x103A, 0x103A ), + AF_UNIRANGE_REC( 0x103D, 0x103E ), + AF_UNIRANGE_REC( 0x1058, 0x1059 ), + AF_UNIRANGE_REC( 0x105E, 0x1060 ), + AF_UNIRANGE_REC( 0x1071, 0x1074 ), + AF_UNIRANGE_REC( 0x1082, 0x1082 ), + AF_UNIRANGE_REC( 0x1085, 0x1086 ), + AF_UNIRANGE_REC( 0x108D, 0x108D ), + AF_UNIRANGE_REC( 0xA9E5, 0xA9E5 ), + AF_UNIRANGE_REC( 0xAA7C, 0xAA7C ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_knda_uniranges[] = + const AF_Script_UniRangeRec af_none_uniranges[] = { - AF_UNIRANGE_REC( 0x0C80UL, 0x0CFFUL ), /* Kannada */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_knda_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_none_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0C81UL, 0x0C81UL ), - AF_UNIRANGE_REC( 0x0CBCUL, 0x0CBCUL ), - AF_UNIRANGE_REC( 0x0CBFUL, 0x0CBFUL ), - AF_UNIRANGE_REC( 0x0CC6UL, 0x0CC6UL ), - AF_UNIRANGE_REC( 0x0CCCUL, 0x0CCDUL ), - AF_UNIRANGE_REC( 0x0CE2UL, 0x0CE3UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_limb_uniranges[] = + const AF_Script_UniRangeRec af_sinh_uniranges[] = { - AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0D80, 0x0DFF ), /* Sinhala */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_limb_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_sinh_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x1920UL, 0x1922UL ), - AF_UNIRANGE_REC( 0x1927UL, 0x1934UL ), - AF_UNIRANGE_REC( 0x1937UL, 0x193BUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0DCA, 0x0DCA ), + AF_UNIRANGE_REC( 0x0DD2, 0x0DD6 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_mlym_uniranges[] = + const AF_Script_UniRangeRec af_taml_uniranges[] = { - AF_UNIRANGE_REC( 0x0D00UL, 0x0D7FUL ), /* Malayalam */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0B80, 0x0BFF ), /* Tamil */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_mlym_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_taml_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0D01UL, 0x0D01UL ), - AF_UNIRANGE_REC( 0x0D4DUL, 0x0D4EUL ), - AF_UNIRANGE_REC( 0x0D62UL, 0x0D63UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0B82, 0x0B82 ), + AF_UNIRANGE_REC( 0x0BC0, 0x0BC2 ), + AF_UNIRANGE_REC( 0x0BCD, 0x0BCD ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_orya_uniranges[] = + const AF_Script_UniRangeRec af_telu_uniranges[] = { - AF_UNIRANGE_REC( 0x0B00UL, 0x0B7FUL ), /* Oriya */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0C00, 0x0C7F ), /* Telugu */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_orya_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_telu_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0B01UL, 0x0B02UL ), - AF_UNIRANGE_REC( 0x0B3CUL, 0x0B3CUL ), - AF_UNIRANGE_REC( 0x0B3FUL, 0x0B3FUL ), - AF_UNIRANGE_REC( 0x0B41UL, 0x0B44UL ), - AF_UNIRANGE_REC( 0x0B4DUL, 0x0B56UL ), - AF_UNIRANGE_REC( 0x0B62UL, 0x0B63UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0C00, 0x0C00 ), + AF_UNIRANGE_REC( 0x0C3E, 0x0C40 ), + AF_UNIRANGE_REC( 0x0C46, 0x0C56 ), + AF_UNIRANGE_REC( 0x0C62, 0x0C63 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_sinh_uniranges[] = + const AF_Script_UniRangeRec af_thai_uniranges[] = { - AF_UNIRANGE_REC( 0x0D80UL, 0x0DFFUL ), /* Sinhala */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0E00, 0x0E7F ), /* Thai */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_sinh_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_thai_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0DCAUL, 0x0DCAUL ), - AF_UNIRANGE_REC( 0x0DD2UL, 0x0DD6UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0E31, 0x0E31 ), + AF_UNIRANGE_REC( 0x0E34, 0x0E3A ), + AF_UNIRANGE_REC( 0x0E47, 0x0E4E ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_sund_uniranges[] = +#ifdef AF_CONFIG_OPTION_INDIC + + const AF_Script_UniRangeRec af_limb_uniranges[] = { - AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */ - AF_UNIRANGE_REC( 0x1CC0UL, 0x1CCFUL ), /* Sundanese Supplement */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1900, 0x194F ), /* Limbu */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_sund_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_limb_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x1B80UL, 0x1B82UL ), - AF_UNIRANGE_REC( 0x1BA1UL, 0x1BADUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1920, 0x1922 ), + AF_UNIRANGE_REC( 0x1927, 0x1934 ), + AF_UNIRANGE_REC( 0x1937, 0x193B ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_sylo_uniranges[] = + const AF_Script_UniRangeRec af_orya_uniranges[] = { - AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0B00, 0x0B7F ), /* Oriya */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_sylo_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_orya_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0xA802UL, 0xA802UL ), - AF_UNIRANGE_REC( 0xA806UL, 0xA806UL ), - AF_UNIRANGE_REC( 0xA80BUL, 0xA80BUL ), - AF_UNIRANGE_REC( 0xA825UL, 0xA826UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0B01, 0x0B02 ), + AF_UNIRANGE_REC( 0x0B3C, 0x0B3C ), + AF_UNIRANGE_REC( 0x0B3F, 0x0B3F ), + AF_UNIRANGE_REC( 0x0B41, 0x0B44 ), + AF_UNIRANGE_REC( 0x0B4D, 0x0B56 ), + AF_UNIRANGE_REC( 0x0B62, 0x0B63 ), + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_taml_uniranges[] = + const AF_Script_UniRangeRec af_sund_uniranges[] = { - AF_UNIRANGE_REC( 0x0B80UL, 0x0BFFUL ), /* Tamil */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1B80, 0x1BBF ), /* Sundanese */ + AF_UNIRANGE_REC( 0x1CC0, 0x1CCF ), /* Sundanese Supplement */ + AF_UNIRANGE_REC( 0, 0 ) }; - const AF_Script_UniRangeRec af_taml_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_sund_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0x1B80, 0x1B82 ), + AF_UNIRANGE_REC( 0x1BA1, 0x1BAD ), + AF_UNIRANGE_REC( 0, 0 ) + }; + + + const AF_Script_UniRangeRec af_sylo_uniranges[] = + { + AF_UNIRANGE_REC( 0xA800, 0xA82F ), /* Syloti Nagri */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_sylo_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0B82UL, 0x0B82UL ), - AF_UNIRANGE_REC( 0x0BC0UL, 0x0BC2UL ), - AF_UNIRANGE_REC( 0x0BCDUL, 0x0BCDUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0xA802, 0xA802 ), + AF_UNIRANGE_REC( 0xA806, 0xA806 ), + AF_UNIRANGE_REC( 0xA80B, 0xA80B ), + AF_UNIRANGE_REC( 0xA825, 0xA826 ), + AF_UNIRANGE_REC( 0, 0 ) }; const AF_Script_UniRangeRec af_tibt_uniranges[] = { - AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0F00, 0x0FFF ), /* Tibetan */ + AF_UNIRANGE_REC( 0, 0 ) }; const AF_Script_UniRangeRec af_tibt_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x0F18UL, 0x0F19UL ), - AF_UNIRANGE_REC( 0x0F35UL, 0x0F35UL ), - AF_UNIRANGE_REC( 0x0F37UL, 0x0F37UL ), - AF_UNIRANGE_REC( 0x0F39UL, 0x0F39UL ), - AF_UNIRANGE_REC( 0x0F3EUL, 0x0F3FUL ), - AF_UNIRANGE_REC( 0x0F71UL, 0x0F7EUL ), - AF_UNIRANGE_REC( 0x0F80UL, 0x0F84UL ), - AF_UNIRANGE_REC( 0x0F86UL, 0x0F87UL ), - AF_UNIRANGE_REC( 0x0F8DUL, 0x0FBCUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x0F18, 0x0F19 ), + AF_UNIRANGE_REC( 0x0F35, 0x0F35 ), + AF_UNIRANGE_REC( 0x0F37, 0x0F37 ), + AF_UNIRANGE_REC( 0x0F39, 0x0F39 ), + AF_UNIRANGE_REC( 0x0F3E, 0x0F3F ), + AF_UNIRANGE_REC( 0x0F71, 0x0F7E ), + AF_UNIRANGE_REC( 0x0F80, 0x0F84 ), + AF_UNIRANGE_REC( 0x0F86, 0x0F87 ), + AF_UNIRANGE_REC( 0x0F8D, 0x0FBC ), + AF_UNIRANGE_REC( 0, 0 ) }; #endif /* !AF_CONFIG_OPTION_INDIC */ @@ -594,44 +669,44 @@ const AF_Script_UniRangeRec af_hani_uniranges[] = { - AF_UNIRANGE_REC( 0x1100UL, 0x11FFUL ), /* Hangul Jamo */ - AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */ - AF_UNIRANGE_REC( 0x2F00UL, 0x2FDFUL ), /* Kangxi Radicals */ - AF_UNIRANGE_REC( 0x2FF0UL, 0x2FFFUL ), /* Ideographic Description Characters */ - AF_UNIRANGE_REC( 0x3000UL, 0x303FUL ), /* CJK Symbols and Punctuation */ - AF_UNIRANGE_REC( 0x3040UL, 0x309FUL ), /* Hiragana */ - AF_UNIRANGE_REC( 0x30A0UL, 0x30FFUL ), /* Katakana */ - AF_UNIRANGE_REC( 0x3100UL, 0x312FUL ), /* Bopomofo */ - AF_UNIRANGE_REC( 0x3130UL, 0x318FUL ), /* Hangul Compatibility Jamo */ - AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ), /* Kanbun */ - AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */ - AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */ - AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */ - AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */ - AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */ - AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */ - AF_UNIRANGE_REC( 0x4E00UL, 0x9FFFUL ), /* CJK Unified Ideographs */ - AF_UNIRANGE_REC( 0xA960UL, 0xA97FUL ), /* Hangul Jamo Extended-A */ - AF_UNIRANGE_REC( 0xAC00UL, 0xD7AFUL ), /* Hangul Syllables */ - AF_UNIRANGE_REC( 0xD7B0UL, 0xD7FFUL ), /* Hangul Jamo Extended-B */ - AF_UNIRANGE_REC( 0xF900UL, 0xFAFFUL ), /* CJK Compatibility Ideographs */ - AF_UNIRANGE_REC( 0xFE10UL, 0xFE1FUL ), /* Vertical forms */ - AF_UNIRANGE_REC( 0xFE30UL, 0xFE4FUL ), /* CJK Compatibility Forms */ - AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */ - AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ), /* Kana Supplement */ - AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ), /* Tai Xuan Hing Symbols */ - AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */ - AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ), /* CJK Unified Ideographs Extension C */ - AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ), /* CJK Unified Ideographs Extension D */ - AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ), /* CJK Compatibility Ideographs Supplement */ - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x1100, 0x11FF ), /* Hangul Jamo */ + AF_UNIRANGE_REC( 0x2E80, 0x2EFF ), /* CJK Radicals Supplement */ + AF_UNIRANGE_REC( 0x2F00, 0x2FDF ), /* Kangxi Radicals */ + AF_UNIRANGE_REC( 0x2FF0, 0x2FFF ), /* Ideographic Description Characters */ + AF_UNIRANGE_REC( 0x3000, 0x303F ), /* CJK Symbols and Punctuation */ + AF_UNIRANGE_REC( 0x3040, 0x309F ), /* Hiragana */ + AF_UNIRANGE_REC( 0x30A0, 0x30FF ), /* Katakana */ + AF_UNIRANGE_REC( 0x3100, 0x312F ), /* Bopomofo */ + AF_UNIRANGE_REC( 0x3130, 0x318F ), /* Hangul Compatibility Jamo */ + AF_UNIRANGE_REC( 0x3190, 0x319F ), /* Kanbun */ + AF_UNIRANGE_REC( 0x31A0, 0x31BF ), /* Bopomofo Extended */ + AF_UNIRANGE_REC( 0x31C0, 0x31EF ), /* CJK Strokes */ + AF_UNIRANGE_REC( 0x31F0, 0x31FF ), /* Katakana Phonetic Extensions */ + AF_UNIRANGE_REC( 0x3300, 0x33FF ), /* CJK Compatibility */ + AF_UNIRANGE_REC( 0x3400, 0x4DBF ), /* CJK Unified Ideographs Extension A */ + AF_UNIRANGE_REC( 0x4DC0, 0x4DFF ), /* Yijing Hexagram Symbols */ + AF_UNIRANGE_REC( 0x4E00, 0x9FFF ), /* CJK Unified Ideographs */ + AF_UNIRANGE_REC( 0xA960, 0xA97F ), /* Hangul Jamo Extended-A */ + AF_UNIRANGE_REC( 0xAC00, 0xD7AF ), /* Hangul Syllables */ + AF_UNIRANGE_REC( 0xD7B0, 0xD7FF ), /* Hangul Jamo Extended-B */ + AF_UNIRANGE_REC( 0xF900, 0xFAFF ), /* CJK Compatibility Ideographs */ + AF_UNIRANGE_REC( 0xFE10, 0xFE1F ), /* Vertical forms */ + AF_UNIRANGE_REC( 0xFE30, 0xFE4F ), /* CJK Compatibility Forms */ + AF_UNIRANGE_REC( 0xFF00, 0xFFEF ), /* Halfwidth and Fullwidth Forms */ + AF_UNIRANGE_REC( 0x1B000, 0x1B0FF ), /* Kana Supplement */ + AF_UNIRANGE_REC( 0x1D300, 0x1D35F ), /* Tai Xuan Hing Symbols */ + AF_UNIRANGE_REC( 0x20000, 0x2A6DF ), /* CJK Unified Ideographs Extension B */ + AF_UNIRANGE_REC( 0x2A700, 0x2B73F ), /* CJK Unified Ideographs Extension C */ + AF_UNIRANGE_REC( 0x2B740, 0x2B81F ), /* CJK Unified Ideographs Extension D */ + AF_UNIRANGE_REC( 0x2F800, 0x2FA1F ), /* CJK Compatibility Ideographs Supplement */ + AF_UNIRANGE_REC( 0, 0 ) }; const AF_Script_UniRangeRec af_hani_nonbase_uniranges[] = { - AF_UNIRANGE_REC( 0x302AUL, 0x302FUL ), - AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ), - AF_UNIRANGE_REC( 0UL, 0UL ) + AF_UNIRANGE_REC( 0x302A, 0x302F ), + AF_UNIRANGE_REC( 0x3190, 0x319F ), + AF_UNIRANGE_REC( 0, 0 ) }; #endif /* !AF_CONFIG_OPTION_CJK */ diff --git a/src/autofit/afranges.h b/src/autofit/afranges.h index bca5084..1a0e4b1 100644 --- a/src/autofit/afranges.h +++ b/src/autofit/afranges.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter Unicode script ranges (specification). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFRANGES_H__ -#define __AFRANGES_H__ +#ifndef AFRANGES_H_ +#define AFRANGES_H_ #include "aftypes.h" @@ -26,13 +26,13 @@ FT_BEGIN_HEADER #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ extern const AF_Script_UniRangeRec af_ ## s ## _uniranges[]; #include "afscript.h" #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ extern const AF_Script_UniRangeRec af_ ## s ## _nonbase_uniranges[]; #include "afscript.h" @@ -41,7 +41,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFRANGES_H__ */ +#endif /* AFRANGES_H_ */ /* END */ diff --git a/src/autofit/afscript.h b/src/autofit/afscript.h index 39ec652..cffe591 100644 --- a/src/autofit/afscript.h +++ b/src/autofit/afscript.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter scripts (specification only). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -33,141 +33,200 @@ SCRIPT( arab, ARAB, "Arabic", HB_SCRIPT_ARABIC, + HINTING_BOTTOM_TO_TOP, "\xD9\x84 \xD8\xAD \xD9\x80" ) /* ل ح ـ */ + SCRIPT( armn, ARMN, + "Armenian", + HB_SCRIPT_ARMENIAN, + HINTING_BOTTOM_TO_TOP, + "\xD5\xBD \xD5\x8D" ) /* ս Ս */ + + /* there are no simple forms for letters; we thus use two digit shapes */ + SCRIPT( beng, BENG, + "Bengali", + HB_SCRIPT_BENGALI, + HINTING_TOP_TO_BOTTOM, + "\xE0\xA7\xA6 \xE0\xA7\xAA" ) /* ০ ৪ */ + + SCRIPT( cher, CHER, + "Cherokee", + HB_SCRIPT_CHEROKEE, + HINTING_BOTTOM_TO_TOP, + "\xE1\x8E\xA4 \xE1\x8F\x85 \xEA\xAE\x95" ) /* Ꭴ Ꮕ ꮕ */ + SCRIPT( cyrl, CYRL, "Cyrillic", HB_SCRIPT_CYRILLIC, + HINTING_BOTTOM_TO_TOP, "\xD0\xBE \xD0\x9E" ) /* о О */ SCRIPT( deva, DEVA, "Devanagari", HB_SCRIPT_DEVANAGARI, + HINTING_TOP_TO_BOTTOM, "\xE0\xA4\xA0 \xE0\xA4\xB5 \xE0\xA4\x9F" ) /* ठ व ट */ + SCRIPT( ethi, ETHI, + "Ethiopic", + HB_SCRIPT_ETHIOPIC, + HINTING_BOTTOM_TO_TOP, + "\xE1\x8B\x90" ) /* ዐ */ + + SCRIPT( geor, GEOR, + "Georgian (Mkhedruli)", + HB_SCRIPT_GEORGIAN, + HINTING_BOTTOM_TO_TOP, + "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90" ) /* ი ე ა */ + + SCRIPT( geok, GEOK, + "Georgian (Khutsuri)", + HB_SCRIPT_INVALID, + HINTING_BOTTOM_TO_TOP, + "\xE1\x82\xB6 \xE1\x82\xB1 \xE2\xB4\x99" ) /* Ⴖ Ⴑ ⴙ */ + SCRIPT( grek, GREK, "Greek", HB_SCRIPT_GREEK, + HINTING_BOTTOM_TO_TOP, "\xCE\xBF \xCE\x9F" ) /* ο Ο */ + SCRIPT( gujr, GUJR, + "Gujarati", + HB_SCRIPT_GUJARATI, + HINTING_BOTTOM_TO_TOP, + "\xE0\xAA\x9F \xE0\xAB\xA6" ) /* ટ ૦ */ + + SCRIPT( guru, GURU, + "Gurmukhi", + HB_SCRIPT_GURMUKHI, + HINTING_TOP_TO_BOTTOM, + "\xE0\xA8\xA0 \xE0\xA8\xB0 \xE0\xA9\xA6" ) /* ਠ ਰ ੦ */ + SCRIPT( hebr, HEBR, "Hebrew", HB_SCRIPT_HEBREW, + HINTING_BOTTOM_TO_TOP, "\xD7\x9D" ) /* ם */ + SCRIPT( knda, KNDA, + "Kannada", + HB_SCRIPT_KANNADA, + HINTING_BOTTOM_TO_TOP, + "\xE0\xB3\xA6 \xE0\xB2\xAC" ) /* ೦ ಬ */ + /* only digit zero has a simple shape in the Khmer script */ SCRIPT( khmr, KHMR, "Khmer", HB_SCRIPT_KHMER, + HINTING_BOTTOM_TO_TOP, "\xE1\x9F\xA0" ) /* ០ */ SCRIPT( khms, KHMS, "Khmer Symbols", HB_SCRIPT_INVALID, + HINTING_BOTTOM_TO_TOP, "\xE1\xA7\xA1 \xE1\xA7\xAA" ) /* ᧡ ᧪ */ /* only digit zero has a simple shape in the Lao script */ SCRIPT( lao, LAO, "Lao", HB_SCRIPT_LAO, + HINTING_BOTTOM_TO_TOP, "\xE0\xBB\x90" ) /* ໐ */ SCRIPT( latn, LATN, "Latin", HB_SCRIPT_LATIN, + HINTING_BOTTOM_TO_TOP, "o O 0" ) SCRIPT( latb, LATB, "Latin Subscript Fallback", HB_SCRIPT_INVALID, + HINTING_BOTTOM_TO_TOP, "\xE2\x82\x92 \xE2\x82\x80" ) /* ₒ ₀ */ SCRIPT( latp, LATP, "Latin Superscript Fallback", HB_SCRIPT_INVALID, + HINTING_BOTTOM_TO_TOP, "\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* ᵒ ᴼ ⁰ */ + SCRIPT( mlym, MLYM, + "Malayalam", + HB_SCRIPT_MALAYALAM, + HINTING_BOTTOM_TO_TOP, + "\xE0\xB4\xA0 \xE0\xB4\xB1" ) /* ഠ റ */ + SCRIPT( mymr, MYMR, "Myanmar", HB_SCRIPT_MYANMAR, + HINTING_BOTTOM_TO_TOP, "\xE1\x80\x9D \xE1\x80\x84 \xE1\x80\x82" ) /* ဝ င ဂ */ SCRIPT( none, NONE, "no script", HB_SCRIPT_INVALID, + HINTING_BOTTOM_TO_TOP, "" ) + SCRIPT( sinh, SINH, + "Sinhala", + HB_SCRIPT_SINHALA, + HINTING_BOTTOM_TO_TOP, + "\xE0\xB6\xA7" ) /* ට */ + + /* only digit zero has a simple (round) shape in the Tamil script */ + SCRIPT( taml, TAML, + "Tamil", + HB_SCRIPT_TAMIL, + HINTING_BOTTOM_TO_TOP, + "\xE0\xAF\xA6" ) /* ௦ */ + /* there are no simple forms for letters; we thus use two digit shapes */ SCRIPT( telu, TELU, "Telugu", HB_SCRIPT_TELUGU, + HINTING_BOTTOM_TO_TOP, "\xE0\xB1\xA6 \xE0\xB1\xA7" ) /* ౦ ౧ */ SCRIPT( thai, THAI, "Thai", HB_SCRIPT_THAI, + HINTING_BOTTOM_TO_TOP, "\xE0\xB8\xB2 \xE0\xB9\x85 \xE0\xB9\x90" ) /* า ๅ ๐ */ #ifdef AF_CONFIG_OPTION_INDIC - SCRIPT( beng, BENG, - "Bengali", - HB_SCRIPT_BENGALI, - "o" ) /* XXX */ - - SCRIPT( gujr, GUJR, - "Gujarati", - HB_SCRIPT_GUJARATI, - "o" ) /* XXX */ - - SCRIPT( guru, GURU, - "Gurmukhi", - HB_SCRIPT_GURMUKHI, - "o" ) /* XXX */ - - SCRIPT( knda, KNDA, - "Kannada", - HB_SCRIPT_KANNADA, - "o" ) /* XXX */ - SCRIPT( limb, LIMB, "Limbu", HB_SCRIPT_LIMBU, - "o" ) /* XXX */ - - SCRIPT( mlym, MLYM, - "Malayalam", - HB_SCRIPT_MALAYALAM, + HINTING_BOTTOM_TO_TOP, "o" ) /* XXX */ SCRIPT( orya, ORYA, "Oriya", HB_SCRIPT_ORIYA, - "o" ) /* XXX */ - - SCRIPT( sinh, SINH, - "Sinhala", - HB_SCRIPT_SINHALA, + HINTING_BOTTOM_TO_TOP, "o" ) /* XXX */ SCRIPT( sund, SUND, "Sundanese", HB_SCRIPT_SUNDANESE, + HINTING_BOTTOM_TO_TOP, "o" ) /* XXX */ SCRIPT( sylo, SYLO, "Syloti Nagri", HB_SCRIPT_SYLOTI_NAGRI, - "o" ) /* XXX */ - - SCRIPT( taml, TAML, - "Tamil", - HB_SCRIPT_TAMIL, + HINTING_BOTTOM_TO_TOP, "o" ) /* XXX */ SCRIPT( tibt, TIBT, "Tibetan", HB_SCRIPT_TIBETAN, + HINTING_BOTTOM_TO_TOP, "o" ) /* XXX */ #endif /* AF_CONFIG_OPTION_INDIC */ @@ -177,6 +236,7 @@ SCRIPT( hani, HANI, "CJKV ideographs", HB_SCRIPT_HAN, + HINTING_BOTTOM_TO_TOP, "\xE7\x94\xB0 \xE5\x9B\x97" ) /* 田 囗 */ #endif /* AF_CONFIG_OPTION_CJK */ diff --git a/src/autofit/afshaper.c b/src/autofit/afshaper.c index 6ba9190..6d13b65 100644 --- a/src/autofit/afshaper.c +++ b/src/autofit/afshaper.c @@ -4,7 +4,7 @@ /* */ /* HarfBuzz interface for accessing OpenType features (body). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -86,7 +86,7 @@ /* load HarfBuzz script tags */ #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) h, +#define SCRIPT( s, S, d, h, H, ss ) h, static const hb_script_t scripts[] = @@ -98,7 +98,8 @@ FT_Error af_shaper_get_coverage( AF_FaceGlobals globals, AF_StyleClass style_class, - FT_UShort* gstyles ) + FT_UShort* gstyles, + FT_Bool default_script ) { hb_face_t* face; @@ -143,8 +144,7 @@ /* `hb_ot_tags_from_script' usually returns HB_OT_TAG_DEFAULT_SCRIPT */ /* as the second tag. We change that to HB_TAG_NONE except for the */ /* default script. */ - if ( style_class->script == globals->module->default_script && - style_class->coverage == AF_COVERAGE_DEFAULT ) + if ( default_script ) { if ( script_tags[0] == HB_TAG_NONE ) script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT; @@ -158,6 +158,11 @@ } else { + /* we use non-standard tags like `khms' for special purposes; */ + /* HarfBuzz maps them to `DFLT', which we don't want to handle here */ + if ( script_tags[0] == HB_OT_TAG_DEFAULT_SCRIPT ) + goto Exit; + if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT ) script_tags[1] = HB_TAG_NONE; } @@ -571,11 +576,13 @@ FT_Error af_shaper_get_coverage( AF_FaceGlobals globals, AF_StyleClass style_class, - FT_UShort* gstyles ) + FT_UShort* gstyles, + FT_Bool default_script ) { FT_UNUSED( globals ); FT_UNUSED( style_class ); FT_UNUSED( gstyles ); + FT_UNUSED( default_script ); return FT_Err_Ok; } diff --git a/src/autofit/afshaper.h b/src/autofit/afshaper.h index db1b4e0..0d41f78 100644 --- a/src/autofit/afshaper.h +++ b/src/autofit/afshaper.h @@ -4,7 +4,7 @@ /* */ /* HarfBuzz interface for accessing OpenType features (specification). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFSHAPER_H__ -#define __AFSHAPER_H__ +#ifndef AFSHAPER_H_ +#define AFSHAPER_H_ #include <ft2build.h> @@ -38,7 +38,8 @@ FT_BEGIN_HEADER FT_Error af_shaper_get_coverage( AF_FaceGlobals globals, AF_StyleClass style_class, - FT_UShort* gstyles ); + FT_UShort* gstyles, + FT_Bool default_script ); void* @@ -65,7 +66,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFSHAPER_H__ */ +#endif /* AFSHAPER_H_ */ /* END */ diff --git a/src/autofit/afstyles.h b/src/autofit/afstyles.h index e214442..e83a95b 100644 --- a/src/autofit/afstyles.h +++ b/src/autofit/afstyles.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter styles (specification only). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -52,10 +52,10 @@ #undef META_STYLE_LATIN #define META_STYLE_LATIN( s, S, ds ) \ STYLE_LATIN( s, S, c2cp, C2CP, ds, \ - "petite capticals from capitals", \ + "petite capitals from capitals", \ PETITE_CAPITALS_FROM_CAPITALS ) \ STYLE_LATIN( s, S, c2sc, C2SC, ds, \ - "small capticals from capitals", \ + "small capitals from capitals", \ SMALL_CAPITALS_FROM_CAPITALS ) \ STYLE_LATIN( s, S, ordn, ORDN, ds, \ "ordinals", \ @@ -90,6 +90,27 @@ AF_BLUE_STRINGSET_ARAB, AF_COVERAGE_DEFAULT ) + STYLE( armn_dflt, ARMN_DFLT, + "Armenian default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_ARMN, + AF_BLUE_STRINGSET_ARMN, + AF_COVERAGE_DEFAULT ) + + STYLE( beng_dflt, BENG_DFLT, + "Bengali default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_BENG, + AF_BLUE_STRINGSET_BENG, + AF_COVERAGE_DEFAULT ) + + STYLE( cher_dflt, CHER_DFLT, + "Cherokee default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_CHER, + AF_BLUE_STRINGSET_CHER, + AF_COVERAGE_DEFAULT ) + META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" ) STYLE( deva_dflt, DEVA_DFLT, @@ -99,8 +120,43 @@ AF_BLUE_STRINGSET_DEVA, AF_COVERAGE_DEFAULT ) + STYLE( ethi_dflt, ETHI_DFLT, + "Ethiopic default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_ETHI, + AF_BLUE_STRINGSET_ETHI, + AF_COVERAGE_DEFAULT ) + + STYLE( geor_dflt, GEOR_DFLT, + "Georgian (Mkhedruli) default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_GEOR, + AF_BLUE_STRINGSET_GEOR, + AF_COVERAGE_DEFAULT ) + + STYLE( geok_dflt, GEOK_DFLT, + "Georgian (Khutsuri) default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_GEOK, + AF_BLUE_STRINGSET_GEOK, + AF_COVERAGE_DEFAULT ) + META_STYLE_LATIN( grek, GREK, "Greek" ) + STYLE( gujr_dflt, GUJR_DFLT, + "Gujarati default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_GUJR, + AF_BLUE_STRINGSET_GUJR, + AF_COVERAGE_DEFAULT ) + + STYLE( guru_dflt, GURU_DFLT, + "Gurmukhi default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_GURU, + AF_BLUE_STRINGSET_GURU, + AF_COVERAGE_DEFAULT ) + STYLE( hebr_dflt, HEBR_DFLT, "Hebrew default style", AF_WRITING_SYSTEM_LATIN, @@ -108,6 +164,13 @@ AF_BLUE_STRINGSET_HEBR, AF_COVERAGE_DEFAULT ) + STYLE( knda_dflt, KNDA_DFLT, + "Kannada default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_KNDA, + AF_BLUE_STRINGSET_KNDA, + AF_COVERAGE_DEFAULT ) + STYLE( khmr_dflt, KHMR_DFLT, "Khmer default style", AF_WRITING_SYSTEM_LATIN, @@ -154,6 +217,13 @@ AF_COVERAGE_DEFAULT ) #endif + STYLE( mlym_dflt, MLYM_DFLT, + "Malayalam default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_MLYM, + AF_BLUE_STRINGSET_MLYM, + AF_COVERAGE_DEFAULT ) + STYLE( mymr_dflt, MYMR_DFLT, "Myanmar default style", AF_WRITING_SYSTEM_LATIN, @@ -165,7 +235,21 @@ "no style", AF_WRITING_SYSTEM_DUMMY, AF_SCRIPT_NONE, - (AF_Blue_Stringset)0, + AF_BLUE_STRINGSET_NONE, + AF_COVERAGE_DEFAULT ) + + STYLE( sinh_dflt, SINH_DFLT, + "Sinhala default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_SINH, + AF_BLUE_STRINGSET_SINH, + AF_COVERAGE_DEFAULT ) + + STYLE( taml_dflt, TAML_DFLT, + "Tamil default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_TAML, + AF_BLUE_STRINGSET_TAML, AF_COVERAGE_DEFAULT ) STYLE( telu_dflt, TELU_DFLT, @@ -194,17 +278,10 @@ (AF_Blue_Stringset)0, \ AF_COVERAGE_DEFAULT ) - STYLE_DEFAULT_INDIC( beng, BENG, "Bengali" ) - STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" ) - STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" ) - STYLE_DEFAULT_INDIC( knda, KNDA, "Kannada" ) STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" ) - STYLE_DEFAULT_INDIC( mlym, MLYM, "Malayalam" ) STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" ) - STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" ) STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" ) STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" ) - STYLE_DEFAULT_INDIC( taml, TAML, "Tamil" ) STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" ) #endif /* AF_CONFIG_OPTION_INDIC */ diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h index b483619..ef62043 100644 --- a/src/autofit/aftypes.h +++ b/src/autofit/aftypes.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter types (specification only). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,15 +22,15 @@ * Its main feature is the ability to differentiate between different * writing systems and scripts in order to apply specific rules. * - * The code has also been compartmentized into several entities that + * The code has also been compartmentalized into several entities that * should make algorithmic experimentation easier than with the old * code. * *************************************************************************/ -#ifndef __AFTYPES_H__ -#define __AFTYPES_H__ +#ifndef AFTYPES_H_ +#define AFTYPES_H_ #include <ft2build.h> @@ -255,7 +255,7 @@ extern void* _af_debug_hints; * outline according to the results of the glyph analyzer. */ -#define __AFWRTSYS_H__ /* don't load header files */ +#define AFWRTSYS_H_ /* don't load header files */ #undef WRITING_SYSTEM #define WRITING_SYSTEM( ws, WS ) \ AF_WRITING_SYSTEM_ ## WS, @@ -270,7 +270,7 @@ extern void* _af_debug_hints; } AF_WritingSystem; -#undef __AFWRTSYS_H__ +#undef AFWRTSYS_H_ typedef struct AF_WritingSystemClassRec_ @@ -309,7 +309,7 @@ extern void* _af_debug_hints; */ #undef SCRIPT -#define SCRIPT( s, S, d, h, ss ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ AF_SCRIPT_ ## S, /* The list of known scripts. */ @@ -343,6 +343,8 @@ extern void* _af_debug_hints; AF_Script_UniRange script_uni_ranges; AF_Script_UniRange script_uni_nonbase_ranges; + FT_Bool top_to_bottom_hinting; + const char* standard_charstring; /* for default width and height */ } AF_ScriptClassRec; @@ -479,6 +481,10 @@ extern void* _af_debug_hints; } AF_StyleMetricsRec; +#define AF_HINTING_BOTTOM_TO_TOP 0 +#define AF_HINTING_TOP_TO_BOTTOM 1 + + /* Declare and define vtables for classes */ #ifndef FT_CONFIG_OPTION_PIC @@ -522,6 +528,7 @@ extern void* _af_debug_hints; script, \ ranges, \ nonbase_ranges, \ + top_to_bottom, \ std_charstring ) \ FT_CALLBACK_TABLE_DEF \ const AF_ScriptClassRec script_class = \ @@ -529,6 +536,7 @@ extern void* _af_debug_hints; script, \ ranges, \ nonbase_ranges, \ + top_to_bottom, \ std_charstring, \ }; @@ -595,6 +603,7 @@ extern void* _af_debug_hints; script_, \ ranges, \ nonbase_ranges, \ + top_to_bottom, \ std_charstring ) \ FT_LOCAL_DEF( void ) \ FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \ @@ -602,6 +611,7 @@ extern void* _af_debug_hints; ac->script = script_; \ ac->script_uni_ranges = ranges; \ ac->script_uni_nonbase_ranges = nonbase_ranges; \ + ac->top_to_bottom_hinting = top_to_bottom; \ ac->standard_charstring = std_charstring; \ } @@ -634,7 +644,7 @@ extern void* _af_debug_hints; FT_END_HEADER -#endif /* __AFTYPES_H__ */ +#endif /* AFTYPES_H_ */ /* END */ diff --git a/src/autofit/afwarp.c b/src/autofit/afwarp.c index ae92db1..ce1806c 100644 --- a/src/autofit/afwarp.c +++ b/src/autofit/afwarp.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter warping algorithm (body). */ /* */ -/* Copyright 2006-2015 by */ +/* Copyright 2006-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/afwarp.h b/src/autofit/afwarp.h index 6069b6b..6d96f86 100644 --- a/src/autofit/afwarp.h +++ b/src/autofit/afwarp.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter warping algorithm (specification). */ /* */ -/* Copyright 2006-2015 by */ +/* Copyright 2006-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFWARP_H__ -#define __AFWARP_H__ +#ifndef AFWARP_H_ +#define AFWARP_H_ #include "afhints.h" @@ -58,7 +58,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFWARP_H__ */ +#endif /* AFWARP_H_ */ /* END */ diff --git a/src/autofit/afwrtsys.h b/src/autofit/afwrtsys.h index 4aa89d2..842f492 100644 --- a/src/autofit/afwrtsys.h +++ b/src/autofit/afwrtsys.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter writing systems (specification only). */ /* */ -/* Copyright 2013-2015 by */ +/* Copyright 2013-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __AFWRTSYS_H__ -#define __AFWRTSYS_H__ +#ifndef AFWRTSYS_H_ +#define AFWRTSYS_H_ /* Since preprocessor directives can't create other preprocessor */ /* directives, we have to include the header files manually. */ @@ -30,7 +30,7 @@ #include "aflatin2.h" #endif -#endif /* __AFWRTSYS_H__ */ +#endif /* AFWRTSYS_H_ */ /* The following part can be included multiple times. */ diff --git a/src/autofit/autofit.c b/src/autofit/autofit.c index a971a24..dda9aeb 100644 --- a/src/autofit/autofit.c +++ b/src/autofit/autofit.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2016 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/autofit/hbshim.c b/src/autofit/hbshim.c deleted file mode 100644 index c9c1db0..0000000 --- a/src/autofit/hbshim.c +++ /dev/null @@ -1,546 +0,0 @@ -/***************************************************************************/ -/* */ -/* hbshim.c */ -/* */ -/* HarfBuzz interface for accessing OpenType features (body). */ -/* */ -/* Copyright 2013-2015 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include <ft2build.h> -#include FT_FREETYPE_H -#include "afglobal.h" -#include "aftypes.h" -#include "hbshim.h" - -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_afharfbuzz - - - /* - * We use `sets' (in the HarfBuzz sense, which comes quite near to the - * usual mathematical meaning) to manage both lookups and glyph indices. - * - * 1. For each coverage, collect lookup IDs in a set. Note that an - * auto-hinter `coverage' is represented by one `feature', and a - * feature consists of an arbitrary number of (font specific) `lookup's - * that actually do the mapping job. Please check the OpenType - * specification for more details on features and lookups. - * - * 2. Create glyph ID sets from the corresponding lookup sets. - * - * 3. The glyph set corresponding to AF_COVERAGE_DEFAULT is computed - * with all lookups specific to the OpenType script activated. It - * relies on the order of AF_DEFINE_STYLE_CLASS entries so that - * special coverages (like `oldstyle figures') don't get overwritten. - * - */ - - - /* load coverage tags */ -#undef COVERAGE -#define COVERAGE( name, NAME, description, \ - tag1, tag2, tag3, tag4 ) \ - static const hb_tag_t name ## _coverage[] = \ - { \ - HB_TAG( tag1, tag2, tag3, tag4 ), \ - HB_TAG_NONE \ - }; - - -#include "afcover.h" - - - /* define mapping between coverage tags and AF_Coverage */ -#undef COVERAGE -#define COVERAGE( name, NAME, description, \ - tag1, tag2, tag3, tag4 ) \ - name ## _coverage, - - - static const hb_tag_t* coverages[] = - { -#include "afcover.h" - - NULL /* AF_COVERAGE_DEFAULT */ - }; - - - /* load HarfBuzz script tags */ -#undef SCRIPT -#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) h, - - - static const hb_script_t scripts[] = - { -#include "afscript.h" - }; - - - FT_Error - af_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_Byte* gstyles ) - { - hb_face_t* face; - - hb_set_t* gsub_lookups; /* GSUB lookups for a given script */ - hb_set_t* gsub_glyphs; /* glyphs covered by GSUB lookups */ - hb_set_t* gpos_lookups; /* GPOS lookups for a given script */ - hb_set_t* gpos_glyphs; /* glyphs covered by GPOS lookups */ - - hb_script_t script; - const hb_tag_t* coverage_tags; - hb_tag_t script_tags[] = { HB_TAG_NONE, - HB_TAG_NONE, - HB_TAG_NONE, - HB_TAG_NONE }; - - hb_codepoint_t idx; -#ifdef FT_DEBUG_LEVEL_TRACE - int count; -#endif - - - if ( !globals || !style_class || !gstyles ) - return FT_THROW( Invalid_Argument ); - - face = hb_font_get_face( globals->hb_font ); - - gsub_lookups = hb_set_create(); - gsub_glyphs = hb_set_create(); - gpos_lookups = hb_set_create(); - gpos_glyphs = hb_set_create(); - - coverage_tags = coverages[style_class->coverage]; - script = scripts[style_class->script]; - - /* Convert a HarfBuzz script tag into the corresponding OpenType */ - /* tag or tags -- some Indic scripts like Devanagari have an old */ - /* and a new set of features. */ - hb_ot_tags_from_script( script, - &script_tags[0], - &script_tags[1] ); - - /* `hb_ot_tags_from_script' usually returns HB_OT_TAG_DEFAULT_SCRIPT */ - /* as the second tag. We change that to HB_TAG_NONE except for the */ - /* default script. */ - if ( style_class->script == globals->module->default_script && - style_class->coverage == AF_COVERAGE_DEFAULT ) - { - if ( script_tags[0] == HB_TAG_NONE ) - script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT; - else - { - if ( script_tags[1] == HB_TAG_NONE ) - script_tags[1] = HB_OT_TAG_DEFAULT_SCRIPT; - else if ( script_tags[1] != HB_OT_TAG_DEFAULT_SCRIPT ) - script_tags[2] = HB_OT_TAG_DEFAULT_SCRIPT; - } - } - else - { - if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT ) - script_tags[1] = HB_TAG_NONE; - } - - hb_ot_layout_collect_lookups( face, - HB_OT_TAG_GSUB, - script_tags, - NULL, - coverage_tags, - gsub_lookups ); - - if ( hb_set_is_empty( gsub_lookups ) ) - goto Exit; /* nothing to do */ - - hb_ot_layout_collect_lookups( face, - HB_OT_TAG_GPOS, - script_tags, - NULL, - coverage_tags, - gpos_lookups ); - - FT_TRACE4(( "GSUB lookups (style `%s'):\n" - " ", - af_style_names[style_class->style] )); - -#ifdef FT_DEBUG_LEVEL_TRACE - count = 0; -#endif - - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, &idx ); ) - { -#ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE4(( " %d", idx )); - count++; -#endif - - /* get output coverage of GSUB feature */ - hb_ot_layout_lookup_collect_glyphs( face, - HB_OT_TAG_GSUB, - idx, - NULL, - NULL, - NULL, - gsub_glyphs ); - } - -#ifdef FT_DEBUG_LEVEL_TRACE - if ( !count ) - FT_TRACE4(( " (none)" )); - FT_TRACE4(( "\n\n" )); -#endif - - FT_TRACE4(( "GPOS lookups (style `%s'):\n" - " ", - af_style_names[style_class->style] )); - -#ifdef FT_DEBUG_LEVEL_TRACE - count = 0; -#endif - - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gpos_lookups, &idx ); ) - { -#ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE4(( " %d", idx )); - count++; -#endif - - /* get input coverage of GPOS feature */ - hb_ot_layout_lookup_collect_glyphs( face, - HB_OT_TAG_GPOS, - idx, - NULL, - gpos_glyphs, - NULL, - NULL ); - } - -#ifdef FT_DEBUG_LEVEL_TRACE - if ( !count ) - FT_TRACE4(( " (none)" )); - FT_TRACE4(( "\n\n" )); -#endif - - /* - * We now check whether we can construct blue zones, using glyphs - * covered by the feature only. In case there is not a single zone - * (this is, not a single character is covered), we skip this coverage. - * - */ - if ( style_class->coverage != AF_COVERAGE_DEFAULT ) - { - AF_Blue_Stringset bss = style_class->blue_stringset; - const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; - - FT_Bool found = 0; - - - for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) - { - const char* p = &af_blue_strings[bs->string]; - - - while ( *p ) - { - hb_codepoint_t ch; - - - GET_UTF8_CHAR( ch, p ); - - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, - &idx ); ) - { - hb_codepoint_t gidx = FT_Get_Char_Index( globals->face, ch ); - - - if ( hb_ot_layout_lookup_would_substitute( face, idx, - &gidx, 1, 1 ) ) - { - found = 1; - break; - } - } - } - } - - if ( !found ) - { - FT_TRACE4(( " no blue characters found; style skipped\n" )); - goto Exit; - } - } - - /* - * Various OpenType features might use the same glyphs at different - * vertical positions; for example, superscript and subscript glyphs - * could be the same. However, the auto-hinter is completely - * agnostic of OpenType features after the feature analysis has been - * completed: The engine then simply receives a glyph index and returns a - * hinted and usually rendered glyph. - * - * Consider the superscript feature of font `pala.ttf': Some of the - * glyphs are `real', this is, they have a zero vertical offset, but - * most of them are small caps glyphs shifted up to the superscript - * position (this is, the `sups' feature is present in both the GSUB and - * GPOS tables). The code for blue zones computation actually uses a - * feature's y offset so that the `real' glyphs get correct hints. But - * later on it is impossible to decide whether a glyph index belongs to, - * say, the small caps or superscript feature. - * - * For this reason, we don't assign a style to a glyph if the current - * feature covers the glyph in both the GSUB and the GPOS tables. This - * is quite a broad condition, assuming that - * - * (a) glyphs that get used in multiple features are present in a - * feature without vertical shift, - * - * and - * - * (b) a feature's GPOS data really moves the glyph vertically. - * - * Not fulfilling condition (a) makes a font larger; it would also - * reduce the number of glyphs that could be addressed directly without - * using OpenType features, so this assumption is rather strong. - * - * Condition (b) is much weaker, and there might be glyphs which get - * missed. However, the OpenType features we are going to handle are - * primarily located in GSUB, and HarfBuzz doesn't provide an API to - * directly get the necessary information from the GPOS table. A - * possible solution might be to directly parse the GPOS table to find - * out whether a glyph gets shifted vertically, but this is something I - * would like to avoid if not really necessary. - * - * Note that we don't follow this logic for the default coverage. - * Complex scripts like Devanagari have mandatory GPOS features to - * position many glyph elements, using mark-to-base or mark-to-ligature - * tables; the number of glyphs missed due to condition (b) would be far - * too large. - * - */ - if ( style_class->coverage != AF_COVERAGE_DEFAULT ) - hb_set_subtract( gsub_glyphs, gpos_glyphs ); - -#ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE4(( " glyphs without GPOS data (`*' means already assigned)" )); - count = 0; -#endif - - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_glyphs, &idx ); ) - { -#ifdef FT_DEBUG_LEVEL_TRACE - if ( !( count % 10 ) ) - FT_TRACE4(( "\n" - " " )); - - FT_TRACE4(( " %d", idx )); - count++; -#endif - - /* glyph indices returned by `hb_ot_layout_lookup_collect_glyphs' */ - /* can be arbitrary: some fonts use fake indices for processing */ - /* internal to GSUB or GPOS, which is fully valid */ - if ( idx >= (hb_codepoint_t)globals->glyph_count ) - continue; - - if ( gstyles[idx] == AF_STYLE_UNASSIGNED ) - gstyles[idx] = (FT_Byte)style_class->style; -#ifdef FT_DEBUG_LEVEL_TRACE - else - FT_TRACE4(( "*" )); -#endif - } - -#ifdef FT_DEBUG_LEVEL_TRACE - if ( !count ) - FT_TRACE4(( "\n" - " (none)" )); - FT_TRACE4(( "\n\n" )); -#endif - - Exit: - hb_set_destroy( gsub_lookups ); - hb_set_destroy( gsub_glyphs ); - hb_set_destroy( gpos_lookups ); - hb_set_destroy( gpos_glyphs ); - - return FT_Err_Ok; - } - - - /* construct HarfBuzz features */ -#undef COVERAGE -#define COVERAGE( name, NAME, description, \ - tag1, tag2, tag3, tag4 ) \ - static const hb_feature_t name ## _feature[] = \ - { \ - { \ - HB_TAG( tag1, tag2, tag3, tag4 ), \ - 1, 0, (unsigned int)-1 \ - } \ - }; - - -#include "afcover.h" - - - /* define mapping between HarfBuzz features and AF_Coverage */ -#undef COVERAGE -#define COVERAGE( name, NAME, description, \ - tag1, tag2, tag3, tag4 ) \ - name ## _feature, - - - static const hb_feature_t* features[] = - { -#include "afcover.h" - - NULL /* AF_COVERAGE_DEFAULT */ - }; - - - FT_Error - af_get_char_index( AF_StyleMetrics metrics, - FT_ULong charcode, - FT_ULong *codepoint, - FT_Long *y_offset ) - { - AF_StyleClass style_class; - - const hb_feature_t* feature; - - FT_ULong in_idx, out_idx; - - - if ( !metrics ) - return FT_THROW( Invalid_Argument ); - - in_idx = FT_Get_Char_Index( metrics->globals->face, charcode ); - - style_class = metrics->style_class; - - feature = features[style_class->coverage]; - - if ( feature ) - { - FT_Int upem = (FT_Int)metrics->globals->face->units_per_EM; - - hb_font_t* font = metrics->globals->hb_font; - hb_buffer_t* buf = hb_buffer_create(); - - uint32_t c = (uint32_t)charcode; - - hb_glyph_info_t* ginfo; - hb_glyph_position_t* gpos; - unsigned int gcount; - - - /* we shape at a size of units per EM; this means font units */ - hb_font_set_scale( font, upem, upem ); - - /* XXX: is this sufficient for a single character of any script? */ - hb_buffer_set_direction( buf, HB_DIRECTION_LTR ); - hb_buffer_set_script( buf, scripts[style_class->script] ); - - /* we add one character to `buf' ... */ - hb_buffer_add_utf32( buf, &c, 1, 0, 1 ); - - /* ... and apply one feature */ - hb_shape( font, buf, feature, 1 ); - - ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); - gpos = hb_buffer_get_glyph_positions( buf, &gcount ); - - out_idx = ginfo[0].codepoint; - - /* getting the same index indicates no substitution, */ - /* which means that the glyph isn't available in the feature */ - if ( in_idx == out_idx ) - { - *codepoint = 0; - *y_offset = 0; - } - else - { - *codepoint = out_idx; - *y_offset = gpos[0].y_offset; - } - - hb_buffer_destroy( buf ); - -#ifdef FT_DEBUG_LEVEL_TRACE - if ( gcount > 1 ) - FT_TRACE1(( "af_get_char_index:" - " input character mapped to multiple glyphs\n" )); -#endif - } - else - { - *codepoint = in_idx; - *y_offset = 0; - } - - return FT_Err_Ok; - } - - -#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ - - - FT_Error - af_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_Byte* gstyles ) - { - FT_UNUSED( globals ); - FT_UNUSED( style_class ); - FT_UNUSED( gstyles ); - - return FT_Err_Ok; - } - - - FT_Error - af_get_char_index( AF_StyleMetrics metrics, - FT_ULong charcode, - FT_ULong *codepoint, - FT_Long *y_offset ) - { - FT_Face face; - - - if ( !metrics ) - return FT_THROW( Invalid_Argument ); - - face = metrics->globals->face; - - *codepoint = FT_Get_Char_Index( face, charcode ); - *y_offset = 0; - - return FT_Err_Ok; - } - - -#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ - - -/* END */ diff --git a/src/autofit/hbshim.h b/src/autofit/hbshim.h deleted file mode 100644 index 5636ca6..0000000 --- a/src/autofit/hbshim.h +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************/ -/* */ -/* hbshim.h */ -/* */ -/* HarfBuzz interface for accessing OpenType features (specification). */ -/* */ -/* Copyright 2013-2015 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __HBSHIM_H__ -#define __HBSHIM_H__ - - -#include <ft2build.h> -#include FT_FREETYPE_H - - -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - -#include <hb.h> -#include <hb-ot.h> -#include <hb-ft.h> - -#endif - - -FT_BEGIN_HEADER - - FT_Error - af_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_Byte* gstyles ); - - FT_Error - af_get_char_index( AF_StyleMetrics metrics, - FT_ULong charcode, - FT_ULong *codepoint, - FT_Long *y_offset ); - - /* */ - -FT_END_HEADER - -#endif /* __HBSHIM_H__ */ - - -/* END */ |