[HarfBuzz] harfbuzz: Branch 'master'

2017-10-02 Thread Behdad Esfahbod
 test/shaping/fonts/sha1sum/1735326da89f0818cd8c51a0600e9789812c0f94.ttf |binary
 test/shaping/tests/indic-syllable.tests |2 
++
 2 files changed, 2 insertions(+)

New commits:
commit 1633513996f902e95642fcaf9205dded55f509ff
Author: Behdad Esfahbod 
Date:   Mon Oct 2 20:28:56 2017 +0200

Add test for U+0A51

New Indic numbers are:

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%)
GUJARATI: 366355 out of 366457 tests passed. 102 failed (0.0278341%)
GURMUKHI: 60729 out of 60747 tests passed. 18 failed (0.0296311%)
KANNADA: 951201 out of 951913 tests passed. 712 failed (0.0747968%)
KHMER: 299071 out of 299124 tests passed. 53 failed (0.0177184%)
MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%)
TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)

Before 71c0a1429db7c7e7e32507be248c9457e1cbfc7d GURMUKHI used to be at 15,
because Uniscribe seems to allow this character standalone, but that looks
wrong.

diff --git 
a/test/shaping/fonts/sha1sum/1735326da89f0818cd8c51a0600e9789812c0f94.ttf 
b/test/shaping/fonts/sha1sum/1735326da89f0818cd8c51a0600e9789812c0f94.ttf
new file mode 100644
index ..b1e4cdbb
Binary files /dev/null and 
b/test/shaping/fonts/sha1sum/1735326da89f0818cd8c51a0600e9789812c0f94.ttf differ
diff --git a/test/shaping/tests/indic-syllable.tests 
b/test/shaping/tests/indic-syllable.tests
index 5b0ae90a..3b5d1ebe 100644
--- a/test/shaping/tests/indic-syllable.tests
+++ b/test/shaping/tests/indic-syllable.tests
@@ -3,3 +3,5 @@ 
fonts/sha1sum/3d0b77a2360aa6faa1385aaa510509ab70dfbeff.ttf::U+0CF1:[gid1=0+1129]
 
fonts/sha1sum/3d0b77a2360aa6faa1385aaa510509ab70dfbeff.ttf::U+0CF2:[gid2=0+1539]
 
fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf::U+0980,U+0981:[anjibeng=0+520|candrabindubeng=0+0]
 
fonts/sha1sum/85fe0be440c64ac77699e21c2f1bd933a919167e.ttf::U+0A15,U+0A51,U+0A47:[kaguru=0+1273|udaatguru=0@75,0+0|eematraguru=0@-40,0+0]
+fonts/sha1sum/1735326da89f0818cd8c51a0600e9789812c0f94.ttf::U+0A51:[uni25CC=0+1044|udaatguru=0+0]
+fonts/sha1sum/1735326da89f0818cd8c51a0600e9789812c0f94.ttf::U+25CC,U+0A51:[uni25CC=0+1044|udaatguru=0+0]
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz


[HarfBuzz] harfbuzz: Branch 'master'

2017-10-02 Thread Behdad Esfahbod
 src/hb-ot-layout-gsubgpos-private.hh|   59 
--
 test/shaping/fonts/sha1sum/a6c76d1bafde4a0b1026ebcc932d2e5c6fd02442.ttf |binary
 test/shaping/tests/ligature-id.tests|1 
 3 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 8b2c94c43fd335b944d5e5487265706b8e0f9041
Author: Behdad Esfahbod 
Date:   Mon Oct 2 20:02:45 2017 +0200

Tweak ligature component matching for ligature formation

If two marks want to ligate and they belong to different components of the
same ligature glyph, and said ligature glyph is to be ignored according to
mark-filtering rules, then allow.

Example Burmese senquence:

  U+1004,U+103A,U+1039,U+101B,U+103D,U+102D

Test font provided by Norbert Lindenberg.

Fixes https://github.com/behdad/harfbuzz/issues/545

diff --git a/src/hb-ot-layout-gsubgpos-private.hh 
b/src/hb-ot-layout-gsubgpos-private.hh
index 472628a3..f2ad9f1c 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -374,6 +374,13 @@ struct hb_apply_context_t :
 
 inline void reject (void) { num_items++; match_glyph_data--; }
 
+inline matcher_t::may_skip_t
+may_skip (const hb_apply_context_t *c,
+ const hb_glyph_info_t&info) const
+{
+  return matcher.may_skip (c, info);
+}
+
 inline bool next (void)
 {
   assert (num_items > 0);
@@ -736,11 +743,17 @@ static inline bool match_input (hb_apply_context_t *c,
* - Ligatures cannot be formed across glyphs attached to different 
components
*   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, 
and
*   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
-   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.o
-   *   There is an exception to this: If a ligature tries ligating with marks 
that
-   *   belong to it itself, go ahead, assuming that the font designer knows 
what
-   *   they are doing (otherwise it can break Indic stuff when a matra wants to
-   *   ligate with a conjunct...)
+   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
+   *   There are a couple of exceptions to this:
+   *
+   *   o If a ligature tries ligating with marks that belong to it itself, go 
ahead,
+   * assuming that the font designer knows what they are doing (otherwise 
it can
+   * break Indic stuff when a matra wants to ligate with a conjunct,
+   *
+   *   o If two marks want to ligate and they belong to different components 
of the
+   * same ligature glyph, and said ligature glyph is to be ignored 
according to
+   * mark-filtering rules, then allow.
+   * https://github.com/behdad/harfbuzz/issues/545
*/
 
   bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->cur());
@@ -761,13 +774,41 @@ static inline bool match_input (hb_apply_context_t *c,
 unsigned int this_lig_id = _hb_glyph_info_get_lig_id 
(&buffer->info[skippy_iter.idx]);
 unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp 
(&buffer->info[skippy_iter.idx]);
 
-if (first_lig_id && first_lig_comp) {
+if (first_lig_id && first_lig_comp)
+{
   /* If first component was attached to a previous ligature component,
* all subsequent components should be attached to the same ligature
-   * component, otherwise we shouldn't ligate them. */
+   * component, otherwise we shouldn't ligate them... */
   if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
-   return_trace (false);
-} else {
+  {
+if (first_lig_id != this_lig_id && this_lig_id != 0)
+ return_trace (false);
+
+/* ...unless, we are attached to a base ligature and that base
+* ligature is ignorable. */
+   bool found = false;
+   const hb_glyph_info_t *out = buffer->out_info;
+   unsigned int j = buffer->out_len;
+   while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
+   {
+ if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
+ {
+   j--;
+   found = true;
+   break;
+ }
+ j--;
+   }
+
+   if (!found)
+ return_trace (false);
+
+   if (skippy_iter.may_skip (c, out[j]) != 
hb_apply_context_t::matcher_t::SKIP_YES)
+ return_trace (false);
+  }
+}
+else
+ {
   /* If first component was NOT attached to a previous ligature component,
* all subsequent components should also NOT be attached to any ligature
* component, unless they are attached to the first component itself! */
diff --git 
a/test/shaping/fonts/sha1sum/a6c76d1bafde4a0b1026ebcc932d2e5c6fd02442.ttf 
b/test/shaping/fonts/sha1sum/a6c76d1bafde4a0b1026ebcc932d2e5c6fd02442.ttf
new file mode 100644
index ..7930a96b
Binary files /dev/null and 
b/test/shaping/fonts/sha1sum/a6c76d1bafde4a0b1026ebcc932d2e5c6fd02442.t

[HarfBuzz] harfbuzz: Branch 'master'

2017-10-02 Thread Behdad Esfahbod
 src/hb-ot-shape-complex-indic.cc|6 
++
 test/shaping/fonts/sha1sum/85fe0be440c64ac77699e21c2f1bd933a919167e.ttf |binary
 test/shaping/tests/indic-syllable.tests |1 
+
 3 files changed, 7 insertions(+)

New commits:
commit 71c0a1429db7c7e7e32507be248c9457e1cbfc7d
Author: Behdad Esfahbod 
Date:   Mon Oct 2 18:56:10 2017 +0200

[indic] Fix shaping of U+0A51

Mark it as matra below to allow the sequence U+0A15, U+0A51, U+0A47.
Oh well...

Fixes https://github.com/behdad/harfbuzz/issues/524

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index c8640cc5..d1681601 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -208,6 +208,12 @@ set_indic_properties (hb_glyph_info_t &info)
 cat = OT_M;
 pos = POS_ABOVE_C;
   }
+  else if (unlikely (u == 0x0A51u))
+  {
+/* https://github.com/behdad/harfbuzz/issues/524 */
+cat = OT_M;
+pos = POS_BELOW_C;
+  }
 
   /* According to ScriptExtensions.txt, these Grantha marks may also be used 
in Tamil,
* so the Indic shaper needs to know their categories. */
diff --git 
a/test/shaping/fonts/sha1sum/85fe0be440c64ac77699e21c2f1bd933a919167e.ttf 
b/test/shaping/fonts/sha1sum/85fe0be440c64ac77699e21c2f1bd933a919167e.ttf
new file mode 100644
index ..6198614b
Binary files /dev/null and 
b/test/shaping/fonts/sha1sum/85fe0be440c64ac77699e21c2f1bd933a919167e.ttf differ
diff --git a/test/shaping/tests/indic-syllable.tests 
b/test/shaping/tests/indic-syllable.tests
index df3d7d82..5b0ae90a 100644
--- a/test/shaping/tests/indic-syllable.tests
+++ b/test/shaping/tests/indic-syllable.tests
@@ -2,3 +2,4 @@ 
fonts/sha1sum/54674a3111d209fb6be0ed31745314b7a8d2c244.ttf::U+0BA4,U+0BCD,U+00B3
 
fonts/sha1sum/3d0b77a2360aa6faa1385aaa510509ab70dfbeff.ttf::U+0CF1:[gid1=0+1129]
 
fonts/sha1sum/3d0b77a2360aa6faa1385aaa510509ab70dfbeff.ttf::U+0CF2:[gid2=0+1539]
 
fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf::U+0980,U+0981:[anjibeng=0+520|candrabindubeng=0+0]
+fonts/sha1sum/85fe0be440c64ac77699e21c2f1bd933a919167e.ttf::U+0A15,U+0A51,U+0A47:[kaguru=0+1273|udaatguru=0@75,0+0|eematraguru=0@-40,0+0]
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz


[HarfBuzz] harfbuzz: Branch 'master' - 4 commits

2017-10-02 Thread Behdad Esfahbod
 src/gen-use-table.py |3 +++
 src/hb-common.h  |   14 --
 src/hb-ot-shape-complex-private.hh   |   12 
 src/hb-ot-shape-complex-use-table.cc |2 +-
 src/hb-ucdn/README   |6 +++---
 src/hb-ucdn/ucdn.h   |   14 --
 6 files changed, 15 insertions(+), 36 deletions(-)

New commits:
commit cbec0cd65e1787b20ea55dd5583a7444938bd381
Author: Behdad Esfahbod 
Date:   Mon Oct 2 18:26:52 2017 +0200

Remove some really old cruft

diff --git a/src/hb-common.h b/src/hb-common.h
index 8614ee3f..614a63aa 100644
--- a/src/hb-common.h
+++ b/src/hb-common.h
@@ -43,30 +43,16 @@
 # endif /* !__cplusplus */
 #endif
 
-#if !defined (HB_DONT_DEFINE_STDINT)
-
 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
 defined (_sgi) || defined (__sun) || defined (sun) || \
 defined (__digital__) || defined (__HP_cc)
 #  include 
 #elif defined (_AIX)
 #  include 
-/* VS 2010 (_MSC_VER 1600) has stdint.h */
-#elif defined (_MSC_VER) && _MSC_VER < 1600
-typedef __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
 #else
 #  include 
 #endif
 
-#endif
-
 HB_BEGIN_DECLS
 
 
diff --git a/src/hb-ucdn/ucdn.h b/src/hb-ucdn/ucdn.h
index 71a1e4b3..2d5fc359 100644
--- a/src/hb-ucdn/ucdn.h
+++ b/src/hb-ucdn/ucdn.h
@@ -36,30 +36,16 @@
 
 HB_BEGIN_HEADER
 
-#if !defined (HB_DONT_DEFINE_STDINT)
-
 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
 defined (_sgi) || defined (__sun) || defined (sun) || \
 defined (__digital__) || defined (__HP_cc)
 #  include 
 #elif defined (_AIX)
 #  include 
-/* VS 2010 (_MSC_VER 1600) has stdint.h */
-#elif defined (_MSC_VER) && _MSC_VER < 1600
-typedef __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
 #else
 #  include 
 #endif
 
-#endif
-
 
 #define UCDN_EAST_ASIAN_F 0
 #define UCDN_EAST_ASIAN_H 1
commit b3dff7720c1fac8ca9bdd7087ac368a0af4349e8
Author: Behdad Esfahbod 
Date:   Mon Oct 2 18:22:51 2017 +0200

[ucdn] Update README

diff --git a/src/hb-ucdn/README b/src/hb-ucdn/README
index fcb97b9a..2203ae69 100644
--- a/src/hb-ucdn/README
+++ b/src/hb-ucdn/README
@@ -31,10 +31,10 @@ UCDN was written by Grigori Goronzy .
 
 How to Use
 
-Include ucdn.c, ucdn.h and unicodedata_db.h in your project. Now,
-just use the functions as documented in ucdn.h.
+Include ucdn.c, ucdn.h and ucdn_db.h in your project. Now, just use the
+functions as documented in ucdn.h.
 
 In some cases, it might be necessary to regenerate the Unicode
 database file. The script makeunicodedata.py (Python 3.x required)
 fetches the appropriate files and dumps the compressed database into
-unicodedata_db.h.
+ucdn_db.h.
commit 57c55ef8341c760145170dedd002c5afb380e6c8
Author: Behdad Esfahbod 
Date:   Mon Oct 2 18:21:27 2017 +0200

[ot] Improve shaper selection heuristic

diff --git a/src/hb-ot-shape-complex-private.hh 
b/src/hb-ot-shape-complex-private.hh
index 20ad6b2c..8fadd7cd 100644
--- a/src/hb-ot-shape-complex-private.hh
+++ b/src/hb-ot-shape-complex-private.hh
@@ -253,10 +253,12 @@ hb_ot_shape_complex_categorize (const 
hb_ot_shape_planner_t *planner)
 case HB_SCRIPT_SINHALA:
 
   /* If the designer designed the font for the 'DFLT' script,
-   * use the default shaper.  Otherwise, use the specific shaper.
+   * (or we ended up arbitrarily pick 'latn'), use the default shaper.
+   * Otherwise, use the specific shaper.
* Note that for some simple scripts, there may not be *any*
* GSUB/GPOS needed, so there may be no scripts found! */
-  if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
+  if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
+ planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
return &_hb_ot_complex_shaper_default;
   else
return &_hb_ot_complex_shaper_indic;
@@ -368,10 +370,12 @@ hb_ot_shape_complex_categorize (const 
hb_ot_shape_planner_t *planner)
 case HB_SCRIPT_ZANABAZAR_SQUARE:
 
   /* If the designer designed the font for the 'DFLT' script,
-   * use the default shaper.  Otherwise, use the specific shaper.
+   * (or we ended up arbitrarily pick 'latn'), use the default shaper.
+   * Otherwise, use the specific shaper.
* Note that for some simple scripts, there may not be *any*
* GSUB/GPOS needed, so there may be no scripts found! */
-  if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
+  if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
+ planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
retu

[HarfBuzz] harfbuzz: Branch 'master' - 4 commits

2017-10-02 Thread Behdad Esfahbod
 src/gen-use-table.py |8 ++--
 src/hb-common.h  |8 
 src/hb-ot-shape-complex-private.hh   |5 ++
 src/hb-ot-shape-complex-use-table.cc |   69 +--
 src/hb-ucdn.cc   |4 ++
 src/hb-ucdn/Makefile.sources |2 -
 src/hb-ucdn/ucdn.c   |   69 +--
 src/hb-ucdn/ucdn.h   |7 +++
 8 files changed, 115 insertions(+), 57 deletions(-)

New commits:
commit 0faa16a25349906ee0ab98b73d9a3d96327a0955
Author: Behdad Esfahbod 
Date:   Mon Oct 2 17:15:46 2017 +0200

[ucdn] Update to Unicode 10

Update to commit c000ebf79c095a7d58cf90090bde5715592c4834
plus this bug-fix: https://github.com/grigorig/ucdn/issues/18

diff --git a/src/hb-ucdn.cc b/src/hb-ucdn.cc
index a884e3ff..d8404b29 100644
--- a/src/hb-ucdn.cc
+++ b/src/hb-ucdn.cc
@@ -160,6 +160,10 @@ static const hb_script_t ucdn_script_translate[] =
 HB_SCRIPT_NEWA,
 HB_SCRIPT_OSAGE,
 HB_SCRIPT_TANGUT,
+HB_SCRIPT_MASARAM_GONDI,
+HB_SCRIPT_NUSHU,
+HB_SCRIPT_SOYOMBO,
+HB_SCRIPT_ZANABAZAR_SQUARE,
 };
 
 static hb_unicode_combining_class_t
diff --git a/src/hb-ucdn/Makefile.sources b/src/hb-ucdn/Makefile.sources
index 52778d46..cb823b60 100644
--- a/src/hb-ucdn/Makefile.sources
+++ b/src/hb-ucdn/Makefile.sources
@@ -3,5 +3,5 @@ NULL =
 LIBHB_UCDN_sources = \
ucdn.h \
ucdn.c \
-   unicodedata_db.h \
+   ucdn_db.h \
$(NULL)
diff --git a/src/hb-ucdn/ucdn.c b/src/hb-ucdn/ucdn.c
index f4e9be17..30747fea 100644
--- a/src/hb-ucdn/ucdn.c
+++ b/src/hb-ucdn/ucdn.c
@@ -23,7 +23,6 @@ typedef struct {
 unsigned char category;
 unsigned char combining;
 unsigned char bidi_class;
-unsigned char mirrored;
 unsigned char east_asian_width;
 unsigned char script;
 unsigned char linebreak_class;
@@ -43,7 +42,7 @@ typedef struct {
 short count, index;
 } Reindex;
 
-#include "unicodedata_db.h"
+#include "ucdn_db.h"
 
 /* constants required for Hangul (de)composition */
 #define SBASE 0xAC00
@@ -91,20 +90,30 @@ static const unsigned short *get_decomp_record(uint32_t 
code)
 return &decomp_data[index];
 }
 
-static int get_comp_index(uint32_t code, const Reindex *idx)
+static int compare_reindex(const void *a, const void *b)
 {
-int i;
-
-for (i = 0; idx[i].start; i++) {
-const Reindex *cur = &idx[i];
-if (code < cur->start)
-return -1;
-if (code <= cur->start + cur->count) {
-return cur->index + (code - cur->start);
-}
-}
+Reindex *ra = (Reindex *)a;
+Reindex *rb = (Reindex *)b;
 
-return -1;
+if (ra->start < rb->start)
+return -1;
+else if (ra->start > (rb->start + rb->count))
+return 1;
+else
+return 0;
+}
+
+static int get_comp_index(uint32_t code, const Reindex *idx, size_t len)
+{
+Reindex *res;
+Reindex r = {0, 0, 0};
+r.start = code;
+res = (Reindex *) bsearch(&r, idx, len, sizeof(Reindex), compare_reindex);
+
+if (res != NULL)
+return res->index + (code - res->start);
+else
+return -1;
 }
 
 static int compare_mp(const void *a, const void *b)
@@ -127,8 +136,8 @@ static BracketPair *search_bp(uint32_t code)
 BracketPair *res;
 
 bp.from = code;
-res = bsearch(&bp, bracket_pairs, BIDI_BRACKET_LEN, sizeof(BracketPair),
-compare_bp);
+res = (BracketPair *) bsearch(&bp, bracket_pairs, BIDI_BRACKET_LEN,
+ sizeof(BracketPair), compare_bp);
 return res;
 }
 
@@ -154,23 +163,18 @@ static int hangul_pair_decompose(uint32_t code, uint32_t 
*a, uint32_t *b)
 
 static int hangul_pair_compose(uint32_t *code, uint32_t a, uint32_t b)
 {
-if (b < VBASE || b >= (TBASE + TCOUNT))
-return 0;
-
-if ((a < LBASE || a >= (LBASE + LCOUNT))
-&& (a < SBASE || a >= (SBASE + SCOUNT)))
-return 0;
-
-if (a >= SBASE) {
+if (a >= SBASE && a < (SBASE + SCOUNT) && b >= TBASE && b < (TBASE + 
TCOUNT)) {
 /* LV,T */
 *code = a + (b - TBASE);
 return 3;
-} else {
+} else if (a >= LBASE && a < (LBASE + LCOUNT) && b >= VBASE && b < (VBASE 
+ VCOUNT)) {
 /* L,V */
 int li = a - LBASE;
 int vi = b - VBASE;
 *code = SBASE + li * NCOUNT + vi * TCOUNT;
 return 2;
+} else {
+return 0;
 }
 }
 
@@ -178,7 +182,7 @@ static uint32_t decode_utf16(const unsigned short 
**code_ptr)
 {
 const unsigned short *code = *code_ptr;
 
-if ((code[0] & 0xd800) != 0xd800) {
+if (code[0] < 0xd800 || code[0] > 0xdc00) {
 *code_ptr += 1;
 return (uint32_t)code[0];
 } else {
@@ -215,7 +219,7 @@ int ucdn_get_bidi_class(uint32_t code)
 
 int ucdn_get_mirrored(uint32_t code)
 {
-return get_ucd_record(code)->mirrored;
+return ucdn_mirror(code) != code;
 }
 
 int ucdn_get_script(uint32_t code)

[HarfBuzz] harfbuzz: Branch 'master'

2017-10-02 Thread Behdad Esfahbod
 src/hb-ot-shape-complex-indic-table.cc |   70 -
 1 file changed, 36 insertions(+), 34 deletions(-)

New commits:
commit bdbe974f525d33b8c735fb5d7fd76c236c4dd0ea
Author: Behdad Esfahbod 
Date:   Mon Oct 2 10:00:31 2017 -0400

[indic] Update table to Unicode 10

diff --git a/src/hb-ot-shape-complex-indic-table.cc 
b/src/hb-ot-shape-complex-indic-table.cc
index f0f4dc3b..bfd1c6d3 100644
--- a/src/hb-ot-shape-complex-indic-table.cc
+++ b/src/hb-ot-shape-complex-indic-table.cc
@@ -6,61 +6,62 @@
  *
  * on files with these headers:
  *
- * # IndicSyllabicCategory-9.0.0.txt
- * # Date: 2016-05-21, 02:46:00 GMT [RP]
- * # IndicPositionalCategory-9.0.0.txt
- * # Date: 2016-02-25, 00:48:00 GMT [RP]
- * # Blocks-9.0.0.txt
- * # Date: 2016-02-05, 23:48:00 GMT [KW]
+ * # IndicSyllabicCategory-10.0.0.txt
+ * # Date: 2017-05-31, 01:07:00 GMT [KW, RP]
+ * # IndicPositionalCategory-10.0.0.txt
+ * # Date: 2017-05-31, 01:07:00 GMT [RP]
+ * # Blocks-10.0.0.txt
+ * # Date: 2017-04-12, 17:30:00 GMT [KW]
  */
 
 #include "hb-ot-shape-complex-indic-private.hh"
 
 
 #define ISC_A  INDIC_SYLLABIC_CATEGORY_AVAGRAHA/*  15 chars; 
Avagraha */
-#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU   /*  67 chars; 
Bindu */
+#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU   /*  80 chars; 
Bindu */
 #define ISC_BJNINDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER   /*  20 
chars; Brahmi_Joining_Number */
-#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK   /*  53 chars; 
Cantillation_Mark */
-#define ISC_C  INDIC_SYLLABIC_CATEGORY_CONSONANT   /* 1907 chars; 
Consonant */
+#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK   /*  57 chars; 
Cantillation_Mark */
+#define ISC_C  INDIC_SYLLABIC_CATEGORY_CONSONANT   /* 2024 chars; 
Consonant */
 #define ISC_CD INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD  /*  10 chars; 
Consonant_Dead */
-#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /*  62 chars; 
Consonant_Final */
+#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /*  68 chars; 
Consonant_Final */
 #define ISC_CHLINDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER   /*   5 
chars; Consonant_Head_Letter */
 #define ISC_CK INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER/*   2 chars; 
Consonant_Killer */
-#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL/*  22 chars; 
Consonant_Medial */
-#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER   /*  16 chars; 
Consonant_Placeholder */
-#define ISC_CPRINDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA   
/*   1 chars; Consonant_Preceding_Repha */
-#define ISC_CPrf   INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED  /*   2 
chars; Consonant_Prefixed */
-#define ISC_CS INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED /*  90 chars; 
Consonant_Subjoined */
-#define ISC_CSRINDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA  
/*   4 chars; Consonant_Succeeding_Repha */
+#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL/*  27 chars; 
Consonant_Medial */
+#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER   /*  18 chars; 
Consonant_Placeholder */
+#define ISC_CPRINDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA   
/*   2 chars; Consonant_Preceding_Repha */
+#define ISC_CPrf   INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED  /*   7 
chars; Consonant_Prefixed */
+#define ISC_CS INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED /*  95 chars; 
Consonant_Subjoined */
+#define ISC_CSRINDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA  
/*   5 chars; Consonant_Succeeding_Repha */
 #define ISC_CWSINDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER  /*   4 
chars; Consonant_With_Stacker */
-#define ISC_GM INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK /*   2 chars; 
Gemination_Mark */
-#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER   /*   7 chars; 
Invisible_Stacker */
+#define ISC_GM INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK /*   3 chars; 
Gemination_Mark */
+#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER   /*  10 chars; 
Invisible_Stacker */
 #define ISC_ZWJINDIC_SYLLABIC_CATEGORY_JOINER  /*   1 
chars; Joiner */
 #define ISC_ML INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER/*   1 chars; 
Modifying_Letter */
 #define ISC_ZWNJ   INDIC_SYLLABIC_CATEGORY_NON_JOINER  /*   1 
chars; Non_Joiner */
-#define ISC_N  INDIC_SYLLABIC_CATEGORY_NUKTA   /*  24 chars; 
Nukta */
-#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER  /* 459 chars; 
Number */
+#define ISC_N  INDIC_SYLLABIC_CATEGORY_NUKTA   /*  28 chars; 
Nukta */
+#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER  /* 469 chars; 
Number */
 #define ISC_NJ INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER   /*   1 chars; 
Number_Joiner */
 #define ISC_x  INDIC_SYLLABIC_CATEGORY_OTHER 

[HarfBuzz] harfbuzz: Branch 'master' - 3 commits

2017-10-02 Thread Behdad Esfahbod
 src/hb-ot-shape-complex-arabic-table.hh |   15 
++
 src/hb-ot-shape-complex-indic-table.cc  |7 

 src/hb-ot-shape-complex-indic.cc|5 
+++
 test/shaping/fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf |binary
 test/shaping/tests/indic-syllable.tests |1 
 5 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit cc79b666bc4a81a0342ed1e706dd7db109739dc5
Author: Behdad Esfahbod 
Date:   Mon Oct 2 09:19:15 2017 -0400

[indic] Add test for 1a0a356a0f2b2932581e4fd0437c01c058f4f6d1

https://github.com/behdad/harfbuzz/issues/538

diff --git 
a/test/shaping/fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf 
b/test/shaping/fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf
new file mode 100644
index ..89b62575
Binary files /dev/null and 
b/test/shaping/fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf differ
diff --git a/test/shaping/tests/indic-syllable.tests 
b/test/shaping/tests/indic-syllable.tests
index ecaad906..df3d7d82 100644
--- a/test/shaping/tests/indic-syllable.tests
+++ b/test/shaping/tests/indic-syllable.tests
@@ -1,3 +1,4 @@
 
fonts/sha1sum/54674a3111d209fb6be0ed31745314b7a8d2c244.ttf::U+0BA4,U+0BCD,U+00B3:[taprehalftamil=0+1509|uni00B3=2+674]
 
fonts/sha1sum/3d0b77a2360aa6faa1385aaa510509ab70dfbeff.ttf::U+0CF1:[gid1=0+1129]
 
fonts/sha1sum/3d0b77a2360aa6faa1385aaa510509ab70dfbeff.ttf::U+0CF2:[gid2=0+1539]
+fonts/sha1sum/87f85d17d26f1fe9ad28d7365101958edaefb967.ttf::U+0980,U+0981:[anjibeng=0+520|candrabindubeng=0+0]
commit 819cc360499a5f136325b5a1a18098ebc2aee081
Author: Behdad Esfahbod 
Date:   Mon Oct 2 09:03:16 2017 -0400

[indic] Move manual code out of generated table

diff --git a/src/hb-ot-shape-complex-indic-table.cc 
b/src/hb-ot-shape-complex-indic-table.cc
index 3bf5285e..f0f4dc3b 100644
--- a/src/hb-ot-shape-complex-indic-table.cc
+++ b/src/hb-ot-shape-complex-indic-table.cc
@@ -422,13 +422,6 @@ hb_indic_get_categories (hb_codepoint_t u)
   if (hb_in_range (u, 0xAA60u, 0xAA7Fu)) return 
indic_table[u - 0xAA60u + indic_offset_0xaa60u];
   break;
 
-case 0x11u:
-  // According to ScriptExtensions.txt, these Grantha marks may also be 
used in Tamil,
-  // so the Indic shaper needs to know their categories.
-  if (unlikely (u == 0x11303)) return _(Vs,R);
-  if (unlikely (u == 0x1133c)) return _(N,B);
-  break;
-
 default:
   break;
   }
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 5acaadb5..c8640cc5 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -209,6 +209,11 @@ set_indic_properties (hb_glyph_info_t &info)
 pos = POS_ABOVE_C;
   }
 
+  /* According to ScriptExtensions.txt, these Grantha marks may also be used 
in Tamil,
+   * so the Indic shaper needs to know their categories. */
+  else if (unlikely (u == 0x11303u)) cat = OT_SM;
+  else if (unlikely (u == 0x1133cu)) cat = OT_N;
+
   else if (unlikely (u == 0x0980u)) cat = OT_PLACEHOLDER; /* 
https://github.com/behdad/harfbuzz/issues/538 */
   else if (unlikely (u == 0x17C6u)) cat = OT_N; /* Khmer Bindu doesn't like to 
be repositioned. */
   else if (unlikely (hb_in_range (u, 0x2010u, 0x2011u)))
commit da4866f7177a4e2836cc70b844e2e64ab671761f
Author: Behdad Esfahbod 
Date:   Mon Oct 2 08:57:06 2017 -0400

[arabic] Update table to Unicode 10 data

diff --git a/src/hb-ot-shape-complex-arabic-table.hh 
b/src/hb-ot-shape-complex-arabic-table.hh
index 228f3665..cd6e4058 100644
--- a/src/hb-ot-shape-complex-arabic-table.hh
+++ b/src/hb-ot-shape-complex-arabic-table.hh
@@ -6,10 +6,10 @@
  *
  * on files with these headers:
  *
- * # ArabicShaping-9.0.0.txt
- * # Date: 2016-02-24, 22:25:00 GMT [RP]
- * # Blocks-9.0.0.txt
- * # Date: 2016-02-05, 23:48:00 GMT [KW]
+ * # ArabicShaping-10.0.0.txt
+ * # Date: 2017-02-16, 00:00:00 GMT [RP, KW]
+ * # Blocks-10.0.0.txt
+ * # Date: 2017-04-12, 17:30:00 GMT [KW]
  * UnicodeData.txt does not have a header.
  */
 
@@ -72,7 +72,10 @@ static const uint8_t joining_table[] =
   /* Mandaic */
 
   /* 0840 */ R,D,D,D,D,D,R,R,D,R,D,D,D,D,D,D,D,D,D,D,R,D,U,U,U,X,X,X,X,X,X,X,
-  /* 0860 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
+
+  /* Syriac Supplement */
+
+  /* 0860 */ D,U,D,D,D,D,U,R,D,R,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
   /* 0880 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
 
   /* Arabic Extended-A */
@@ -130,7 +133,7 @@ static const uint8_t joining_table[] =
   /* 1E920 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
   /* 1E940 */ D,D,D,D,
 
-}; /* Table items: 1214; occupancy: 54% */
+}; /* Table items: 1214; occupancy: 55% */
 
 
 static unsigned int
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedeskt

[HarfBuzz] harfbuzz: Branch 'master'

2017-10-02 Thread Behdad Esfahbod
 src/hb-ot-shape-complex-indic.cc |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1a0a356a0f2b2932581e4fd0437c01c058f4f6d1
Author: Behdad Esfahbod 
Date:   Mon Oct 2 08:49:23 2017 -0400

[indic] Categorize U+0980 BENGALI ANJI as placeholder

Fixes https://github.com/behdad/harfbuzz/issues/538

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 3cd8fd6c..5acaadb5 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -209,6 +209,7 @@ set_indic_properties (hb_glyph_info_t &info)
 pos = POS_ABOVE_C;
   }
 
+  else if (unlikely (u == 0x0980u)) cat = OT_PLACEHOLDER; /* 
https://github.com/behdad/harfbuzz/issues/538 */
   else if (unlikely (u == 0x17C6u)) cat = OT_N; /* Khmer Bindu doesn't like to 
be repositioned. */
   else if (unlikely (hb_in_range (u, 0x2010u, 0x2011u)))
cat = OT_PLACEHOLDER;
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz


[HarfBuzz] harfbuzz: Branch 'master'

2017-10-02 Thread Behdad Esfahbod
 src/hb-shape-plan.cc |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 19e77e01bc13f44138e1d50533327d314dd0a018
Author: jfkthame 
Date:   Mon Oct 2 13:08:49 2017 +0100

[shape-plan] Don't look for a cached plan if variation coords are 
specified. Fixes #549. (#550)

This is a temporary hack just to avoid incorrect shaping results, pending 
proper support
for caching shape-plans with variation coordinates.

diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc
index 3abf555c..5573cd22 100644
--- a/src/hb-shape-plan.cc
+++ b/src/hb-shape-plan.cc
@@ -520,15 +520,17 @@ hb_shape_plan_create_cached2 (hb_face_t   
  *face,
 
 retry:
   hb_face_t::plan_node_t *cached_plan_nodes = (hb_face_t::plan_node_t *) 
hb_atomic_ptr_get (&face->shape_plans);
-  for (hb_face_t::plan_node_t *node = cached_plan_nodes; node; node = 
node->next)
-if (hb_shape_plan_matches (node->shape_plan, &proposal))
-{
-  DEBUG_MSG_FUNC (SHAPE_PLAN, node->shape_plan, "fulfilled from cache");
-  return hb_shape_plan_reference (node->shape_plan);
-}
 
-  /* Not found. */
+  /* Don't look for plan in the cache if there were variation coordinates XXX 
Fix me. */
+  if (!hb_coords_present (coords, num_coords))
+for (hb_face_t::plan_node_t *node = cached_plan_nodes; node; node = 
node->next)
+  if (hb_shape_plan_matches (node->shape_plan, &proposal))
+  {
+DEBUG_MSG_FUNC (SHAPE_PLAN, node->shape_plan, "fulfilled from cache");
+return hb_shape_plan_reference (node->shape_plan);
+  }
 
+  /* Not found. */
   hb_shape_plan_t *shape_plan = hb_shape_plan_create2 (face, props,
   user_features, 
num_user_features,
   coords, num_coords,
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz