diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/autofit')
42 files changed, 1745 insertions, 1009 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile b/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile index 5cd0b46108b..638b2297249 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 src/autofit Jamfile # -# 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, modified, @@ -33,8 +33,8 @@ SubDir FT2_TOP src autofit ; afmodule afpic afranges + afshaper afwarp - hbshim ; if $(FT2_AUTOFIT2) diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c index 1b1eb31fe7b..b856e57a8bb 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afangles.c +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c index b871e0c651e..7d9646c3af3 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -26,139 +26,171 @@ af_blue_strings[] = { /* */ - '\xD8', '\xA7', '\xD8', '\xA5', '\xD9', '\x84', '\xD9', '\x83', '\xD8', '\xB7', '\xD8', '\xB8', /* ا إ ل ك ط ظ */ + '\xD8', '\xA7', ' ', '\xD8', '\xA5', ' ', '\xD9', '\x84', ' ', '\xD9', '\x83', ' ', '\xD8', '\xB7', ' ', '\xD8', '\xB8', /* ا إ ل ك ط ظ */ '\0', - '\xD8', '\xAA', '\xD8', '\xAB', '\xD8', '\xB7', '\xD8', '\xB8', '\xD9', '\x83', /* ت ث ط ظ ك */ + '\xD8', '\xAA', ' ', '\xD8', '\xAB', ' ', '\xD8', '\xB7', ' ', '\xD8', '\xB8', ' ', '\xD9', '\x83', /* ت ث ط ظ ك */ '\0', '\xD9', '\x80', /* ـ */ '\0', - '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */ + '\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', - '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */ + '\xE0', '\xA6', '\x87', ' ', '\xE0', '\xA6', '\x9F', ' ', '\xE0', '\xA6', '\xA0', ' ', '\xE0', '\xA6', '\xBF', ' ', '\xE0', '\xA7', '\x80', ' ', '\xE0', '\xA7', '\x88', ' ', '\xE0', '\xA7', '\x97', /* ই ট ঠ ি ী ৈ ৗ */ '\0', - '\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81', /* хпншезос */ + '\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', - '\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84', /* руф */ + '\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\x9F', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е П З О С Э */ '\0', - '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ + '\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\xA8', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е Ш З О С Э */ '\0', - '\xE0', '\xA4', '\x88', '\xE0', '\xA4', '\x90', '\xE0', '\xA4', '\x93', '\xE0', '\xA4', '\x94', '\xE0', '\xA4', '\xBF', '\xE0', '\xA5', '\x80', '\xE0', '\xA5', '\x8B', '\xE0', '\xA5', '\x8C', /* ई ऐ ओ औ ि ी ो ौ */ + '\xD1', '\x85', ' ', '\xD0', '\xBF', ' ', '\xD0', '\xBD', ' ', '\xD1', '\x88', ' ', '\xD0', '\xB5', ' ', '\xD0', '\xB7', ' ', '\xD0', '\xBE', ' ', '\xD1', '\x81', /* х п н ш е з о с */ '\0', - '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ + '\xD1', '\x80', ' ', '\xD1', '\x83', ' ', '\xD1', '\x84', /* р у ф */ '\0', - '\xE0', '\xA5', '\x81', '\xE0', '\xA5', '\x83', /* ु ृ */ + '\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ '\0', - '\xCE', '\x93', '\xCE', '\x92', '\xCE', '\x95', '\xCE', '\x96', '\xCE', '\x98', '\xCE', '\x9F', '\xCE', '\xA9', /* ΓΒΕΖΘΟΩ */ + '\xE0', '\xA4', '\x88', ' ', '\xE0', '\xA4', '\x90', ' ', '\xE0', '\xA4', '\x93', ' ', '\xE0', '\xA4', '\x94', ' ', '\xE0', '\xA4', '\xBF', ' ', '\xE0', '\xA5', '\x80', ' ', '\xE0', '\xA5', '\x8B', ' ', '\xE0', '\xA5', '\x8C', /* ई ऐ ओ औ ि ी ो ौ */ '\0', - '\xCE', '\x92', '\xCE', '\x94', '\xCE', '\x96', '\xCE', '\x9E', '\xCE', '\x98', '\xCE', '\x9F', /* ΒΔΖΞΘΟ */ + '\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ '\0', - '\xCE', '\xB2', '\xCE', '\xB8', '\xCE', '\xB4', '\xCE', '\xB6', '\xCE', '\xBB', '\xCE', '\xBE', /* βθδζλξ */ + '\xE0', '\xA5', '\x81', ' ', '\xE0', '\xA5', '\x83', /* ु ृ */ '\0', - '\xCE', '\xB1', '\xCE', '\xB5', '\xCE', '\xB9', '\xCE', '\xBF', '\xCF', '\x80', '\xCF', '\x83', '\xCF', '\x84', '\xCF', '\x89', /* αειοπστω */ + '\xCE', '\x93', ' ', '\xCE', '\x92', ' ', '\xCE', '\x95', ' ', '\xCE', '\x96', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', ' ', '\xCE', '\xA9', /* Γ Β Ε Ζ Θ Ο Ω */ '\0', - '\xCE', '\xB2', '\xCE', '\xB3', '\xCE', '\xB7', '\xCE', '\xBC', '\xCF', '\x81', '\xCF', '\x86', '\xCF', '\x87', '\xCF', '\x88', /* βγημρφχψ */ + '\xCE', '\x92', ' ', '\xCE', '\x94', ' ', '\xCE', '\x96', ' ', '\xCE', '\x9E', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', /* Β Δ Ζ Ξ Θ Ο */ '\0', - '\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', /* בדהחךכםס */ + '\xCE', '\xB2', ' ', '\xCE', '\xB8', ' ', '\xCE', '\xB4', ' ', '\xCE', '\xB6', ' ', '\xCE', '\xBB', ' ', '\xCE', '\xBE', /* β θ δ ζ λ ξ */ '\0', - '\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6', /* בטכםסצ */ + '\xCE', '\xB1', ' ', '\xCE', '\xB5', ' ', '\xCE', '\xB9', ' ', '\xCE', '\xBF', ' ', '\xCF', '\x80', ' ', '\xCF', '\x83', ' ', '\xCF', '\x84', ' ', '\xCF', '\x89', /* α ε ι ο π σ τ ω */ '\0', - '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5', /* קךןףץ */ + '\xCE', '\xB2', ' ', '\xCE', '\xB3', ' ', '\xCE', '\xB7', ' ', '\xCE', '\xBC', ' ', '\xCF', '\x81', ' ', '\xCF', '\x86', ' ', '\xCF', '\x87', ' ', '\xCF', '\x88', /* β γ η μ ρ φ χ ψ */ '\0', - '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\x94', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\xA1', '\xE0', '\xBA', '\xA5', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\x87', /* າ ດ ອ ມ ລ ວ ຣ ງ */ + '\xD7', '\x91', ' ', '\xD7', '\x93', ' ', '\xD7', '\x94', ' ', '\xD7', '\x97', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', /* ב ד ה ח ך כ ם ס */ '\0', - '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\x9A', '\xE0', '\xBA', '\x8D', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\xAE', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA2', /* າ ອ ບ ຍ ຣ ຮ ວ ຢ */ + '\xD7', '\x91', ' ', '\xD7', '\x98', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', ' ', '\xD7', '\xA6', /* ב ט כ ם ס צ */ '\0', - '\xE0', '\xBA', '\x9B', '\xE0', '\xBA', '\xA2', '\xE0', '\xBA', '\x9F', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ ຝ */ + '\xD7', '\xA7', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9F', ' ', '\xD7', '\xA3', ' ', '\xD7', '\xA5', /* ק ך ן ף ץ */ '\0', - '\xE0', '\xBB', '\x82', '\xE0', '\xBB', '\x84', '\xE0', '\xBB', '\x83', /* ໂ ໄ ໃ */ + '\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', '\xBA', '\x87', '\xE0', '\xBA', '\x8A', '\xE0', '\xBA', '\x96', '\xE0', '\xBA', '\xBD', '\xE0', '\xBB', '\x86', '\xE0', '\xBA', '\xAF', /* ງ ຊ ຖ ຽ ໆ ຯ */ + '\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', - 'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S', /* THEZOCQS */ + '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x91', ' ', '\xE1', '\x9E', '\x93', ' ', '\xE1', '\x9E', '\xA7', ' ', '\xE1', '\x9E', '\xA9', ' ', '\xE1', '\x9E', '\xB6', /* ខ ទ ន ឧ ឩ ា */ '\0', - 'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S', /* HEZLOCUS */ + '\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', /* ក្ក ក្ខ ក្គ ក្ថ */ '\0', - 'f', 'i', 'j', 'k', 'd', 'b', 'h', /* fijkdbh */ + '\xE1', '\x9E', '\x81', ' ', '\xE1', '\x9E', '\x83', ' ', '\xE1', '\x9E', '\x85', ' ', '\xE1', '\x9E', '\x8B', ' ', '\xE1', '\x9E', '\x94', ' ', '\xE1', '\x9E', '\x98', ' ', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\xB2', /* ខ ឃ ច ឋ ប ម យ ឲ */ '\0', - 'x', 'z', 'r', 'o', 'e', 's', 'c', /* xzroesc */ + '\xE1', '\x9E', '\x8F', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', ' ', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\xB2', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\xA2', '\xE1', '\x9E', '\xBF', /* ត្រ រៀ ឲ្យ អឿ */ '\0', - 'p', 'q', 'g', 'j', 'y', /* pqgjy */ + '\xE1', '\x9E', '\x93', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x8F', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x83', ' ', '\xE1', '\x9E', '\x84', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x81', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x99', ' ', '\xE1', '\x9E', '\x80', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x94', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\x85', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x9A', '\xE1', '\x9F', '\x80', ' ', '\xE1', '\x9E', '\x93', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x8F', '\xE1', '\x9E', '\xBF', ' ', '\xE1', '\x9E', '\x9B', '\xE1', '\x9F', '\x92', '\xE1', '\x9E', '\x94', '\xE1', '\x9E', '\xBF', /* ន្ត្រៃ ង្ខ្យ ក្បៀ ច្រៀ ន្តឿ ល្បឿ */ '\0', - '\xE2', '\x82', '\x80', '\xE2', '\x82', '\x83', '\xE2', '\x82', '\x85', '\xE2', '\x82', '\x87', '\xE2', '\x82', '\x88', /* ₀₃₅₇₈ */ + '\xE1', '\xA7', '\xA0', ' ', '\xE1', '\xA7', '\xA1', /* ᧠ ᧡ */ '\0', - '\xE2', '\x82', '\x80', '\xE2', '\x82', '\x81', '\xE2', '\x82', '\x82', '\xE2', '\x82', '\x83', '\xE2', '\x82', '\x88', /* ₀₁₂₃₈ */ + '\xE1', '\xA7', '\xB6', ' ', '\xE1', '\xA7', '\xB9', /* ᧶ ᧹ */ '\0', - '\xE1', '\xB5', '\xA2', '\xE2', '\xB1', '\xBC', '\xE2', '\x82', '\x95', '\xE2', '\x82', '\x96', '\xE2', '\x82', '\x97', /* ᵢⱼₕₖₗ */ + '\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\x94', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\xA1', ' ', '\xE0', '\xBA', '\xA5', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\x87', /* າ ດ ອ ມ ລ ວ ຣ ງ */ '\0', - '\xE2', '\x82', '\x90', '\xE2', '\x82', '\x91', '\xE2', '\x82', '\x92', '\xE2', '\x82', '\x93', '\xE2', '\x82', '\x99', '\xE2', '\x82', '\x9B', '\xE1', '\xB5', '\xA5', '\xE1', '\xB5', '\xA4', '\xE1', '\xB5', '\xA3', /* ₐₑₒₓₙₛᵥᵤᵣ */ + '\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\x9A', ' ', '\xE0', '\xBA', '\x8D', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\xAE', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA2', /* າ ອ ບ ຍ ຣ ຮ ວ ຢ */ '\0', - '\xE1', '\xB5', '\xA6', '\xE1', '\xB5', '\xA7', '\xE1', '\xB5', '\xA8', '\xE1', '\xB5', '\xA9', '\xE2', '\x82', '\x9A', /* ᵦᵧᵨᵩₚ */ + '\xE0', '\xBA', '\x9B', ' ', '\xE0', '\xBA', '\xA2', ' ', '\xE0', '\xBA', '\x9F', ' ', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ ຝ */ '\0', - '\xE2', '\x81', '\xB0', '\xC2', '\xB3', '\xE2', '\x81', '\xB5', '\xE2', '\x81', '\xB7', '\xE1', '\xB5', '\x80', '\xE1', '\xB4', '\xB4', '\xE1', '\xB4', '\xB1', '\xE1', '\xB4', '\xBC', /* ⁰³⁵⁷ᵀᴴᴱᴼ */ + '\xE0', '\xBB', '\x82', ' ', '\xE0', '\xBB', '\x84', ' ', '\xE0', '\xBB', '\x83', /* ໂ ໄ ໃ */ '\0', - '\xE2', '\x81', '\xB0', '\xC2', '\xB9', '\xC2', '\xB2', '\xC2', '\xB3', '\xE1', '\xB4', '\xB1', '\xE1', '\xB4', '\xB8', '\xE1', '\xB4', '\xBC', '\xE1', '\xB5', '\x81', /* ⁰¹²³ᴱᴸᴼᵁ */ + '\xE0', '\xBA', '\x87', ' ', '\xE0', '\xBA', '\x8A', ' ', '\xE0', '\xBA', '\x96', ' ', '\xE0', '\xBA', '\xBD', ' ', '\xE0', '\xBB', '\x86', ' ', '\xE0', '\xBA', '\xAF', /* ງ ຊ ຖ ຽ ໆ ຯ */ '\0', - '\xE1', '\xB5', '\x87', '\xE1', '\xB5', '\x88', '\xE1', '\xB5', '\x8F', '\xCA', '\xB0', '\xCA', '\xB2', '\xE1', '\xB6', '\xA0', '\xE2', '\x81', '\xB1', /* ᵇᵈᵏʰʲᶠⁱ */ + 'T', ' ', 'H', ' ', 'E', ' ', 'Z', ' ', 'O', ' ', 'C', ' ', 'Q', ' ', 'S', /* T H E Z O C Q S */ '\0', - '\xE1', '\xB5', '\x89', '\xE1', '\xB5', '\x92', '\xCA', '\xB3', '\xCB', '\xA2', '\xCB', '\xA3', '\xE1', '\xB6', '\x9C', '\xE1', '\xB6', '\xBB', /* ᵉᵒʳˢˣᶜᶻ */ + 'H', ' ', 'E', ' ', 'Z', ' ', 'L', ' ', 'O', ' ', 'C', ' ', 'U', ' ', 'S', /* H E Z L O C U S */ '\0', - '\xE1', '\xB5', '\x96', '\xCA', '\xB8', '\xE1', '\xB5', '\x8D', /* ᵖʸᵍ */ + 'f', ' ', 'i', ' ', 'j', ' ', 'k', ' ', 'd', ' ', 'b', ' ', 'h', /* f i j k d b h */ '\0', - '\xE0', '\xB0', '\x87', '\xE0', '\xB0', '\x8C', '\xE0', '\xB0', '\x99', '\xE0', '\xB0', '\x9E', '\xE0', '\xB0', '\xA3', '\xE0', '\xB0', '\xB1', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */ + 'x', ' ', 'z', ' ', 'r', ' ', 'o', ' ', 'e', ' ', 's', ' ', 'c', /* x z r o e s c */ '\0', - '\xE0', '\xB0', '\x85', '\xE0', '\xB0', '\x95', '\xE0', '\xB0', '\x9A', '\xE0', '\xB0', '\xB0', '\xE0', '\xB0', '\xBD', '\xE0', '\xB1', '\xA8', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */ + 'p', ' ', 'q', ' ', 'g', ' ', 'j', ' ', 'y', /* p q g j y */ '\0', - '\xE0', '\xB8', '\x9A', '\xE0', '\xB9', '\x80', '\xE0', '\xB9', '\x81', '\xE0', '\xB8', '\xAD', '\xE0', '\xB8', '\x81', '\xE0', '\xB8', '\xB2', /* บ เ แ อ ก า */ + '\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x85', ' ', '\xE2', '\x82', '\x87', ' ', '\xE2', '\x82', '\x88', /* ₀ ₃ ₅ ₇ ₈ */ '\0', - '\xE0', '\xB8', '\x9A', '\xE0', '\xB8', '\x9B', '\xE0', '\xB8', '\xA9', '\xE0', '\xB8', '\xAF', '\xE0', '\xB8', '\xAD', '\xE0', '\xB8', '\xA2', '\xE0', '\xB8', '\xAE', /* บ ป ษ ฯ อ ย ฮ */ + '\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x81', ' ', '\xE2', '\x82', '\x82', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x88', /* ₀ ₁ ₂ ₃ ₈ */ '\0', - '\xE0', '\xB8', '\x9B', '\xE0', '\xB8', '\x9D', '\xE0', '\xB8', '\x9F', /* ป ฝ ฟ */ + '\xE1', '\xB5', '\xA2', ' ', '\xE2', '\xB1', '\xBC', ' ', '\xE2', '\x82', '\x95', ' ', '\xE2', '\x82', '\x96', ' ', '\xE2', '\x82', '\x97', /* ᵢ ⱼ ₕ ₖ ₗ */ '\0', - '\xE0', '\xB9', '\x82', '\xE0', '\xB9', '\x83', '\xE0', '\xB9', '\x84', /* โ ใ ไ */ + '\xE2', '\x82', '\x90', ' ', '\xE2', '\x82', '\x91', ' ', '\xE2', '\x82', '\x92', ' ', '\xE2', '\x82', '\x93', ' ', '\xE2', '\x82', '\x99', ' ', '\xE2', '\x82', '\x9B', ' ', '\xE1', '\xB5', '\xA5', ' ', '\xE1', '\xB5', '\xA4', ' ', '\xE1', '\xB5', '\xA3', /* ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ */ '\0', - '\xE0', '\xB8', '\x8E', '\xE0', '\xB8', '\x8F', '\xE0', '\xB8', '\xA4', '\xE0', '\xB8', '\xA6', /* ฎ ฏ ฤ ฦ */ + '\xE1', '\xB5', '\xA6', ' ', '\xE1', '\xB5', '\xA7', ' ', '\xE1', '\xB5', '\xA8', ' ', '\xE1', '\xB5', '\xA9', ' ', '\xE2', '\x82', '\x9A', /* ᵦ ᵧ ᵨ ᵩ ₚ */ '\0', - '\xE0', '\xB8', '\x8D', '\xE0', '\xB8', '\x90', /* ญ ฐ */ + '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB3', ' ', '\xE2', '\x81', '\xB5', ' ', '\xE2', '\x81', '\xB7', ' ', '\xE1', '\xB5', '\x80', ' ', '\xE1', '\xB4', '\xB4', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xBC', /* ⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ */ '\0', - '\xE0', '\xB9', '\x90', '\xE0', '\xB9', '\x91', '\xE0', '\xB9', '\x93', /* ๐ ๑ ๓ */ + '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB9', ' ', '\xC2', '\xB2', ' ', '\xC2', '\xB3', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xB8', ' ', '\xE1', '\xB4', '\xBC', ' ', '\xE1', '\xB5', '\x81', /* ⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ */ + '\0', + '\xE1', '\xB5', '\x87', ' ', '\xE1', '\xB5', '\x88', ' ', '\xE1', '\xB5', '\x8F', ' ', '\xCA', '\xB0', ' ', '\xCA', '\xB2', ' ', '\xE1', '\xB6', '\xA0', ' ', '\xE2', '\x81', '\xB1', /* ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ */ + '\0', + '\xE1', '\xB5', '\x89', ' ', '\xE1', '\xB5', '\x92', ' ', '\xCA', '\xB3', ' ', '\xCB', '\xA2', ' ', '\xCB', '\xA3', ' ', '\xE1', '\xB6', '\x9C', ' ', '\xE1', '\xB6', '\xBB', /* ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ */ + '\0', + '\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ ᵍ */ + '\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', /* င ဎ ဒ ပ ဗ ဝ ၊ ။ */ + '\0', + '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xBC', ' ', '\xE1', '\x81', '\x8D', ' ', '\xE1', '\x81', '\x8F', ' ', '\xE1', '\x81', '\x86', ' ', '\xE1', '\x80', '\xAB', ' ', '\xE1', '\x80', '\xAD', /* ဩ ြ ၍ ၏ ၆ ါ ိ */ + '\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', '\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', /* అ క చ ర ఽ ౨ ౬ */ + '\0', + '\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB9', '\x80', ' ', '\xE0', '\xB9', '\x81', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\x81', ' ', '\xE0', '\xB8', '\xB2', /* บ เ แ อ ก า */ + '\0', + '\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\xA9', ' ', '\xE0', '\xB8', '\xAF', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\xA2', ' ', '\xE0', '\xB8', '\xAE', /* บ ป ษ ฯ อ ย ฮ */ + '\0', + '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\x9D', ' ', '\xE0', '\xB8', '\x9F', /* ป ฝ ฟ */ + '\0', + '\xE0', '\xB9', '\x82', ' ', '\xE0', '\xB9', '\x83', ' ', '\xE0', '\xB9', '\x84', /* โ ใ ไ */ + '\0', + '\xE0', '\xB8', '\x8E', ' ', '\xE0', '\xB8', '\x8F', ' ', '\xE0', '\xB8', '\xA4', ' ', '\xE0', '\xB8', '\xA6', /* ฎ ฏ ฤ ฦ */ + '\0', + '\xE0', '\xB8', '\x8D', ' ', '\xE0', '\xB8', '\x90', /* ญ ฐ */ + '\0', + '\xE0', '\xB9', '\x90', ' ', '\xE0', '\xB9', '\x91', ' ', '\xE0', '\xB9', '\x93', /* ๐ ๑ ๓ */ #ifdef AF_CONFIG_OPTION_CJK '\0', - '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 他们你來們到和地 */ - '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', '\xE5', '\xB8', '\xAD', '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x83', /* 对對就席我时時會 */ - '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\x83', '\xBD', '\xE8', '\x88', '\xB0', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 来為能舰說说这這 */ - '\xE9', '\xBD', '\x8A', '|', /* 齊 | */ - '\xE5', '\x86', '\x9B', '\xE5', '\x90', '\x8C', '\xE5', '\xB7', '\xB2', '\xE6', '\x84', '\xBF', '\xE6', '\x97', '\xA2', '\xE6', '\x98', '\x9F', '\xE6', '\x98', '\xAF', '\xE6', '\x99', '\xAF', /* 军同已愿既星是景 */ - '\xE6', '\xB0', '\x91', '\xE7', '\x85', '\xA7', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\xA8', '\xE7', '\xBD', '\xAE', '\xE8', '\xA6', '\x81', /* 民照现現理用置要 */ - '\xE8', '\xBB', '\x8D', '\xE9', '\x82', '\xA3', '\xE9', '\x85', '\x8D', '\xE9', '\x87', '\x8C', '\xE9', '\x96', '\x8B', '\xE9', '\x9B', '\xB7', '\xE9', '\x9C', '\xB2', '\xE9', '\x9D', '\xA2', /* 軍那配里開雷露面 */ - '\xE9', '\xA1', '\xBE', /* 顾 */ - '\0', - '\xE4', '\xB8', '\xAA', '\xE4', '\xB8', '\xBA', '\xE4', '\xBA', '\xBA', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xA5', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', /* 个为人他以们你來 */ - '\xE5', '\x80', '\x8B', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\xA4', '\xA7', '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', /* 個們到和大对對就 */ - '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x89', '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\xA6', '\x81', '\xE8', '\xAA', '\xAA', /* 我时時有来為要說 */ - '\xE8', '\xAF', '\xB4', '|', /* 说 | */ - '\xE4', '\xB8', '\xBB', '\xE4', '\xBA', '\x9B', '\xE5', '\x9B', '\xA0', '\xE5', '\xAE', '\x83', '\xE6', '\x83', '\xB3', '\xE6', '\x84', '\x8F', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\x9F', /* 主些因它想意理生 */ - '\xE7', '\x95', '\xB6', '\xE7', '\x9C', '\x8B', '\xE7', '\x9D', '\x80', '\xE7', '\xBD', '\xAE', '\xE8', '\x80', '\x85', '\xE8', '\x87', '\xAA', '\xE8', '\x91', '\x97', '\xE8', '\xA3', '\xA1', /* 當看着置者自著裡 */ - '\xE8', '\xBF', '\x87', '\xE8', '\xBF', '\x98', '\xE8', '\xBF', '\x9B', '\xE9', '\x80', '\xB2', '\xE9', '\x81', '\x8E', '\xE9', '\x81', '\x93', '\xE9', '\x82', '\x84', '\xE9', '\x87', '\x8C', /* 过还进進過道還里 */ - '\xE9', '\x9D', '\xA2', /* 面 */ + '\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 他 们 你 來 們 到 和 地 */ + ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB8', '\xAD', ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x83', /* 对 對 就 席 我 时 時 會 */ + ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\x88', '\xB0', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* 来 為 能 舰 說 说 这 這 */ + ' ', '\xE9', '\xBD', '\x8A', ' ', '|', /* 齊 | */ + ' ', '\xE5', '\x86', '\x9B', ' ', '\xE5', '\x90', '\x8C', ' ', '\xE5', '\xB7', '\xB2', ' ', '\xE6', '\x84', '\xBF', ' ', '\xE6', '\x97', '\xA2', ' ', '\xE6', '\x98', '\x9F', ' ', '\xE6', '\x98', '\xAF', ' ', '\xE6', '\x99', '\xAF', /* 军 同 已 愿 既 星 是 景 */ + ' ', '\xE6', '\xB0', '\x91', ' ', '\xE7', '\x85', '\xA7', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\xA8', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\xA6', '\x81', /* 民 照 现 現 理 用 置 要 */ + ' ', '\xE8', '\xBB', '\x8D', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x85', '\x8D', ' ', '\xE9', '\x87', '\x8C', ' ', '\xE9', '\x96', '\x8B', ' ', '\xE9', '\x9B', '\xB7', ' ', '\xE9', '\x9C', '\xB2', ' ', '\xE9', '\x9D', '\xA2', /* 軍 那 配 里 開 雷 露 面 */ + ' ', '\xE9', '\xA1', '\xBE', /* 顾 */ + '\0', + '\xE4', '\xB8', '\xAA', ' ', '\xE4', '\xB8', '\xBA', ' ', '\xE4', '\xBA', '\xBA', ' ', '\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xA5', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', /* 个 为 人 他 以 们 你 來 */ + ' ', '\xE5', '\x80', '\x8B', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\xA4', '\xA7', ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', /* 個 們 到 和 大 对 對 就 */ + ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x89', ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\xA6', '\x81', ' ', '\xE8', '\xAA', '\xAA', /* 我 时 時 有 来 為 要 說 */ + ' ', '\xE8', '\xAF', '\xB4', ' ', '|', /* 说 | */ + ' ', '\xE4', '\xB8', '\xBB', ' ', '\xE4', '\xBA', '\x9B', ' ', '\xE5', '\x9B', '\xA0', ' ', '\xE5', '\xAE', '\x83', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x84', '\x8F', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\x9F', /* 主 些 因 它 想 意 理 生 */ + ' ', '\xE7', '\x95', '\xB6', ' ', '\xE7', '\x9C', '\x8B', ' ', '\xE7', '\x9D', '\x80', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\x80', '\x85', ' ', '\xE8', '\x87', '\xAA', ' ', '\xE8', '\x91', '\x97', ' ', '\xE8', '\xA3', '\xA1', /* 當 看 着 置 者 自 著 裡 */ + ' ', '\xE8', '\xBF', '\x87', ' ', '\xE8', '\xBF', '\x98', ' ', '\xE8', '\xBF', '\x9B', ' ', '\xE9', '\x80', '\xB2', ' ', '\xE9', '\x81', '\x8E', ' ', '\xE9', '\x81', '\x93', ' ', '\xE9', '\x82', '\x84', ' ', '\xE9', '\x87', '\x8C', /* 过 还 进 進 過 道 還 里 */ + ' ', '\xE9', '\x9D', '\xA2', /* 面 */ #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT '\0', - '\xE4', '\xBA', '\x9B', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 些们你來們到和地 */ - '\xE5', '\xA5', '\xB9', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE5', '\xB0', '\xB1', '\xE5', '\xB9', '\xB4', '\xE5', '\xBE', '\x97', '\xE6', '\x83', '\x85', '\xE6', '\x9C', '\x80', /* 她将將就年得情最 */ - '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE7', '\x90', '\x86', '\xE8', '\x83', '\xBD', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 样樣理能說说这這 */ - '\xE9', '\x80', '\x9A', '|', /* 通 | */ - '\xE5', '\x8D', '\xB3', '\xE5', '\x90', '\x97', '\xE5', '\x90', '\xA7', '\xE5', '\x90', '\xAC', '\xE5', '\x91', '\xA2', '\xE5', '\x93', '\x81', '\xE5', '\x93', '\x8D', '\xE5', '\x97', '\x8E', /* 即吗吧听呢品响嗎 */ - '\xE5', '\xB8', '\x88', '\xE5', '\xB8', '\xAB', '\xE6', '\x94', '\xB6', '\xE6', '\x96', '\xAD', '\xE6', '\x96', '\xB7', '\xE6', '\x98', '\x8E', '\xE7', '\x9C', '\xBC', '\xE9', '\x96', '\x93', /* 师師收断斷明眼間 */ - '\xE9', '\x97', '\xB4', '\xE9', '\x99', '\x85', '\xE9', '\x99', '\x88', '\xE9', '\x99', '\x90', '\xE9', '\x99', '\xA4', '\xE9', '\x99', '\xB3', '\xE9', '\x9A', '\x8F', '\xE9', '\x9A', '\x9B', /* 间际陈限除陳随際 */ - '\xE9', '\x9A', '\xA8', /* 隨 */ - '\0', - '\xE4', '\xBA', '\x8B', '\xE5', '\x89', '\x8D', '\xE5', '\xAD', '\xB8', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE6', '\x83', '\x85', '\xE6', '\x83', '\xB3', '\xE6', '\x88', '\x96', /* 事前學将將情想或 */ - '\xE6', '\x94', '\xBF', '\xE6', '\x96', '\xAF', '\xE6', '\x96', '\xB0', '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE6', '\xB0', '\x91', '\xE6', '\xB2', '\x92', '\xE6', '\xB2', '\xA1', /* 政斯新样樣民沒没 */ - '\xE7', '\x84', '\xB6', '\xE7', '\x89', '\xB9', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x83', '\xE7', '\xAC', '\xAC', '\xE7', '\xB6', '\x93', '\xE8', '\xB0', '\x81', /* 然特现現球第經谁 */ - '\xE8', '\xB5', '\xB7', '|', /* 起 | */ - '\xE4', '\xBE', '\x8B', '\xE5', '\x88', '\xA5', '\xE5', '\x88', '\xAB', '\xE5', '\x88', '\xB6', '\xE5', '\x8A', '\xA8', '\xE5', '\x8B', '\x95', '\xE5', '\x90', '\x97', '\xE5', '\x97', '\x8E', /* 例別别制动動吗嗎 */ - '\xE5', '\xA2', '\x9E', '\xE6', '\x8C', '\x87', '\xE6', '\x98', '\x8E', '\xE6', '\x9C', '\x9D', '\xE6', '\x9C', '\x9F', '\xE6', '\x9E', '\x84', '\xE7', '\x89', '\xA9', '\xE7', '\xA1', '\xAE', /* 增指明朝期构物确 */ - '\xE7', '\xA7', '\x8D', '\xE8', '\xAA', '\xBF', '\xE8', '\xB0', '\x83', '\xE8', '\xB2', '\xBB', '\xE8', '\xB4', '\xB9', '\xE9', '\x82', '\xA3', '\xE9', '\x83', '\xBD', '\xE9', '\x96', '\x93', /* 种調调費费那都間 */ - '\xE9', '\x97', '\xB4', /* 间 */ + ' ', '\xE4', '\xBA', '\x9B', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 些 们 你 來 們 到 和 地 */ + ' ', '\xE5', '\xA5', '\xB9', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB9', '\xB4', ' ', '\xE5', '\xBE', '\x97', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x9C', '\x80', /* 她 将 將 就 年 得 情 最 */ + ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE7', '\x90', '\x86', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* 样 樣 理 能 說 说 这 這 */ + ' ', '\xE9', '\x80', '\x9A', ' ', '|', /* 通 | */ + ' ', '\xE5', '\x8D', '\xB3', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x90', '\xA7', ' ', '\xE5', '\x90', '\xAC', ' ', '\xE5', '\x91', '\xA2', ' ', '\xE5', '\x93', '\x81', ' ', '\xE5', '\x93', '\x8D', ' ', '\xE5', '\x97', '\x8E', /* 即 吗 吧 听 呢 品 响 嗎 */ + ' ', '\xE5', '\xB8', '\x88', ' ', '\xE5', '\xB8', '\xAB', ' ', '\xE6', '\x94', '\xB6', ' ', '\xE6', '\x96', '\xAD', ' ', '\xE6', '\x96', '\xB7', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE7', '\x9C', '\xBC', ' ', '\xE9', '\x96', '\x93', /* 师 師 收 断 斷 明 眼 間 */ + ' ', '\xE9', '\x97', '\xB4', ' ', '\xE9', '\x99', '\x85', ' ', '\xE9', '\x99', '\x88', ' ', '\xE9', '\x99', '\x90', ' ', '\xE9', '\x99', '\xA4', ' ', '\xE9', '\x99', '\xB3', ' ', '\xE9', '\x9A', '\x8F', ' ', '\xE9', '\x9A', '\x9B', /* 间 际 陈 限 除 陳 随 際 */ + ' ', '\xE9', '\x9A', '\xA8', /* 隨 */ + '\0', + '\xE4', '\xBA', '\x8B', ' ', '\xE5', '\x89', '\x8D', ' ', '\xE5', '\xAD', '\xB8', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x88', '\x96', /* 事 前 學 将 將 情 想 或 */ + ' ', '\xE6', '\x94', '\xBF', ' ', '\xE6', '\x96', '\xAF', ' ', '\xE6', '\x96', '\xB0', ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE6', '\xB0', '\x91', ' ', '\xE6', '\xB2', '\x92', ' ', '\xE6', '\xB2', '\xA1', /* 政 斯 新 样 樣 民 沒 没 */ + ' ', '\xE7', '\x84', '\xB6', ' ', '\xE7', '\x89', '\xB9', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x83', ' ', '\xE7', '\xAC', '\xAC', ' ', '\xE7', '\xB6', '\x93', ' ', '\xE8', '\xB0', '\x81', /* 然 特 现 現 球 第 經 谁 */ + ' ', '\xE8', '\xB5', '\xB7', ' ', '|', /* 起 | */ + ' ', '\xE4', '\xBE', '\x8B', ' ', '\xE5', '\x88', '\xA5', ' ', '\xE5', '\x88', '\xAB', ' ', '\xE5', '\x88', '\xB6', ' ', '\xE5', '\x8A', '\xA8', ' ', '\xE5', '\x8B', '\x95', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x97', '\x8E', /* 例 別 别 制 动 動 吗 嗎 */ + ' ', '\xE5', '\xA2', '\x9E', ' ', '\xE6', '\x8C', '\x87', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE6', '\x9C', '\x9D', ' ', '\xE6', '\x9C', '\x9F', ' ', '\xE6', '\x9E', '\x84', ' ', '\xE7', '\x89', '\xA9', ' ', '\xE7', '\xA1', '\xAE', /* 增 指 明 朝 期 构 物 确 */ + ' ', '\xE7', '\xA7', '\x8D', ' ', '\xE8', '\xAA', '\xBF', ' ', '\xE8', '\xB0', '\x83', ' ', '\xE8', '\xB2', '\xBB', ' ', '\xE8', '\xB4', '\xB9', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x83', '\xBD', ' ', '\xE9', '\x96', '\x93', /* 种 調 调 費 费 那 都 間 */ + ' ', '\xE9', '\x97', '\xB4', /* 间 */ #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ #endif /* AF_CONFIG_OPTION_CJK */ '\0', @@ -175,6 +207,13 @@ { AF_BLUE_STRING_ARABIC_BOTTOM, 0 }, { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }, { 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_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 | @@ -203,6 +242,20 @@ { 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 }, + { AF_BLUE_STRING_KHMER_BOTTOM, 0 }, + { AF_BLUE_STRING_KHMER_DESCENDER, 0 }, + { AF_BLUE_STRING_KHMER_LARGE_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + 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 }, @@ -234,6 +287,12 @@ { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }, { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 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_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_TELUGU_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin index b303a4b2b01..0c3cae818fb 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.cin +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat index 1b52378ed3e..9a7757c22c0 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.dat +++ b/Build/source/libs/freetype2/freetype-src/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, @@ -20,9 +20,8 @@ // labels separated by whitespace and followed by a colon (everything in a // single line); the first label gives the name of the enumeration template, // the second the name of the array template, and the third the name of the -// `maximum' template, holding the size of the largest array element. The -// script then fills the corresponding templates (indicated by `@' -// characters around the name). +// `maximum' template. The script then fills the corresponding templates +// (indicated by `@' characters around the name). // // A section contains one or more data records. Each data record consists // of two or more lines. The first line holds the enumeration name, and the @@ -30,15 +29,20 @@ // // There are two possible representations for array data. // -// - A string of characters in UTF-8 encoding enclosed in double quotes, -// using C syntax. There can be only one string per line, thus the -// starting and ending double quote must be the first and last character -// in the line, respectively, ignoring whitespace before and after the -// string. Space characters within the string are ignored too. If there -// are multiple strings (in multiple lines), they are concatenated to a -// single string. In the output, a string gets represented as a series of -// singles bytes, followed by a zero byte. The enumeration values simply -// hold byte offsets to the start of the corresponding strings. +// - A string of characters or character clusters (for example, representing +// Aksharas, Devanagari syllables) in UTF-8 encoding enclosed in double +// quotes, using C syntax, where the elements are separated by spaces. +// There can be only one string per line, thus the starting and ending +// double quote must be the first and last character in the line, +// respectively, ignoring whitespace before and after the string. If +// there are multiple strings (in multiple lines), they are concatenated +// to a single string. In the output, a string gets represented as a +// series of singles bytes, followed by a zero byte. The enumeration +// values simply hold byte offsets to the start of the corresponding +// strings. +// +// For strings, the `maximum' template holds the maximum number of +// non-space characters in all strings. // // - Data blocks enclosed in balanced braces, which get copied verbatim and // which can span multiple lines. The opening brace of a block must be @@ -47,6 +51,9 @@ // character after each block and counts the number of blocks to set the // enumeration values. // +// For data blocks, the `maximum' template holds the maximum number of +// array elements. +// // A section can contain either strings only or data blocks only. // // A comment line starts with `//'; it gets removed. A preprocessor @@ -79,17 +86,22 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_ARABIC_JOIN "ـ" + AF_BLUE_STRING_BENGALI_BASE + "অ ড ত ন ব ভ ল ক" + AF_BLUE_STRING_BENGALI_TOP + "ই ট ঠ ি ী ৈ ৗ" + AF_BLUE_STRING_BENGALI_HEAD + "ও এ ড ত ন ব ল ক" + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP - "БВЕПЗОСЭ" + "Б В Е П З О С Э" AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM - "БВЕШЗОСЭ" + "Б В Е Ш З О С Э" AF_BLUE_STRING_CYRILLIC_SMALL - "хпншезос" + "х п н ш е з о с" AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER - "руф" + "р у ф" - // we separate the letters with spaces to avoid ligatures; - // this is just for convenience to simplify reading AF_BLUE_STRING_DEVANAGARI_BASE "क म अ आ थ ध भ श" AF_BLUE_STRING_DEVANAGARI_TOP @@ -103,22 +115,43 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: "ु ृ" AF_BLUE_STRING_GREEK_CAPITAL_TOP - "ΓΒΕΖΘΟΩ" + "Γ Β Ε Ζ Θ Ο Ω" AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM - "ΒΔΖΞΘΟ" + "Β Δ Ζ Ξ Θ Ο" AF_BLUE_STRING_GREEK_SMALL_BETA_TOP - "βθδζλξ" + "β θ δ ζ λ ξ" AF_BLUE_STRING_GREEK_SMALL - "αειοπστω" + "α ε ι ο π σ τ ω" AF_BLUE_STRING_GREEK_SMALL_DESCENDER - "βγημρφχψ" + "β γ η μ ρ φ χ ψ" AF_BLUE_STRING_HEBREW_TOP - "בדהחךכםס" + "ב ד ה ח ך כ ם ס" AF_BLUE_STRING_HEBREW_BOTTOM - "בטכםסצ" + "ב ט כ ם ס צ" 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 + "ក្ក ក្ខ ក្គ ក្ថ" + AF_BLUE_STRING_KHMER_BOTTOM + "ខ ឃ ច ឋ ប ម យ ឲ" + AF_BLUE_STRING_KHMER_DESCENDER + "ត្រ រៀ ឲ្យ អឿ" + AF_BLUE_STRING_KHMER_LARGE_DESCENDER + "ន្ត្រៃ ង្ខ្យ ក្បៀ ច្រៀ ន្តឿ ល្បឿ" + + AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP + "᧠ ᧡" + AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM + "᧶ ᧹" AF_BLUE_STRING_LAO_TOP "າ ດ ອ ມ ລ ວ ຣ ງ" @@ -132,43 +165,50 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: "ງ ຊ ຖ ຽ ໆ ຯ" AF_BLUE_STRING_LATIN_CAPITAL_TOP - "THEZOCQS" + "T H E Z O C Q S" AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM - "HEZLOCUS" + "H E Z L O C U S" AF_BLUE_STRING_LATIN_SMALL_F_TOP - "fijkdbh" + "f i j k d b h" AF_BLUE_STRING_LATIN_SMALL - "xzroesc" + "x z r o e s c" AF_BLUE_STRING_LATIN_SMALL_DESCENDER - "pqgjy" + "p q g j y" // we assume that both the subscript and superscript ranges // don't contain oldstyle digits (actually, most fonts probably // have digits only in those ranges) AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP - "₀₃₅₇₈" + "₀ ₃ ₅ ₇ ₈" AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM - "₀₁₂₃₈" + "₀ ₁ ₂ ₃ ₈" AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP - "ᵢⱼₕₖₗ" + "ᵢ ⱼ ₕ ₖ ₗ" AF_BLUE_STRING_LATIN_SUBS_SMALL - "ₐₑₒₓₙₛᵥᵤᵣ" + "ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ" AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER - "ᵦᵧᵨᵩₚ" + "ᵦ ᵧ ᵨ ᵩ ₚ" AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP - "⁰³⁵⁷ᵀᴴᴱᴼ" + "⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ" AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM - "⁰¹²³ᴱᴸᴼᵁ" + "⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ" AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP - "ᵇᵈᵏʰʲᶠⁱ" + "ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ" AF_BLUE_STRING_LATIN_SUPS_SMALL - "ᵉᵒʳˢˣᶜᶻ" + "ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ" AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER - "ᵖʸᵍ" + "ᵖ ʸ ᵍ" + + AF_BLUE_STRING_MYANMAR_TOP + "ခ ဂ င ဒ ဝ ၥ ၊ ။" + AF_BLUE_STRING_MYANMAR_BOTTOM + "င ဎ ဒ ပ ဗ ဝ ၊ ။" + AF_BLUE_STRING_MYANMAR_ASCENDER + "ဩ ြ ၍ ၏ ၆ ါ ိ" + AF_BLUE_STRING_MYANMAR_DESCENDER + "ဉ ည ဥ ဩ ဨ ၂ ၅ ၉" - // we separate the letters with spaces to avoid ligatures; - // this is just for convenience to simplify reading AF_BLUE_STRING_TELUGU_TOP "ఇ ఌ ఙ ఞ ణ ఱ ౯" AF_BLUE_STRING_TELUGU_BOTTOM @@ -193,44 +233,44 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP - "他们你來們到和地" - "对對就席我时時會" - "来為能舰說说这這" - "齊 |" - "军同已愿既星是景" - "民照现現理用置要" - "軍那配里開雷露面" - "顾" + "他 们 你 來 們 到 和 地" + " 对 對 就 席 我 时 時 會" + " 来 為 能 舰 說 说 这 這" + " 齊 |" + " 军 同 已 愿 既 星 是 景" + " 民 照 现 現 理 用 置 要" + " 軍 那 配 里 開 雷 露 面" + " 顾" AF_BLUE_STRING_CJK_BOTTOM - "个为人他以们你來" - "個們到和大对對就" - "我时時有来為要說" - "说 |" - "主些因它想意理生" - "當看着置者自著裡" - "过还进進過道還里" - "面" + "个 为 人 他 以 们 你 來" + " 個 們 到 和 大 对 對 就" + " 我 时 時 有 来 為 要 說" + " 说 |" + " 主 些 因 它 想 意 理 生" + " 當 看 着 置 者 自 著 裡" + " 过 还 进 進 過 道 還 里" + " 面" #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT AF_BLUE_STRING_CJK_LEFT - "些们你來們到和地" - "她将將就年得情最" - "样樣理能說说这這" - "通 |" - "即吗吧听呢品响嗎" - "师師收断斷明眼間" - "间际陈限除陳随際" - "隨" + " 些 们 你 來 們 到 和 地" + " 她 将 將 就 年 得 情 最" + " 样 樣 理 能 說 说 这 這" + " 通 |" + " 即 吗 吧 听 呢 品 响 嗎" + " 师 師 收 断 斷 明 眼 間" + " 间 际 陈 限 除 陳 随 際" + " 隨" AF_BLUE_STRING_CJK_RIGHT - "事前學将將情想或" - "政斯新样樣民沒没" - "然特现現球第經谁" - "起 |" - "例別别制动動吗嗎" - "增指明朝期构物确" - "种調调費费那都間" - "间" + "事 前 學 将 將 情 想 或" + " 政 斯 新 样 樣 民 沒 没" + " 然 特 现 現 球 第 經 谁" + " 起 |" + " 例 別 别 制 动 動 吗 嗎" + " 增 指 明 朝 期 构 物 确" + " 种 調 调 費 费 那 都 間" + " 间" #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ @@ -262,6 +302,14 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: // respectively. Only horizontal blue zones (i.e., adjusting vertical // coordinate values) are supported. // +// Some scripts like Khmer need character composition to get all necessary +// blue zones, since Unicode only provides an abstract data model that +// doesn't represent all possible glyph shapes. For such character +// clusters, the HarfBuzz library is used to convert them into the +// corresponding glyphs. The largest glyph element (where `largest' can be +// either `largest ascender' or `largest descender') then defines the +// corresponding flat or round extremum. +// // For the latin auto-hinter, the overshoot should be larger than the // reference for top zones, and vice versa for bottom zones. // @@ -272,6 +320,21 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: // // If not set, take the minimum values. // +// Mutually exclusive with `LATIN_SUB_TOP'. +// +// LATIN_SUB_TOP +// For all glyphs of a character cluster, compute the maximum flat +// and round coordinate values of each component, then take the +// smallest of the maximum values. The idea is to get the top of +// subscript glyphs, as used in Khmer, for example. Note that +// this mechanism doesn't work for ordinary ligatures. +// +// This flags indicates a secondary blue zone: It gets removed if +// there is a non-LATIN_SUB_TOP blue zone at the same coordinate +// value (after scaling). +// +// Mutually exclusive with `LATIN_TOP'. +// // LATIN_NEUTRAL // Ignore round extrema and define the blue zone with flat values only. // Both top and bottom of contours can match. This is useful for @@ -307,11 +370,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: // // Characters in a blue string are *not* automatically classified. Instead, // first come the characters used for the overshoot value, then the -// character `|', then the characters used for the reference value. The -// blue zone is then set up by the mean values of all reference values and -// all overshoot values, respectively. Both horizontal and vertical blue -// zones (i.e., adjusting vertical and horizontal coordinate values, -// respectively) are supported. +// character `|', then the characters used for the reference value +// (everything separated by space characters). The blue zone is then set up +// by the mean values of all reference values and all overshoot values, +// respectively. Both horizontal and vertical blue zones (i.e., adjusting +// vertical and horizontal coordinate values, respectively) are supported. // // For the cjk auto-hinter, the overshoot should be smaller than the // reference for top zones, and vice versa for bottom zones. @@ -337,6 +400,15 @@ 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_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_CYRL { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } @@ -373,6 +445,26 @@ 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 } + { AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP, AF_BLUE_PROPERTY_LATIN_SUB_TOP } + { AF_BLUE_STRING_KHMER_BOTTOM, 0 } + { AF_BLUE_STRING_KHMER_DESCENDER, 0 } + { AF_BLUE_STRING_KHMER_LARGE_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_KHMS + { AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 } + { 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 } @@ -412,6 +504,14 @@ 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_MYMR + { 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_STRINGSET_TELU { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_TELUGU_BOTTOM, 0 } diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h index c26a9c792b0..75cd6c3fa0c 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.h +++ b/Build/source/libs/freetype2/freetype-src/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 @@ -28,32 +28,35 @@ FT_BEGIN_HEADER /* an auxiliary macro to decode a UTF-8 character -- since we only use */ /* hard-coded, self-converted data, no error checking is performed */ -#define GET_UTF8_CHAR( ch, p ) \ - ch = (unsigned char)*p++; \ - if ( ch >= 0x80 ) \ - { \ - FT_UInt len; \ - \ - \ - if ( ch < 0xE0 ) \ - { \ - len = 1; \ - ch &= 0x1F; \ - } \ - else if ( ch < 0xF0 ) \ - { \ - len = 2; \ - ch &= 0x0F; \ - } \ - else \ - { \ - len = 3; \ - ch &= 0x07; \ - } \ - \ - for ( ; len > 0; len-- ) \ - ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ - } +#define GET_UTF8_CHAR( ch, p ) \ + do \ + { \ + ch = (unsigned char)*p++; \ + if ( ch >= 0x80 ) \ + { \ + FT_UInt len_; \ + \ + \ + if ( ch < 0xE0 ) \ + { \ + len_ = 1; \ + ch &= 0x1F; \ + } \ + else if ( ch < 0xF0 ) \ + { \ + len_ = 2; \ + ch &= 0x0F; \ + } \ + else \ + { \ + len_ = 3; \ + ch &= 0x07; \ + } \ + \ + for ( ; len_ > 0; len_-- ) \ + ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ + } \ + } while ( 0 ) /*************************************************************************/ @@ -75,62 +78,78 @@ FT_BEGIN_HEADER typedef enum AF_Blue_String_ { AF_BLUE_STRING_ARABIC_TOP = 0, - AF_BLUE_STRING_ARABIC_BOTTOM = 13, - AF_BLUE_STRING_ARABIC_JOIN = 24, - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 27, - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 44, - AF_BLUE_STRING_CYRILLIC_SMALL = 61, - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 78, - AF_BLUE_STRING_DEVANAGARI_BASE = 85, - AF_BLUE_STRING_DEVANAGARI_TOP = 110, - AF_BLUE_STRING_DEVANAGARI_HEAD = 135, - AF_BLUE_STRING_DEVANAGARI_BOTTOM = 160, - AF_BLUE_STRING_GREEK_CAPITAL_TOP = 167, - AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 182, - AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 195, - AF_BLUE_STRING_GREEK_SMALL = 208, - AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 225, - AF_BLUE_STRING_HEBREW_TOP = 242, - AF_BLUE_STRING_HEBREW_BOTTOM = 259, - AF_BLUE_STRING_HEBREW_DESCENDER = 272, - AF_BLUE_STRING_LAO_TOP = 283, - AF_BLUE_STRING_LAO_BOTTOM = 308, - AF_BLUE_STRING_LAO_ASCENDER = 333, - AF_BLUE_STRING_LAO_LARGE_ASCENDER = 346, - AF_BLUE_STRING_LAO_DESCENDER = 356, - AF_BLUE_STRING_LATIN_CAPITAL_TOP = 375, - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 384, - AF_BLUE_STRING_LATIN_SMALL_F_TOP = 393, - AF_BLUE_STRING_LATIN_SMALL = 401, - AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 409, - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 415, - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 431, - AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 447, - AF_BLUE_STRING_LATIN_SUBS_SMALL = 463, - AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 491, - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 507, - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 531, - AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 553, - AF_BLUE_STRING_LATIN_SUPS_SMALL = 573, - AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 592, - AF_BLUE_STRING_TELUGU_TOP = 601, - AF_BLUE_STRING_TELUGU_BOTTOM = 623, - AF_BLUE_STRING_THAI_TOP = 645, - AF_BLUE_STRING_THAI_BOTTOM = 664, - AF_BLUE_STRING_THAI_ASCENDER = 686, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 696, - AF_BLUE_STRING_THAI_DESCENDER = 706, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 719, - AF_BLUE_STRING_THAI_DIGIT_TOP = 726, - af_blue_1_1 = 735, + AF_BLUE_STRING_ARABIC_BOTTOM = 18, + AF_BLUE_STRING_ARABIC_JOIN = 33, + AF_BLUE_STRING_BENGALI_BASE = 36, + AF_BLUE_STRING_BENGALI_TOP = 68, + AF_BLUE_STRING_BENGALI_HEAD = 96, + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 128, + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 152, + AF_BLUE_STRING_CYRILLIC_SMALL = 176, + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 200, + AF_BLUE_STRING_DEVANAGARI_BASE = 209, + AF_BLUE_STRING_DEVANAGARI_TOP = 241, + AF_BLUE_STRING_DEVANAGARI_HEAD = 273, + AF_BLUE_STRING_DEVANAGARI_BOTTOM = 305, + AF_BLUE_STRING_GREEK_CAPITAL_TOP = 313, + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 334, + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 352, + AF_BLUE_STRING_GREEK_SMALL = 370, + AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 394, + AF_BLUE_STRING_HEBREW_TOP = 418, + AF_BLUE_STRING_HEBREW_BOTTOM = 442, + AF_BLUE_STRING_HEBREW_DESCENDER = 460, + AF_BLUE_STRING_KANNADA_TOP = 475, + AF_BLUE_STRING_KANNADA_BOTTOM = 519, + AF_BLUE_STRING_KHMER_TOP = 551, + AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 575, + AF_BLUE_STRING_KHMER_BOTTOM = 615, + AF_BLUE_STRING_KHMER_DESCENDER = 647, + AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 681, + AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 768, + AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 776, + AF_BLUE_STRING_LAO_TOP = 784, + AF_BLUE_STRING_LAO_BOTTOM = 816, + AF_BLUE_STRING_LAO_ASCENDER = 848, + AF_BLUE_STRING_LAO_LARGE_ASCENDER = 864, + AF_BLUE_STRING_LAO_DESCENDER = 876, + AF_BLUE_STRING_LATIN_CAPITAL_TOP = 900, + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 916, + AF_BLUE_STRING_LATIN_SMALL_F_TOP = 932, + AF_BLUE_STRING_LATIN_SMALL = 946, + AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 960, + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 970, + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 990, + AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1010, + AF_BLUE_STRING_LATIN_SUBS_SMALL = 1030, + AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 1066, + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 1086, + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 1117, + AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 1146, + AF_BLUE_STRING_LATIN_SUPS_SMALL = 1172, + AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 1197, + AF_BLUE_STRING_MYANMAR_TOP = 1208, + AF_BLUE_STRING_MYANMAR_BOTTOM = 1240, + AF_BLUE_STRING_MYANMAR_ASCENDER = 1272, + AF_BLUE_STRING_MYANMAR_DESCENDER = 1300, + AF_BLUE_STRING_TELUGU_TOP = 1332, + AF_BLUE_STRING_TELUGU_BOTTOM = 1360, + AF_BLUE_STRING_THAI_TOP = 1388, + AF_BLUE_STRING_THAI_BOTTOM = 1412, + AF_BLUE_STRING_THAI_ASCENDER = 1440, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1452, + AF_BLUE_STRING_THAI_DESCENDER = 1464, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1480, + AF_BLUE_STRING_THAI_DIGIT_TOP = 1488, + af_blue_1_1 = 1499, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, - AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153, - af_blue_1_1_1 = af_blue_1_1 + 304, + AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, + af_blue_1_1_1 = af_blue_1_1 + 404, #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1, - AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 153, - af_blue_1_1_2 = af_blue_1_1_1 + 304, + AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 204, + af_blue_1_1_2 = af_blue_1_1_1 + 405, #else af_blue_1_1_2 = af_blue_1_1_1 + 0, #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ @@ -164,9 +183,10 @@ FT_BEGIN_HEADER /* blue string can't be used in more than a single writing system, which */ /* is a safe bet. */ #define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */ -#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 1 ) -#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 2 ) -#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 3 ) +#define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 ) +#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 ) +#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 ) +#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 ) #define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */ #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */ @@ -181,17 +201,22 @@ 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_LAO = 27, - AF_BLUE_STRINGSET_LATN = 33, - AF_BLUE_STRINGSET_LATB = 40, - AF_BLUE_STRINGSET_LATP = 47, - AF_BLUE_STRINGSET_TELU = 54, - AF_BLUE_STRINGSET_THAI = 57, - af_blue_2_1 = 65, + AF_BLUE_STRINGSET_BENG = 4, + AF_BLUE_STRINGSET_CYRL = 9, + AF_BLUE_STRINGSET_DEVA = 15, + AF_BLUE_STRINGSET_GREK = 21, + AF_BLUE_STRINGSET_HEBR = 28, + AF_BLUE_STRINGSET_KNDA = 32, + AF_BLUE_STRINGSET_KHMR = 35, + AF_BLUE_STRINGSET_KHMS = 41, + AF_BLUE_STRINGSET_LAO = 44, + AF_BLUE_STRINGSET_LATN = 50, + AF_BLUE_STRINGSET_LATB = 57, + AF_BLUE_STRINGSET_LATP = 64, + AF_BLUE_STRINGSET_MYMR = 71, + AF_BLUE_STRINGSET_TELU = 76, + AF_BLUE_STRINGSET_THAI = 79, + af_blue_2_1 = 87, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 2, @@ -227,7 +252,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFBLUE_H__ */ +#endif /* AFBLUE_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin b/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin index ad43fe6cef0..dd44e772541 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afblue.hin +++ b/Build/source/libs/freetype2/freetype-src/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 @@ -25,32 +25,35 @@ FT_BEGIN_HEADER /* an auxiliary macro to decode a UTF-8 character -- since we only use */ /* hard-coded, self-converted data, no error checking is performed */ -#define GET_UTF8_CHAR( ch, p ) \ - ch = (unsigned char)*p++; \ - if ( ch >= 0x80 ) \ - { \ - FT_UInt len; \ - \ - \ - if ( ch < 0xE0 ) \ - { \ - len = 1; \ - ch &= 0x1F; \ - } \ - else if ( ch < 0xF0 ) \ - { \ - len = 2; \ - ch &= 0x0F; \ - } \ - else \ - { \ - len = 3; \ - ch &= 0x07; \ - } \ - \ - for ( ; len > 0; len-- ) \ - ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ - } +#define GET_UTF8_CHAR( ch, p ) \ + do \ + { \ + ch = (unsigned char)*p++; \ + if ( ch >= 0x80 ) \ + { \ + FT_UInt len_; \ + \ + \ + if ( ch < 0xE0 ) \ + { \ + len_ = 1; \ + ch &= 0x1F; \ + } \ + else if ( ch < 0xF0 ) \ + { \ + len_ = 2; \ + ch &= 0x0F; \ + } \ + else \ + { \ + len_ = 3; \ + ch &= 0x07; \ + } \ + \ + for ( ; len_ > 0; len_-- ) \ + ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ + } \ + } while ( 0 ) /*************************************************************************/ @@ -97,9 +100,10 @@ FT_BEGIN_HEADER /* blue string can't be used in more than a single writing system, which */ /* is a safe bet. */ #define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */ -#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 1 ) -#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 2 ) -#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 3 ) +#define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 ) +#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 ) +#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 ) +#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 ) #define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */ #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */ @@ -136,7 +140,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFBLUE_H__ */ +#endif /* AFBLUE_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c index 792950dc938..4ba5d22e8be 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -88,7 +88,6 @@ { FT_Error error; FT_ULong glyph_index; - FT_Long y_offset; int dim; AF_CJKMetricsRec dummy[1]; AF_Scaler scaler = &dummy->root.scaler; @@ -101,45 +100,61 @@ AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET [style_class->script]; - FT_UInt32 standard_char; + void* shaper_buf; + const char* p; +#ifdef FT_DEBUG_LEVEL_TRACE + FT_ULong ch = 0; +#endif - standard_char = script_class->standard_char1; - af_get_char_index( &metrics->root, - standard_char, - &glyph_index, - &y_offset ); - if ( !glyph_index ) + p = script_class->standard_charstring; + shaper_buf = af_shaper_buf_create( face ); + + /* We check a list of standard characters. The first match wins. */ + + glyph_index = 0; + while ( *p ) { - if ( script_class->standard_char2 ) - { - standard_char = script_class->standard_char2; - af_get_char_index( &metrics->root, - standard_char, - &glyph_index, - &y_offset ); - if ( !glyph_index ) - { - if ( script_class->standard_char3 ) - { - standard_char = script_class->standard_char3; - af_get_char_index( &metrics->root, - standard_char, - &glyph_index, - &y_offset ); - if ( !glyph_index ) - goto Exit; - } - else - goto Exit; - } - } - else - goto Exit; + unsigned int num_idx; + +#ifdef FT_DEBUG_LEVEL_TRACE + const char* p_old; +#endif + + + while ( *p == ' ' ) + p++; + +#ifdef FT_DEBUG_LEVEL_TRACE + p_old = p; + GET_UTF8_CHAR( ch, p_old ); +#endif + + /* reject input that maps to more than a single glyph */ + p = af_shaper_get_cluster( p, &metrics->root, shaper_buf, &num_idx ); + if ( num_idx > 1 ) + continue; + + /* otherwise exit loop if we have a result */ + glyph_index = af_shaper_get_elem( &metrics->root, + shaper_buf, + 0, + NULL, + NULL ); + if ( glyph_index ) + break; } + af_shaper_buf_destroy( face, shaper_buf ); + + if ( !glyph_index ) + goto Exit; + + if ( !glyph_index ) + goto Exit; + FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", - standard_char, glyph_index )); + ch, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); if ( error || face->glyph->outline.n_points <= 0 ) @@ -177,6 +192,12 @@ if ( error ) goto Exit; + /* + * We assume that the glyphs selected for the stem width + * computation are `featureless' enough so that the linking + * algorithm works fine without adjustments of its scoring + * function. + */ af_latin_hints_link_segments( hints, 0, NULL, @@ -275,6 +296,8 @@ AF_Blue_Stringset bss = sc->blue_stringset; const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; + void* shaper_buf; + /* we walk over the blue character strings as specified in the */ /* style's entry in the `af_blue_stringset' array, computing its */ @@ -284,6 +307,8 @@ "==========================\n" "\n" )); + shaper_buf = af_shaper_buf_create( face ); + for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) { const char* p = &af_blue_strings[bs->string]; @@ -322,26 +347,47 @@ while ( *p ) { - FT_ULong ch; FT_ULong glyph_index; - FT_Long y_offset; FT_Pos best_pos; /* same as points.y or points.x, resp. */ FT_Int best_point; FT_Vector* points; + unsigned int num_idx; + +#ifdef FT_DEBUG_LEVEL_TRACE + const char* p_old; + FT_ULong ch; +#endif + + + while ( *p == ' ' ) + p++; - GET_UTF8_CHAR( ch, p ); +#ifdef FT_DEBUG_LEVEL_TRACE + p_old = p; + GET_UTF8_CHAR( ch, p_old ); +#endif /* switch to characters that define flat values */ - if ( ch == '|' ) + if ( *p == '|' ) { fill = 0; FT_TRACE5(( " [reference values]\n" )); + p++; continue; } + /* reject input that maps to more than a single glyph */ + p = af_shaper_get_cluster( p, &metrics->root, shaper_buf, &num_idx ); + if ( num_idx > 1 ) + continue; + /* load the character in the face -- skip unknown or empty ones */ - af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset ); + glyph_index = af_shaper_get_elem( &metrics->root, + shaper_buf, + 0, + NULL, + NULL ); if ( glyph_index == 0 ) { FT_TRACE5(( " U+%04lX unavailable\n", ch )); @@ -350,9 +396,9 @@ error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); outline = face->glyph->outline; - if ( error || outline.n_points <= 0 ) + if ( error || outline.n_points <= 2 ) { - FT_TRACE5(( " U+%04lX contains no outlines\n", ch )); + FT_TRACE5(( " U+%04lX contains no (usable) outlines\n", ch )); continue; } @@ -431,7 +477,8 @@ fills[num_fills++] = best_pos; else flats[num_flats++] = best_pos; - } + + } /* end while loop */ if ( num_flats == 0 && num_fills == 0 ) { @@ -498,7 +545,10 @@ FT_TRACE5(( " -> reference = %ld\n" " overshoot = %ld\n", *blue_ref, *blue_shoot )); - } + + } /* end for loop */ + + af_shaper_buf_destroy( face, shaper_buf ); FT_TRACE5(( "\n" )); @@ -512,27 +562,36 @@ af_cjk_metrics_check_digits( AF_CJKMetrics metrics, FT_Face face ) { - FT_UInt i; FT_Bool started = 0, same_width = 1; FT_Fixed advance, old_advance = 0; + void* shaper_buf; + + /* in all supported charmaps, digits have character codes 0x30-0x39 */ + const char digits[] = "0 1 2 3 4 5 6 7 8 9"; + const char* p; + - /* digit `0' is 0x30 in all supported charmaps */ - for ( i = 0x30; i <= 0x39; i++ ) + p = digits; + shaper_buf = af_shaper_buf_create( face ); + + while ( *p ) { - FT_ULong glyph_index; - FT_Long y_offset; + FT_ULong glyph_index; + unsigned int num_idx; - af_get_char_index( &metrics->root, i, &glyph_index, &y_offset ); - if ( glyph_index == 0 ) + /* reject input that maps to more than a single glyph */ + p = af_shaper_get_cluster( p, &metrics->root, shaper_buf, &num_idx ); + if ( num_idx > 1 ) continue; - if ( FT_Get_Advance( face, glyph_index, - FT_LOAD_NO_SCALE | - FT_LOAD_NO_HINTING | - FT_LOAD_IGNORE_TRANSFORM, - &advance ) ) + glyph_index = af_shaper_get_elem( &metrics->root, + shaper_buf, + 0, + &advance, + NULL ); + if ( !glyph_index ) continue; if ( started ) @@ -550,6 +609,8 @@ } } + af_shaper_buf_destroy( face, shaper_buf ); + metrics->root.digits_have_same_width = same_width; } @@ -1030,7 +1091,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; diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h index e395e74a012..40d11843864 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afcjk.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h index 520e8a4ae0b..1c39a707ef3 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afcover.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c index 9142c78c21c..f3960c85fd7 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.c +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h index b4fdc78e39a..7e58d1a9a5f 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afdummy.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h index 7b416e470da..53c01f64dda 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/aferrors.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c index f5a39574fbf..ac6dcafc0f2 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -18,7 +18,7 @@ #include "afglobal.h" #include "afranges.h" -#include "hbshim.h" +#include "afshaper.h" #include FT_INTERNAL_DEBUG_H @@ -42,13 +42,14 @@ #undef SCRIPT -#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ +#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, \ - sc1, sc2, sc3 ) + AF_ ## H, \ + ss ) #include "afscript.h" @@ -83,7 +84,7 @@ #undef SCRIPT -#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ +#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_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_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_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++ ) { @@ -364,6 +365,7 @@ #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ globals->hb_font = hb_ft_font_create( face, NULL ); + globals->hb_buf = hb_buffer_create(); #endif error = af_face_globals_compute_style_coverage( globals ); @@ -410,6 +412,9 @@ #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ hb_font_destroy( globals->hb_font ); globals->hb_font = NULL; + + hb_buffer_destroy( globals->hb_buf ); + globals->hb_buf = NULL; #endif globals->glyph_count = 0; diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h index a3112de2c5d..ce6b9e8f266 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afglobal.h +++ b/Build/source/libs/freetype2/freetype-src/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,13 +17,13 @@ /***************************************************************************/ -#ifndef __AFGLOBAL_H__ -#define __AFGLOBAL_H__ +#ifndef AFGLOBAL_H_ +#define AFGLOBAL_H_ #include "aftypes.h" #include "afmodule.h" -#include "hbshim.h" +#include "afshaper.h" FT_BEGIN_HEADER @@ -34,7 +34,7 @@ FT_BEGIN_HEADER #undef SCRIPT -#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class ) #include "afscript.h" @@ -110,6 +110,7 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ hb_font_t* hb_font; + hb_buffer_t* hb_buf; /* for feature comparison */ #endif /* per-face auto-hinter properties */ @@ -166,7 +167,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFGLOBAL_H__ */ +#endif /* AFGLOBAL_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c index 56c82200051..9ed058f6430 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.c +++ b/Build/source/libs/freetype2/freetype-src/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" )); + " xorg yorg xscale yscale xfit yfit" )); else AF_DUMP(( " (none)\n" )); @@ -324,6 +328,13 @@ char buf1[16], buf2[16], buf3[16], buf4[16]; + /* 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, diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h index a64c7a4b111..45635652dbf 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afhints.h +++ b/Build/source/libs/freetype2/freetype-src/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" @@ -419,6 +419,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 +473,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFHINTS_H__ */ +#endif /* AFHINTS_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c index 59b14d7e098..097a2b29955 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.c +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h index 4c36908ada2..0772e07a291 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afindic.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c index 53851e7db13..8a45116b5d7 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -79,7 +79,6 @@ { FT_Error error; FT_ULong glyph_index; - FT_Long y_offset; int dim; AF_LatinMetricsRec dummy[1]; AF_Scaler scaler = &dummy->root.scaler; @@ -92,52 +91,63 @@ AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET [style_class->script]; - FT_UInt32 standard_char; + void* shaper_buf; + const char* p; +#ifdef FT_DEBUG_LEVEL_TRACE + FT_ULong ch = 0; +#endif + + p = script_class->standard_charstring; + shaper_buf = af_shaper_buf_create( face ); /* - * We check more than a single standard character to catch features - * like `c2sc' (small caps from caps) that don't contain lowercase - * letters by definition, or other features that mainly operate on - * numerals. + * We check a list of standard characters to catch features like + * `c2sc' (small caps from caps) that don't contain lowercase letters + * by definition, or other features that mainly operate on numerals. + * The first match wins. */ - standard_char = script_class->standard_char1; - af_get_char_index( &metrics->root, - standard_char, - &glyph_index, - &y_offset ); - if ( !glyph_index ) + glyph_index = 0; + while ( *p ) { - if ( script_class->standard_char2 ) - { - standard_char = script_class->standard_char2; - af_get_char_index( &metrics->root, - standard_char, - &glyph_index, - &y_offset ); - if ( !glyph_index ) - { - if ( script_class->standard_char3 ) - { - standard_char = script_class->standard_char3; - af_get_char_index( &metrics->root, - standard_char, - &glyph_index, - &y_offset ); - if ( !glyph_index ) - goto Exit; - } - else - goto Exit; - } - } - else - goto Exit; + unsigned int num_idx; + +#ifdef FT_DEBUG_LEVEL_TRACE + const char* p_old; +#endif + + + while ( *p == ' ' ) + p++; + +#ifdef FT_DEBUG_LEVEL_TRACE + p_old = p; + GET_UTF8_CHAR( ch, p_old ); +#endif + + /* reject input that maps to more than a single glyph */ + p = af_shaper_get_cluster( p, &metrics->root, shaper_buf, &num_idx ); + if ( num_idx > 1 ) + continue; + + /* otherwise exit loop if we have a result */ + glyph_index = af_shaper_get_elem( &metrics->root, + shaper_buf, + 0, + NULL, + NULL ); + if ( glyph_index ) + break; } + af_shaper_buf_destroy( face, shaper_buf ); + + if ( !glyph_index ) + goto Exit; + FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", - standard_char, glyph_index )); + ch, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); if ( error || face->glyph->outline.n_points <= 0 ) @@ -280,6 +290,8 @@ FT_Pos flat_threshold = FLAT_THRESHOLD( metrics->units_per_em ); + void* shaper_buf; + /* we walk over the blue character strings as specified in the */ /* style's entry in the `af_blue_stringset' array */ @@ -288,6 +300,8 @@ "============================\n" "\n" )); + shaper_buf = af_shaper_buf_create( face ); + for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) { const char* p = &af_blue_strings[bs->string]; @@ -313,6 +327,11 @@ FT_TRACE5(( "top" )); have_flag = 1; } + else if ( AF_LATIN_IS_SUB_TOP_BLUE( bs ) ) + { + FT_TRACE5(( "sub top" )); + have_flag = 1; + } if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) { @@ -351,401 +370,477 @@ while ( *p ) { - FT_ULong ch; FT_ULong glyph_index; FT_Long y_offset; - FT_Pos best_y; /* same as points.y */ FT_Int best_point, best_contour_first, best_contour_last; FT_Vector* points; - FT_Bool round = 0; + FT_Pos best_y_extremum; /* same as points.y */ + FT_Bool best_round = 0; - GET_UTF8_CHAR( ch, p ); + unsigned int i, num_idx; + +#ifdef FT_DEBUG_LEVEL_TRACE + const char* p_old; + FT_ULong ch; +#endif - /* load the character in the face -- skip unknown or empty ones */ - af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset ); - if ( glyph_index == 0 ) - { - FT_TRACE5(( " U+%04lX unavailable\n", ch )); - continue; - } - error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); - outline = face->glyph->outline; - /* reject glyphs that don't produce any rendering */ - if ( error || outline.n_points <= 2 ) + while ( *p == ' ' ) + p++; + +#ifdef FT_DEBUG_LEVEL_TRACE + p_old = p; + GET_UTF8_CHAR( ch, p_old ); +#endif + + p = af_shaper_get_cluster( p, &metrics->root, shaper_buf, &num_idx ); + + if ( !num_idx ) { - FT_TRACE5(( " U+%04lX contains no (usable) outlines\n", ch )); + FT_TRACE5(( " U+%04lX unavailable\n", ch )); continue; } - /* now compute min or max point indices and coordinates */ - points = outline.points; - best_point = -1; - best_y = 0; /* make compiler happy */ - best_contour_first = 0; /* ditto */ - best_contour_last = 0; /* ditto */ + if ( AF_LATIN_IS_TOP_BLUE( bs ) ) + best_y_extremum = FT_INT_MIN; + else + best_y_extremum = FT_INT_MAX; + /* iterate over all glyph elements of the character cluster */ + /* and get the data of the `biggest' one */ + for ( i = 0; i < num_idx; i++ ) { - FT_Int nn; - FT_Int first = 0; - FT_Int last = -1; + FT_Pos best_y; + FT_Bool round = 0; - for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ ) + /* load the character in the face -- skip unknown or empty ones */ + glyph_index = af_shaper_get_elem( &metrics->root, + shaper_buf, + i, + NULL, + &y_offset ); + if ( glyph_index == 0 ) { - FT_Int old_best_point = best_point; - FT_Int pp; + FT_TRACE5(( " U+%04lX unavailable\n", ch )); + continue; + } + error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); + outline = face->glyph->outline; + /* reject glyphs that don't produce any rendering */ + if ( error || outline.n_points <= 2 ) + { +#ifdef FT_DEBUG_LEVEL_TRACE + if ( num_idx == 1 ) + FT_TRACE5(( " U+%04lX contains no (usable) outlines\n", ch )); + else + FT_TRACE5(( " component %d of cluster starting with U+%04lX" + " contains no (usable) outlines\n", i, ch )); +#endif + continue; + } - last = outline.contours[nn]; + /* now compute min or max point indices and coordinates */ + points = outline.points; + best_point = -1; + best_y = 0; /* make compiler happy */ + best_contour_first = 0; /* ditto */ + best_contour_last = 0; /* ditto */ - /* Avoid single-point contours since they are never rasterized. */ - /* In some fonts, they correspond to mark attachment points */ - /* that are way outside of the glyph's real outline. */ - if ( last <= first ) - continue; + { + FT_Int nn; + FT_Int first = 0; + FT_Int last = -1; - if ( AF_LATIN_IS_TOP_BLUE( bs ) ) + + for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ ) { - for ( pp = first; pp <= last; pp++ ) + FT_Int old_best_point = best_point; + FT_Int pp; + + + last = outline.contours[nn]; + + /* Avoid single-point contours since they are never */ + /* rasterized. In some fonts, they correspond to mark */ + /* attachment points that are way outside of the glyph's */ + /* real outline. */ + if ( last <= first ) + continue; + + if ( AF_LATIN_IS_TOP_BLUE( bs ) || + AF_LATIN_IS_SUB_TOP_BLUE( bs ) ) { - if ( best_point < 0 || points[pp].y > best_y ) + for ( pp = first; pp <= last; pp++ ) { - best_point = pp; - best_y = points[pp].y; - ascender = FT_MAX( ascender, best_y + y_offset ); + if ( best_point < 0 || points[pp].y > best_y ) + { + best_point = pp; + best_y = points[pp].y; + ascender = FT_MAX( ascender, best_y + y_offset ); + } + else + descender = FT_MIN( descender, points[pp].y + y_offset ); } - else - descender = FT_MIN( descender, points[pp].y + y_offset ); } - } - else - { - for ( pp = first; pp <= last; pp++ ) + else { - if ( best_point < 0 || points[pp].y < best_y ) + for ( pp = first; pp <= last; pp++ ) { - best_point = pp; - best_y = points[pp].y; - descender = FT_MIN( descender, best_y + y_offset ); + if ( best_point < 0 || points[pp].y < best_y ) + { + best_point = pp; + best_y = points[pp].y; + descender = FT_MIN( descender, best_y + y_offset ); + } + else + ascender = FT_MAX( ascender, points[pp].y + y_offset ); } - else - ascender = FT_MAX( ascender, points[pp].y + y_offset ); } - } - if ( best_point != old_best_point ) - { - best_contour_first = first; - best_contour_last = last; + if ( best_point != old_best_point ) + { + best_contour_first = first; + best_contour_last = last; + } } } - } - - /* now check whether the point belongs to a straight or round */ - /* segment; we first need to find in which contour the extremum */ - /* lies, then inspect its previous and next points */ - if ( best_point >= 0 ) - { - FT_Pos best_x = points[best_point].x; - FT_Int prev, next; - FT_Int best_segment_first, best_segment_last; - FT_Int best_on_point_first, best_on_point_last; - FT_Pos dist; - - - best_segment_first = best_point; - best_segment_last = best_point; - if ( FT_CURVE_TAG( outline.tags[best_point] ) == FT_CURVE_TAG_ON ) - { - best_on_point_first = best_point; - best_on_point_last = best_point; - } - else + /* now check whether the point belongs to a straight or round */ + /* segment; we first need to find in which contour the extremum */ + /* lies, then inspect its previous and next points */ + if ( best_point >= 0 ) { - best_on_point_first = -1; - best_on_point_last = -1; - } + FT_Pos best_x = points[best_point].x; + FT_Int prev, next; + FT_Int best_segment_first, best_segment_last; + FT_Int best_on_point_first, best_on_point_last; + FT_Pos dist; - /* look for the previous and next points on the contour */ - /* that are not on the same Y coordinate, then threshold */ - /* the `closeness'... */ - prev = best_point; - next = prev; - do - { - if ( prev > best_contour_first ) - prev--; - else - prev = best_contour_last; + best_segment_first = best_point; + best_segment_last = best_point; - dist = FT_ABS( points[prev].y - best_y ); - /* accept a small distance or a small angle (both values are */ - /* heuristic; value 20 corresponds to approx. 2.9 degrees) */ - if ( dist > 5 ) - if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist ) - break; + if ( FT_CURVE_TAG( outline.tags[best_point] ) == FT_CURVE_TAG_ON ) + { + best_on_point_first = best_point; + best_on_point_last = best_point; + } + else + { + best_on_point_first = -1; + best_on_point_last = -1; + } - best_segment_first = prev; + /* look for the previous and next points on the contour */ + /* that are not on the same Y coordinate, then threshold */ + /* the `closeness'... */ + prev = best_point; + next = prev; - if ( FT_CURVE_TAG( outline.tags[prev] ) == FT_CURVE_TAG_ON ) + do { - best_on_point_first = prev; - if ( best_on_point_last < 0 ) - best_on_point_last = prev; - } + if ( prev > best_contour_first ) + prev--; + else + prev = best_contour_last; - } while ( prev != best_point ); + dist = FT_ABS( points[prev].y - best_y ); + /* accept a small distance or a small angle (both values are */ + /* heuristic; value 20 corresponds to approx. 2.9 degrees) */ + if ( dist > 5 ) + if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist ) + break; - do - { - if ( next < best_contour_last ) - next++; - else - next = best_contour_first; + best_segment_first = prev; - dist = FT_ABS( points[next].y - best_y ); - if ( dist > 5 ) - if ( FT_ABS( points[next].x - best_x ) <= 20 * dist ) - break; + if ( FT_CURVE_TAG( outline.tags[prev] ) == FT_CURVE_TAG_ON ) + { + best_on_point_first = prev; + if ( best_on_point_last < 0 ) + best_on_point_last = prev; + } - best_segment_last = next; + } while ( prev != best_point ); - if ( FT_CURVE_TAG( outline.tags[next] ) == FT_CURVE_TAG_ON ) + do { - best_on_point_last = next; - if ( best_on_point_first < 0 ) - best_on_point_first = next; - } + if ( next < best_contour_last ) + next++; + else + next = best_contour_first; - } while ( next != best_point ); + dist = FT_ABS( points[next].y - best_y ); + if ( dist > 5 ) + if ( FT_ABS( points[next].x - best_x ) <= 20 * dist ) + break; - if ( AF_LATIN_IS_LONG_BLUE( bs ) ) - { - /* If this flag is set, we have an additional constraint to */ - /* get the blue zone distance: Find a segment of the topmost */ - /* (or bottommost) contour that is longer than a heuristic */ - /* threshold. This ensures that small bumps in the outline */ - /* are ignored (for example, the `vertical serifs' found in */ - /* many Hebrew glyph designs). */ - - /* If this segment is long enough, we are done. Otherwise, */ - /* search the segment next to the extremum that is long */ - /* enough, has the same direction, and a not too large */ - /* vertical distance from the extremum. Note that the */ - /* algorithm doesn't check whether the found segment is */ - /* actually the one (vertically) nearest to the extremum. */ - - /* heuristic threshold value */ - FT_Pos length_threshold = metrics->units_per_em / 25; - - - dist = FT_ABS( points[best_segment_last].x - - points[best_segment_first].x ); - - if ( dist < length_threshold && - best_segment_last - best_segment_first + 2 <= - best_contour_last - best_contour_first ) + best_segment_last = next; + + if ( FT_CURVE_TAG( outline.tags[next] ) == FT_CURVE_TAG_ON ) + { + best_on_point_last = next; + if ( best_on_point_first < 0 ) + best_on_point_first = next; + } + + } while ( next != best_point ); + + if ( AF_LATIN_IS_LONG_BLUE( bs ) ) { + /* If this flag is set, we have an additional constraint to */ + /* get the blue zone distance: Find a segment of the topmost */ + /* (or bottommost) contour that is longer than a heuristic */ + /* threshold. This ensures that small bumps in the outline */ + /* are ignored (for example, the `vertical serifs' found in */ + /* many Hebrew glyph designs). */ + + /* If this segment is long enough, we are done. Otherwise, */ + /* search the segment next to the extremum that is long */ + /* enough, has the same direction, and a not too large */ + /* vertical distance from the extremum. Note that the */ + /* algorithm doesn't check whether the found segment is */ + /* actually the one (vertically) nearest to the extremum. */ + /* heuristic threshold value */ - FT_Pos height_threshold = metrics->units_per_em / 4; + FT_Pos length_threshold = metrics->units_per_em / 25; - FT_Int first; - FT_Int last; - FT_Bool hit; - /* we intentionally declare these two variables */ - /* outside of the loop since various compilers emit */ - /* incorrect warning messages otherwise, talking about */ - /* `possibly uninitialized variables' */ - FT_Int p_first = 0; /* make compiler happy */ - FT_Int p_last = 0; + dist = FT_ABS( points[best_segment_last].x - + points[best_segment_first].x ); - FT_Bool left2right; + if ( dist < length_threshold && + best_segment_last - best_segment_first + 2 <= + best_contour_last - best_contour_first ) + { + /* heuristic threshold value */ + FT_Pos height_threshold = metrics->units_per_em / 4; + FT_Int first; + FT_Int last; + FT_Bool hit; - /* compute direction */ - prev = best_point; + /* we intentionally declare these two variables */ + /* outside of the loop since various compilers emit */ + /* incorrect warning messages otherwise, talking about */ + /* `possibly uninitialized variables' */ + FT_Int p_first = 0; /* make compiler happy */ + FT_Int p_last = 0; - do - { - if ( prev > best_contour_first ) - prev--; - else - prev = best_contour_last; + FT_Bool left2right; - if ( points[prev].x != best_x ) - break; - } while ( prev != best_point ); + /* compute direction */ + prev = best_point; - /* skip glyph for the degenerate case */ - if ( prev == best_point ) - continue; + do + { + if ( prev > best_contour_first ) + prev--; + else + prev = best_contour_last; - left2right = FT_BOOL( points[prev].x < points[best_point].x ); + if ( points[prev].x != best_x ) + break; - first = best_segment_last; - last = first; - hit = 0; + } while ( prev != best_point ); - do - { - FT_Bool l2r; - FT_Pos d; + /* skip glyph for the degenerate case */ + if ( prev == best_point ) + continue; + left2right = FT_BOOL( points[prev].x < points[best_point].x ); - if ( !hit ) + first = best_segment_last; + last = first; + hit = 0; + + do { - /* no hit; adjust first point */ - first = last; + FT_Bool l2r; + FT_Pos d; - /* also adjust first and last on point */ - if ( FT_CURVE_TAG( outline.tags[first] ) == - FT_CURVE_TAG_ON ) - { - p_first = first; - p_last = first; - } - else + + if ( !hit ) { - p_first = -1; - p_last = -1; - } + /* no hit; adjust first point */ + first = last; - hit = 1; - } + /* also adjust first and last on point */ + if ( FT_CURVE_TAG( outline.tags[first] ) == + FT_CURVE_TAG_ON ) + { + p_first = first; + p_last = first; + } + else + { + p_first = -1; + p_last = -1; + } - if ( last < best_contour_last ) - last++; - else - last = best_contour_first; + hit = 1; + } - if ( FT_ABS( best_y - points[first].y ) > height_threshold ) - { - /* vertical distance too large */ - hit = 0; - continue; - } + if ( last < best_contour_last ) + last++; + else + last = best_contour_first; - /* same test as above */ - dist = FT_ABS( points[last].y - points[first].y ); - if ( dist > 5 ) - if ( FT_ABS( points[last].x - points[first].x ) <= - 20 * dist ) + if ( FT_ABS( best_y - points[first].y ) > height_threshold ) { + /* vertical distance too large */ hit = 0; continue; } - if ( FT_CURVE_TAG( outline.tags[last] ) == FT_CURVE_TAG_ON ) - { - p_last = last; - if ( p_first < 0 ) - p_first = last; - } + /* same test as above */ + dist = FT_ABS( points[last].y - points[first].y ); + if ( dist > 5 ) + if ( FT_ABS( points[last].x - points[first].x ) <= + 20 * dist ) + { + hit = 0; + continue; + } - l2r = FT_BOOL( points[first].x < points[last].x ); - d = FT_ABS( points[last].x - points[first].x ); + if ( FT_CURVE_TAG( outline.tags[last] ) == FT_CURVE_TAG_ON ) + { + p_last = last; + if ( p_first < 0 ) + p_first = last; + } - if ( l2r == left2right && - d >= length_threshold ) - { - /* all constraints are met; update segment after finding */ - /* its end */ - do + l2r = FT_BOOL( points[first].x < points[last].x ); + d = FT_ABS( points[last].x - points[first].x ); + + if ( l2r == left2right && + d >= length_threshold ) { - if ( last < best_contour_last ) - last++; - else - last = best_contour_first; + /* all constraints are met; update segment after */ + /* finding its end */ + do + { + if ( last < best_contour_last ) + last++; + else + last = best_contour_first; + + d = FT_ABS( points[last].y - points[first].y ); + if ( d > 5 ) + if ( FT_ABS( points[next].x - points[first].x ) <= + 20 * dist ) + { + if ( last > best_contour_first ) + last--; + else + last = best_contour_last; + break; + } - d = FT_ABS( points[last].y - points[first].y ); - if ( d > 5 ) - if ( FT_ABS( points[next].x - points[first].x ) <= - 20 * dist ) + p_last = last; + + if ( FT_CURVE_TAG( outline.tags[last] ) == + FT_CURVE_TAG_ON ) { - if ( last > best_contour_first ) - last--; - else - last = best_contour_last; - break; + p_last = last; + if ( p_first < 0 ) + p_first = last; } - p_last = last; + } while ( last != best_segment_first ); - if ( FT_CURVE_TAG( outline.tags[last] ) == - FT_CURVE_TAG_ON ) - { - p_last = last; - if ( p_first < 0 ) - p_first = last; - } + best_y = points[first].y; - } while ( last != best_segment_first ); + best_segment_first = first; + best_segment_last = last; - best_y = points[first].y; + best_on_point_first = p_first; + best_on_point_last = p_last; - best_segment_first = first; - best_segment_last = last; + break; + } - best_on_point_first = p_first; - best_on_point_last = p_last; + } while ( last != best_segment_first ); + } + } - break; - } + /* for computing blue zones, we add the y offset as returned */ + /* by the currently used OpenType feature -- for example, */ + /* superscript glyphs might be identical to subscript glyphs */ + /* with a vertical shift */ + best_y += y_offset; + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( num_idx == 1 ) + FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y )); + else + FT_TRACE5(( " component %d of cluster starting with U+%04lX:" + " best_y = %5ld", i, ch, best_y )); +#endif + + /* now set the `round' flag depending on the segment's kind: */ + /* */ + /* - if the horizontal distance between the first and last */ + /* `on' point is larger than a heuristic threshold */ + /* we have a flat segment */ + /* - if either the first or the last point of the segment is */ + /* an `off' point, the segment is round, otherwise it is */ + /* flat */ + if ( best_on_point_first >= 0 && + best_on_point_last >= 0 && + ( FT_ABS( points[best_on_point_last].x - + points[best_on_point_first].x ) ) > + flat_threshold ) + round = 0; + else + round = FT_BOOL( + FT_CURVE_TAG( outline.tags[best_segment_first] ) != + FT_CURVE_TAG_ON || + FT_CURVE_TAG( outline.tags[best_segment_last] ) != + FT_CURVE_TAG_ON ); - } while ( last != best_segment_first ); + if ( round && AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) + { + /* only use flat segments for a neutral blue zone */ + FT_TRACE5(( " (round, skipped)\n" )); + continue; } + + FT_TRACE5(( " (%s)\n", round ? "round" : "flat" )); } - /* for computing blue zones, we add the y offset as returned */ - /* by the currently used OpenType feature -- for example, */ - /* superscript glyphs might be identical to subscript glyphs */ - /* with a vertical shift */ - best_y += y_offset; - - FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y )); - - /* now set the `round' flag depending on the segment's kind: */ - /* */ - /* - if the horizontal distance between the first and last */ - /* `on' point is larger than a heuristic threshold */ - /* we have a flat segment */ - /* - if either the first or the last point of the segment is */ - /* an `off' point, the segment is round, otherwise it is */ - /* flat */ - if ( best_on_point_first >= 0 && - best_on_point_last >= 0 && - ( FT_ABS( points[best_on_point_last].x - - points[best_on_point_first].x ) ) > - flat_threshold ) - round = 0; + if ( AF_LATIN_IS_TOP_BLUE( bs ) ) + { + if ( best_y > best_y_extremum ) + { + best_y_extremum = best_y; + best_round = round; + } + } else - round = FT_BOOL( - FT_CURVE_TAG( outline.tags[best_segment_first] ) != - FT_CURVE_TAG_ON || - FT_CURVE_TAG( outline.tags[best_segment_last] ) != - FT_CURVE_TAG_ON ); - - if ( round && AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) { - /* only use flat segments for a neutral blue zone */ - FT_TRACE5(( " (round, skipped)\n" )); - continue; + if ( best_y < best_y_extremum ) + { + best_y_extremum = best_y; + best_round = round; + } } - FT_TRACE5(( " (%s)\n", round ? "round" : "flat" )); + } /* end for loop */ + + if ( !( best_y_extremum == FT_INT_MIN || + best_y_extremum == FT_INT_MAX ) ) + { + if ( best_round ) + rounds[num_rounds++] = best_y_extremum; + else + flats[num_flats++] = best_y_extremum; } - if ( round ) - rounds[num_rounds++] = best_y; - else - flats[num_flats++] = best_y; - } + } /* end while loop */ if ( num_flats == 0 && num_rounds == 0 ) { @@ -795,7 +890,8 @@ FT_Bool over_ref = FT_BOOL( shoot > ref ); - if ( AF_LATIN_IS_TOP_BLUE( bs ) ^ over_ref ) + if ( ( AF_LATIN_IS_TOP_BLUE( bs ) || + AF_LATIN_IS_SUB_TOP_BLUE( bs) ) ^ over_ref ) { *blue_ref = *blue_shoot = ( shoot + ref ) / 2; @@ -811,6 +907,8 @@ blue->flags = 0; if ( AF_LATIN_IS_TOP_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_TOP; + if ( AF_LATIN_IS_SUB_TOP_BLUE( bs ) ) + blue->flags |= AF_LATIN_BLUE_SUB_TOP; if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_NEUTRAL; @@ -825,7 +923,10 @@ FT_TRACE5(( " -> reference = %ld\n" " overshoot = %ld\n", *blue_ref, *blue_shoot )); - } + + } /* end for loop */ + + af_shaper_buf_destroy( face, shaper_buf ); FT_TRACE5(( "\n" )); @@ -839,27 +940,36 @@ af_latin_metrics_check_digits( AF_LatinMetrics metrics, FT_Face face ) { - FT_UInt i; FT_Bool started = 0, same_width = 1; FT_Fixed advance, old_advance = 0; + void* shaper_buf; + + /* in all supported charmaps, digits have character codes 0x30-0x39 */ + const char digits[] = "0 1 2 3 4 5 6 7 8 9"; + const char* p; + + + p = digits; + shaper_buf = af_shaper_buf_create( face ); - /* digit `0' is 0x30 in all supported charmaps */ - for ( i = 0x30; i <= 0x39; i++ ) + while ( *p ) { - FT_ULong glyph_index; - FT_Long y_offset; + FT_ULong glyph_index; + unsigned int num_idx; - af_get_char_index( &metrics->root, i, &glyph_index, &y_offset ); - if ( glyph_index == 0 ) + /* reject input that maps to more than a single glyph */ + p = af_shaper_get_cluster( p, &metrics->root, shaper_buf, &num_idx ); + if ( num_idx > 1 ) continue; - if ( FT_Get_Advance( face, glyph_index, - FT_LOAD_NO_SCALE | - FT_LOAD_NO_HINTING | - FT_LOAD_IGNORE_TRANSFORM, - &advance ) ) + glyph_index = af_shaper_get_elem( &metrics->root, + shaper_buf, + 0, + &advance, + NULL ); + if ( !glyph_index ) continue; if ( started ) @@ -877,6 +987,8 @@ } } + af_shaper_buf_destroy( face, shaper_buf ); + metrics->root.digits_have_same_width = same_width; } @@ -1166,21 +1278,63 @@ #endif blue->flags |= AF_LATIN_BLUE_ACTIVE; + } + } + + /* use sub-top blue zone only if it doesn't overlap with */ + /* another (non-sup-top) blue zone; otherwise, the */ + /* effect would be similar to a neutral blue zone, which */ + /* is not desired here */ + for ( nn = 0; nn < axis->blue_count; nn++ ) + { + AF_LatinBlue blue = &axis->blues[nn]; + FT_UInt i; + + + if ( !( blue->flags & AF_LATIN_BLUE_SUB_TOP ) ) + continue; + if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) ) + continue; + + for ( i = 0; i < axis->blue_count; i++ ) + { + AF_LatinBlue b = &axis->blues[i]; + - FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" - " overshoot %d: %d scaled to %.2f%s\n", - nn, - blue->ref.org, - blue->ref.fit / 64.0, - blue->flags & AF_LATIN_BLUE_ACTIVE ? "" - : " (inactive)", - nn, - blue->shoot.org, - blue->shoot.fit / 64.0, - blue->flags & AF_LATIN_BLUE_ACTIVE ? "" - : " (inactive)" )); + if ( b->flags & AF_LATIN_BLUE_SUB_TOP ) + continue; + if ( !( b->flags & AF_LATIN_BLUE_ACTIVE ) ) + continue; + + if ( b->ref.fit <= blue->shoot.fit && + b->shoot.fit >= blue->ref.fit ) + { + blue->flags &= ~AF_LATIN_BLUE_ACTIVE; + break; + } } } + +#ifdef FT_DEBUG_LEVEL_TRACE + for ( nn = 0; nn < axis->blue_count; nn++ ) + { + AF_LatinBlue blue = &axis->blues[nn]; + + + FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" + " overshoot %d: %d scaled to %.2f%s\n", + nn, + blue->ref.org, + blue->ref.fit / 64.0, + blue->flags & AF_LATIN_BLUE_ACTIVE ? "" + : " (inactive)", + nn, + blue->shoot.org, + blue->shoot.fit / 64.0, + blue->flags & AF_LATIN_BLUE_ACTIVE ? "" + : " (inactive)" )); + } +#endif } } @@ -1619,6 +1773,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; @@ -1641,6 +1801,9 @@ : 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 @@ -1718,6 +1881,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; @@ -1973,7 +2137,8 @@ /* the major direction) -- this assumes the TrueType convention */ /* for the orientation of contours */ is_top_blue = - (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 ); + (FT_Byte)( ( blue->flags & ( AF_LATIN_BLUE_TOP | + AF_LATIN_BLUE_SUB_TOP ) ) != 0 ); is_neutral_blue = (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_NEUTRAL ) != 0); is_major_dir = @@ -2403,8 +2568,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 @@ -2412,6 +2583,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 */ @@ -2707,7 +2881,9 @@ 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 ) ) ) { #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", @@ -2868,7 +3044,9 @@ #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 ) ) ) { #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", @@ -2879,9 +3057,10 @@ 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 ) ) ) { #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h index dd75ef34172..fe6bbd801a8 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin.h +++ b/Build/source/libs/freetype2/freetype-src/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" @@ -53,6 +53,8 @@ FT_BEGIN_HEADER #define AF_LATIN_IS_TOP_BLUE( b ) \ ( (b)->properties & AF_BLUE_PROPERTY_LATIN_TOP ) +#define AF_LATIN_IS_SUB_TOP_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_SUB_TOP ) #define AF_LATIN_IS_NEUTRAL_BLUE( b ) \ ( (b)->properties & AF_BLUE_PROPERTY_LATIN_NEUTRAL ) #define AF_LATIN_IS_X_HEIGHT_BLUE( b ) \ @@ -65,8 +67,10 @@ FT_BEGIN_HEADER #define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */ #define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */ -#define AF_LATIN_BLUE_NEUTRAL ( 1U << 2 ) /* we have neutral blue zone */ -#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 3 ) /* used for scale adjustment */ +#define AF_LATIN_BLUE_SUB_TOP ( 1U << 2 ) /* we have a subscript top */ + /* blue zone */ +#define AF_LATIN_BLUE_NEUTRAL ( 1U << 3 ) /* we have neutral blue zone */ +#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 4 ) /* used for scale adjustment */ /* optimization */ @@ -184,7 +188,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFLATIN_H__ */ +#endif /* AFLATIN_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c index 2fb7d1d3588..1fab85e8d0f 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.c +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.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, */ @@ -1195,7 +1195,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/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h index 9326753130c..c17a6a2a34e 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.h +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/aflatin2.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 __AFLATIN2_H__ -#define __AFLATIN2_H__ +#ifndef AFLATIN2_H_ +#define AFLATIN2_H_ #include "afhints.h" @@ -35,7 +35,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __AFLATIN_H__ */ +#endif /* AFLATIN_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c index aa5b8fdcbc4..26bba065bb5 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.c +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h index 4c4affcd2ce..0062eb9b079 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afloader.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c index 45fd3602c8d..4127382c003 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h index 3c61d895674..e65db5f5cb0 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afmodule.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c index 5589e612cfe..3cbd9168e3f 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.c +++ b/Build/source/libs/freetype2/freetype-src/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, sc1, sc2, sc3 ) \ +#define SCRIPT( s, S, d, h, H, sss ) \ FT_Init_Class_af_ ## s ## _script_class( \ &container->af_script_classes_rec[ss++] ); diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h index 9b45069f5d0..98a45a26ba5 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afpic.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c index 13c221364cf..4e81e782856 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -91,6 +91,23 @@ }; + const AF_Script_UniRangeRec af_beng_uniranges[] = + { + AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_beng_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 ) + }; + + const AF_Script_UniRangeRec af_cyrl_uniranges[] = { AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ @@ -179,6 +196,52 @@ }; + const AF_Script_UniRangeRec af_knda_uniranges[] = + { + AF_UNIRANGE_REC( 0x0C80UL, 0x0CFFUL ), /* Kannada */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_knda_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 ) + }; + + + const AF_Script_UniRangeRec af_khmr_uniranges[] = + { + AF_UNIRANGE_REC( 0x1780UL, 0x17FFUL ), /* Khmer */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_khmr_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 ) + }; + + + const AF_Script_UniRangeRec af_khms_uniranges[] = + { + AF_UNIRANGE_REC( 0x19E0UL, 0x19FFUL ), /* Khmer Symbols */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_khms_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_lao_uniranges[] = { AF_UNIRANGE_REC( 0x0E80UL, 0x0EFFUL ), /* Lao */ @@ -253,7 +316,7 @@ }; - const AF_Script_UniRangeRec af_latb_uniranges[] = + const AF_Script_UniRangeRec af_latb_uniranges[] = { AF_UNIRANGE_REC( 0x1D62UL, 0x1D6AUL ), /* some small subscript letters */ AF_UNIRANGE_REC( 0x2080UL, 0x209CUL ), /* subscript digits and letters */ @@ -261,13 +324,13 @@ AF_UNIRANGE_REC( 0UL, 0UL ) }; - const AF_Script_UniRangeRec af_latb_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_latb_nonbase_uniranges[] = { AF_UNIRANGE_REC( 0UL, 0UL ) }; - const AF_Script_UniRangeRec af_latp_uniranges[] = + const AF_Script_UniRangeRec af_latp_uniranges[] = { AF_UNIRANGE_REC( 0x00AAUL, 0x00AAUL ), /* feminine ordinal indicator */ AF_UNIRANGE_REC( 0x00B2UL, 0x00B3UL ), /* superscript two and three */ @@ -285,12 +348,38 @@ AF_UNIRANGE_REC( 0UL, 0UL ) }; - const AF_Script_UniRangeRec af_latp_nonbase_uniranges[] = + const AF_Script_UniRangeRec af_latp_nonbase_uniranges[] = { AF_UNIRANGE_REC( 0UL, 0UL ) }; + const AF_Script_UniRangeRec af_mymr_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 ) + }; + + const AF_Script_UniRangeRec af_mymr_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 ) + }; + + const AF_Script_UniRangeRec af_none_uniranges[] = { AF_UNIRANGE_REC( 0UL, 0UL ) @@ -335,23 +424,6 @@ #ifdef AF_CONFIG_OPTION_INDIC - const AF_Script_UniRangeRec af_beng_uniranges[] = - { - AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - const AF_Script_UniRangeRec af_beng_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 ) - }; - - const AF_Script_UniRangeRec af_gujr_uniranges[] = { AF_UNIRANGE_REC( 0x0A80UL, 0x0AFFUL ), /* Gujarati */ @@ -386,24 +458,6 @@ }; - const AF_Script_UniRangeRec af_knda_uniranges[] = - { - AF_UNIRANGE_REC( 0x0C80UL, 0x0CFFUL ), /* Kannada */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - const AF_Script_UniRangeRec af_knda_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 ) - }; - - const AF_Script_UniRangeRec af_limb_uniranges[] = { AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h index b080873e77a..1a0e4b15359 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afranges.h +++ b/Build/source/libs/freetype2/freetype-src/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, sc1, sc2, sc3 ) \ +#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, sc1, sc2, sc3 ) \ +#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/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h index b92e84f5ff0..9bbb6f3b4f5 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afscript.h +++ b/Build/source/libs/freetype2/freetype-src/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,126 +33,170 @@ SCRIPT( arab, ARAB, "Arabic", HB_SCRIPT_ARABIC, - 0x644, 0x62D, 0x640 ) /* ل ح ـ */ + HINTING_BOTTOM_TO_TOP, + "\xD9\x84 \xD8\xAD \xD9\x80" ) /* ل ح ـ */ + + /* 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( cyrl, CYRL, "Cyrillic", HB_SCRIPT_CYRILLIC, - 0x43E, 0x41E, 0x0 ) /* о О */ + HINTING_BOTTOM_TO_TOP, + "\xD0\xBE \xD0\x9E" ) /* о О */ SCRIPT( deva, DEVA, "Devanagari", HB_SCRIPT_DEVANAGARI, - 0x920, 0x935, 0x91F ) /* ठ व ट */ + HINTING_TOP_TO_BOTTOM, + "\xE0\xA4\xA0 \xE0\xA4\xB5 \xE0\xA4\x9F" ) /* ठ व ट */ SCRIPT( grek, GREK, "Greek", HB_SCRIPT_GREEK, - 0x3BF, 0x39F, 0x0 ) /* ο Ο */ + HINTING_BOTTOM_TO_TOP, + "\xCE\xBF \xCE\x9F" ) /* ο Ο */ SCRIPT( hebr, HEBR, "Hebrew", HB_SCRIPT_HEBREW, - 0x5DD, 0x0, 0x0 ) /* ם */ + 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, - 0xED0, 0x0, 0x0 ) /* ໐ */ + HINTING_BOTTOM_TO_TOP, + "\xE0\xBB\x90" ) /* ໐ */ SCRIPT( latn, LATN, "Latin", HB_SCRIPT_LATIN, - 'o', 'O', '0' ) + HINTING_BOTTOM_TO_TOP, + "o O 0" ) SCRIPT( latb, LATB, "Latin Subscript Fallback", HB_SCRIPT_INVALID, - 0x2092, 0x2080, 0x0 ) /* ₒ ₀ */ + HINTING_BOTTOM_TO_TOP, + "\xE2\x82\x92 \xE2\x82\x80" ) /* ₒ ₀ */ SCRIPT( latp, LATP, "Latin Superscript Fallback", HB_SCRIPT_INVALID, - 0x1D52, 0x1D3C, 0x2070 ) /* ᵒ ᴼ ⁰ */ + HINTING_BOTTOM_TO_TOP, + "\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* ᵒ ᴼ ⁰ */ + + 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, - 0x0, 0x0, 0x0 ) + HINTING_BOTTOM_TO_TOP, + "" ) /* there are no simple forms for letters; we thus use two digit shapes */ SCRIPT( telu, TELU, "Telugu", HB_SCRIPT_TELUGU, - 0xC66, 0xC67, 0x0 ) /* ౦ ౧ */ + HINTING_BOTTOM_TO_TOP, + "\xE0\xB1\xA6 \xE0\xB1\xA7" ) /* ౦ ౧ */ SCRIPT( thai, THAI, "Thai", HB_SCRIPT_THAI, - 0xE32, 0xE45, 0xE50 ) /* า ๅ ๐ */ + 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', 0x0, 0x0 ) /* XXX */ - SCRIPT( gujr, GUJR, "Gujarati", HB_SCRIPT_GUJARATI, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( guru, GURU, "Gurmukhi", HB_SCRIPT_GURMUKHI, - 'o', 0x0, 0x0 ) /* XXX */ - - SCRIPT( knda, KNDA, - "Kannada", - HB_SCRIPT_KANNADA, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( limb, LIMB, "Limbu", HB_SCRIPT_LIMBU, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( mlym, MLYM, "Malayalam", HB_SCRIPT_MALAYALAM, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( orya, ORYA, "Oriya", HB_SCRIPT_ORIYA, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( sinh, SINH, "Sinhala", HB_SCRIPT_SINHALA, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( sund, SUND, "Sundanese", HB_SCRIPT_SUNDANESE, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( sylo, SYLO, "Syloti Nagri", HB_SCRIPT_SYLOTI_NAGRI, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( taml, TAML, "Tamil", HB_SCRIPT_TAMIL, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ SCRIPT( tibt, TIBT, "Tibetan", HB_SCRIPT_TIBETAN, - 'o', 0x0, 0x0 ) /* XXX */ + HINTING_BOTTOM_TO_TOP, + "o" ) /* XXX */ #endif /* AF_CONFIG_OPTION_INDIC */ @@ -161,7 +205,8 @@ SCRIPT( hani, HANI, "CJKV ideographs", HB_SCRIPT_HAN, - 0x7530, 0x56D7, 0x0 ) /* 田囗 */ + HINTING_BOTTOM_TO_TOP, + "\xE7\x94\xB0 \xE5\x9B\x97" ) /* 田 囗 */ #endif /* AF_CONFIG_OPTION_CJK */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/hbshim.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c index 7a45059c390..6d13b658590 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/hbshim.c +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.c @@ -1,10 +1,10 @@ /***************************************************************************/ /* */ -/* hbshim.c */ +/* afshaper.c */ /* */ /* 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, */ @@ -20,7 +20,7 @@ #include FT_FREETYPE_H #include "afglobal.h" #include "aftypes.h" -#include "hbshim.h" +#include "afshaper.h" #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ @@ -32,7 +32,7 @@ /* messages during execution. */ /* */ #undef FT_COMPONENT -#define FT_COMPONENT trace_afharfbuzz +#define FT_COMPONENT trace_afshaper /* @@ -86,7 +86,7 @@ /* load HarfBuzz script tags */ #undef SCRIPT -#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) h, +#define SCRIPT( s, S, d, h, H, ss ) h, static const hb_script_t scripts[] = @@ -96,9 +96,10 @@ FT_Error - af_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_UShort* gstyles ) + af_shaper_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + 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; } @@ -418,88 +423,150 @@ }; - FT_Error - af_get_char_index( AF_StyleMetrics metrics, - FT_ULong charcode, - FT_ULong *codepoint, - FT_Long *y_offset ) + void* + af_shaper_buf_create( FT_Face face ) { - AF_StyleClass style_class; + FT_UNUSED( face ); - const hb_feature_t* feature; + return (void*)hb_buffer_create(); + } - FT_ULong in_idx, out_idx; + void + af_shaper_buf_destroy( FT_Face face, + void* buf ) + { + FT_UNUSED( face ); - if ( !metrics ) - return FT_THROW( Invalid_Argument ); + hb_buffer_destroy( (hb_buffer_t*)buf ); + } - in_idx = FT_Get_Char_Index( metrics->globals->face, charcode ); + const char* + af_shaper_get_cluster( const char* p, + AF_StyleMetrics metrics, + void* buf_, + unsigned int* count ) + { + AF_StyleClass style_class; + const hb_feature_t* feature; + FT_Int upem; + const char* q; + int len; + + hb_buffer_t* buf = (hb_buffer_t*)buf_; + hb_font_t* font; + hb_codepoint_t dummy; + + + upem = (FT_Int)metrics->globals->face->units_per_EM; style_class = metrics->style_class; + feature = features[style_class->coverage]; - feature = features[style_class->coverage]; + font = metrics->globals->hb_font; - if ( feature ) - { - FT_Int upem = (FT_Int)metrics->globals->face->units_per_EM; + /* we shape at a size of units per EM; this means font units */ + hb_font_set_scale( font, upem, upem ); - hb_font_t* font = metrics->globals->hb_font; - hb_buffer_t* buf = hb_buffer_create(); + while ( *p == ' ' ) + p++; - uint32_t c = (uint32_t)charcode; + /* count bytes up to next space (or end of buffer) */ + q = p; + while ( !( *q == ' ' || *q == '\0' ) ) + GET_UTF8_CHAR( dummy, q ); + len = (int)( q - p ); - hb_glyph_info_t* ginfo; - hb_glyph_position_t* gpos; - unsigned int gcount; + /* feed character(s) to the HarfBuzz buffer */ + hb_buffer_clear_contents( buf ); + hb_buffer_add_utf8( buf, p, len, 0, len ); + /* we let HarfBuzz guess the script and writing direction */ + hb_buffer_guess_segment_properties( buf ); - /* we shape at a size of units per EM; this means font units */ - hb_font_set_scale( font, upem, upem ); + /* shape buffer, which means conversion from character codes to */ + /* glyph indices, possibly applying a feature */ + hb_shape( font, buf, feature, feature ? 1 : 0 ); - /* 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] ); + if ( feature ) + { + hb_buffer_t* hb_buf = metrics->globals->hb_buf; - /* we add one character to `buf' ... */ - hb_buffer_add_utf32( buf, &c, 1, 0, 1 ); + unsigned int gcount; + hb_glyph_info_t* ginfo; - /* ... and apply one feature */ - hb_shape( font, buf, feature, 1 ); + unsigned int hb_gcount; + hb_glyph_info_t* hb_ginfo; - ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); - gpos = hb_buffer_get_glyph_positions( buf, &gcount ); - out_idx = ginfo[0].codepoint; + /* we have to check whether applying a feature does actually change */ + /* glyph indices; otherwise the affected glyph or glyphs aren't */ + /* available at all in the feature */ - /* 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 + hb_buffer_clear_contents( hb_buf ); + hb_buffer_add_utf8( hb_buf, p, len, 0, len ); + hb_buffer_guess_segment_properties( hb_buf ); + hb_shape( font, hb_buf, NULL, 0 ); + + ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); + hb_ginfo = hb_buffer_get_glyph_infos( hb_buf, &hb_gcount ); + + if ( gcount == hb_gcount ) { - *codepoint = out_idx; - *y_offset = gpos[0].y_offset; + unsigned int i; + + + for (i = 0; i < gcount; i++ ) + if ( ginfo[i].codepoint != hb_ginfo[i].codepoint ) + break; + + if ( i == gcount ) + { + /* both buffers have identical glyph indices */ + hb_buffer_clear_contents( buf ); + } } + } - hb_buffer_destroy( buf ); + *count = hb_buffer_get_length( buf ); #ifdef FT_DEBUG_LEVEL_TRACE - if ( gcount > 1 ) - FT_TRACE1(( "af_get_char_index:" - " input character mapped to multiple glyphs\n" )); + if ( feature && *count > 1 ) + FT_TRACE1(( "af_shaper_get_cluster:" + " input character mapped to multiple glyphs\n" )); #endif - } - else - { - *codepoint = in_idx; - *y_offset = 0; - } - return FT_Err_Ok; + return q; + } + + + FT_ULong + af_shaper_get_elem( AF_StyleMetrics metrics, + void* buf_, + unsigned int idx, + FT_Long* advance, + FT_Long* y_offset ) + { + hb_buffer_t* buf = (hb_buffer_t*)buf_; + hb_glyph_info_t* ginfo; + hb_glyph_position_t* gpos; + unsigned int gcount; + + FT_UNUSED( metrics ); + + + ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); + gpos = hb_buffer_get_glyph_positions( buf, &gcount ); + + if ( idx >= gcount ) + return 0; + + if ( advance ) + *advance = gpos[idx].x_advance; + if ( y_offset ) + *y_offset = gpos[idx].y_offset; + + return ginfo[idx].codepoint; } @@ -507,36 +574,106 @@ FT_Error - af_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_UShort* gstyles ) + af_shaper_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + 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; } - FT_Error - af_get_char_index( AF_StyleMetrics metrics, - FT_ULong charcode, - FT_ULong *codepoint, - FT_Long *y_offset ) + void* + af_shaper_buf_create( FT_Face face ) { - FT_Face face; + FT_Error error; + FT_Memory memory = face->memory; + FT_ULong* buf; - if ( !metrics ) - return FT_THROW( Invalid_Argument ); + FT_MEM_ALLOC( buf, sizeof ( FT_ULong ) ); - face = metrics->globals->face; + return (void*)buf; + } - *codepoint = FT_Get_Char_Index( face, charcode ); - *y_offset = 0; - return FT_Err_Ok; + void + af_shaper_buf_destroy( FT_Face face, + void* buf ) + { + FT_Memory memory = face->memory; + + + FT_FREE( buf ); + } + + + const char* + af_shaper_get_cluster( const char* p, + AF_StyleMetrics metrics, + void* buf_, + unsigned int* count ) + { + FT_Face face = metrics->globals->face; + FT_ULong ch, dummy = 0; + FT_ULong* buf = (FT_ULong*)buf_; + + + while ( *p == ' ' ) + p++; + + GET_UTF8_CHAR( ch, p ); + + /* since we don't have an engine to handle clusters, */ + /* we scan the characters but return zero */ + while ( !( *p == ' ' || *p == '\0' ) ) + GET_UTF8_CHAR( dummy, p ); + + if ( dummy ) + { + *buf = 0; + *count = 0; + } + else + { + *buf = FT_Get_Char_Index( face, ch ); + *count = 1; + } + + return p; + } + + + FT_ULong + af_shaper_get_elem( AF_StyleMetrics metrics, + void* buf_, + unsigned int idx, + FT_Long* advance, + FT_Long* y_offset ) + { + FT_Face face = metrics->globals->face; + FT_ULong glyph_index = *(FT_ULong*)buf_; + + FT_UNUSED( idx ); + + + if ( advance ) + FT_Get_Advance( face, + glyph_index, + FT_LOAD_NO_SCALE | + FT_LOAD_NO_HINTING | + FT_LOAD_IGNORE_TRANSFORM, + advance ); + + if ( y_offset ) + *y_offset = 0; + + return glyph_index; } diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/hbshim.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h index 3824941ca2a..0d41f787626 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/hbshim.h +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/afshaper.h @@ -1,10 +1,10 @@ /***************************************************************************/ /* */ -/* hbshim.h */ +/* afshaper.h */ /* */ /* 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 __HBSHIM_H__ -#define __HBSHIM_H__ +#ifndef AFSHAPER_H_ +#define AFSHAPER_H_ #include <ft2build.h> @@ -36,21 +36,37 @@ FT_BEGIN_HEADER FT_Error - af_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_UShort* gstyles ); + af_shaper_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_UShort* gstyles, + FT_Bool default_script ); - FT_Error - af_get_char_index( AF_StyleMetrics metrics, - FT_ULong charcode, - FT_ULong *codepoint, - FT_Long *y_offset ); + + void* + af_shaper_buf_create( FT_Face face ); + + void + af_shaper_buf_destroy( FT_Face face, + void* buf ); + + const char* + af_shaper_get_cluster( const char* p, + AF_StyleMetrics metrics, + void* buf_, + unsigned int* count ); + + FT_ULong + af_shaper_get_elem( AF_StyleMetrics metrics, + void* buf_, + unsigned int idx, + FT_Long* x_advance, + FT_Long* y_offset ); /* */ FT_END_HEADER -#endif /* __HBSHIM_H__ */ +#endif /* AFSHAPER_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h index 87663c9ee7e..9c57258475e 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afstyles.h +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -90,6 +90,13 @@ AF_BLUE_STRINGSET_ARAB, 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 ) + META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" ) STYLE( deva_dflt, DEVA_DFLT, @@ -108,6 +115,27 @@ 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, + AF_SCRIPT_KHMR, + AF_BLUE_STRINGSET_KHMR, + AF_COVERAGE_DEFAULT ) + + STYLE( khms_dflt, KHMS_DFLT, + "Khmer Symbols default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_KHMS, + AF_BLUE_STRINGSET_KHMS, + AF_COVERAGE_DEFAULT ) + STYLE( lao_dflt, LAO_DFLT, "Lao default style", AF_WRITING_SYSTEM_LATIN, @@ -140,6 +168,13 @@ AF_COVERAGE_DEFAULT ) #endif + STYLE( mymr_dflt, MYMR_DFLT, + "Myanmar default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_MYMR, + AF_BLUE_STRINGSET_MYMR, + AF_COVERAGE_DEFAULT ) + STYLE( none_dflt, NONE_DFLT, "no style", AF_WRITING_SYSTEM_DUMMY, @@ -173,10 +208,8 @@ (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" ) diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h b/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h index cbe8bc23b1b..eae6e11783c 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/aftypes.h +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -29,8 +29,8 @@ *************************************************************************/ -#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, sc1, sc2, sc3 ) \ +#define SCRIPT( s, S, d, h, H, ss ) \ AF_SCRIPT_ ## S, /* The list of known scripts. */ @@ -343,9 +343,9 @@ extern void* _af_debug_hints; AF_Script_UniRange script_uni_ranges; AF_Script_UniRange script_uni_nonbase_ranges; - FT_UInt32 standard_char1; /* for default width and height */ - FT_UInt32 standard_char2; /* ditto */ - FT_UInt32 standard_char3; /* ditto */ + FT_Bool top_to_bottom_hinting; + + const char* standard_charstring; /* for default width and height */ } AF_ScriptClassRec; @@ -481,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 @@ -524,18 +528,16 @@ extern void* _af_debug_hints; script, \ ranges, \ nonbase_ranges, \ - std_char1, \ - std_char2, \ - std_char3 ) \ + top_to_bottom, \ + std_charstring ) \ FT_CALLBACK_TABLE_DEF \ const AF_ScriptClassRec script_class = \ { \ script, \ ranges, \ nonbase_ranges, \ - std_char1, \ - std_char2, \ - std_char3 \ + top_to_bottom, \ + std_charstring, \ }; @@ -601,18 +603,16 @@ extern void* _af_debug_hints; script_, \ ranges, \ nonbase_ranges, \ - std_char1, \ - std_char2, \ - std_char3 ) \ + top_to_bottom, \ + std_charstring ) \ FT_LOCAL_DEF( void ) \ FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \ { \ ac->script = script_; \ ac->script_uni_ranges = ranges; \ ac->script_uni_nonbase_ranges = nonbase_ranges; \ - ac->standard_char1 = std_char1; \ - ac->standard_char2 = std_char2; \ - ac->standard_char3 = std_char3; \ + ac->top_to_bottom_hinting = top_to_bottom; \ + ac->standard_charstring = std_charstring; \ } @@ -644,7 +644,7 @@ extern void* _af_debug_hints; FT_END_HEADER -#endif /* __AFTYPES_H__ */ +#endif /* AFTYPES_H_ */ /* END */ diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c b/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c index 59af4f02bda..ce1806c9d3c 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -193,7 +193,7 @@ warper->best_scale = org_scale; warper->best_delta = org_delta; - warper->best_score = INT_MIN; + warper->best_score = FT_INT_MIN; warper->best_distort = 0; axis = &hints->axis[dim]; diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h index 6069b6b277b..6d96f86d735 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afwarp.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h b/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h index 4aa89d2356a..842f4921a4e 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/afwrtsys.h +++ b/Build/source/libs/freetype2/freetype-src/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/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c b/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c index b6ed4a0ff1c..dda9aeb6d79 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/autofit.c +++ b/Build/source/libs/freetype2/freetype-src/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, */ @@ -34,7 +34,7 @@ #include "afcjk.c" #include "afindic.c" -#include "hbshim.c" +#include "afshaper.c" #include "afloader.c" #include "afmodule.c" diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk b/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk index 33214387f51..98f0612b996 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/module.mk @@ -3,7 +3,7 @@ # -# 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, modified, diff --git a/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk b/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk index 6ef959f1bae..1ef47046499 100644 --- a/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk +++ b/Build/source/libs/freetype2/freetype-src/src/autofit/rules.mk @@ -3,7 +3,7 @@ # -# 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, modified, @@ -40,8 +40,8 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \ $(AUTOF_DIR)/afmodule.c \ $(AUTOF_DIR)/afpic.c \ $(AUTOF_DIR)/afranges.c \ - $(AUTOF_DIR)/afwarp.c \ - $(AUTOF_DIR)/hbshim.c + $(AUTOF_DIR)/afshaper.c \ + $(AUTOF_DIR)/afwarp.c # AUTOF driver headers # |