[HarfBuzz] harfbuzz-ng: Branch 'master' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Fri Jun 10 20:09:19 PDT 2011
src/hb-common.h | 33 +++++++++++------
src/hb-ot-shape-complex-indic.cc | 74 ++++++++++++++++++++++++++-------------
src/hb-ot-shape.cc | 1
3 files changed, 73 insertions(+), 35 deletions(-)
New commits:
commit 902ab866f2d2edc3a71c1203065e6ddf49e5b431
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Jun 10 23:08:54 2011 -0400
GNOME Bug 652227 - Unconditional use of stdint.h
diff --git a/src/hb-common.h b/src/hb-common.h
index f0fe63a..9e39cd2 100644
--- a/src/hb-common.h
+++ b/src/hb-common.h
@@ -39,20 +39,31 @@
HB_BEGIN_DECLS
-
-#ifdef _MSC_VER
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
+#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 <inttypes.h>
+#elif defined (_AIX)
+# include <sys/inttypes.h>
+/* 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 <stdint.h>
+# include <stdint.h>
+#endif
+
#endif
+
typedef int hb_bool_t;
typedef uint32_t hb_codepoint_t;
commit 20503ccd578c9983162857954e3236413469ed35
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Jun 7 17:02:48 2011 -0400
More Indic data shuffling
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 901c0e5..62bea9a 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -1,5 +1,5 @@
/*
- * Copyright © 2010 Google, Inc.
+ * Copyright © 2011 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
@@ -34,37 +34,60 @@ HB_BEGIN_DECLS
#define INDIC_TABLE_ELEMENT_TYPE uint8_t
+/* Cateories used in the OpenType spec:
+ * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx
+ */
+enum {
+ OT_X = 0,
+ OT_C,
+ OT_V,
+ OT_N,
+ OT_H,
+ OT_ZWNJ,
+ OT_ZWJ,
+ OT_M,
+ OT_SM,
+ OT_VD,
+ OT_A,
+ OT_NBSP,
+};
+
+/* Categories used in IndicSyllabicCategory.txt from UCD */
+/* The assignments are guesswork */
enum indic_syllabic_category_t {
- INDIC_SYLLABIC_CATEGORY_AVAGRAHA,
- INDIC_SYLLABIC_CATEGORY_BINDU,
- INDIC_SYLLABIC_CATEGORY_CONSONANT,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA,
- INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED,
- INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER,
- INDIC_SYLLABIC_CATEGORY_NUKTA,
- INDIC_SYLLABIC_CATEGORY_OTHER,
- INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER,
- INDIC_SYLLABIC_CATEGORY_TONE_LETTER,
- INDIC_SYLLABIC_CATEGORY_TONE_MARK,
- INDIC_SYLLABIC_CATEGORY_VIRAMA,
- INDIC_SYLLABIC_CATEGORY_VISARGA,
- INDIC_SYLLABIC_CATEGORY_VOWEL,
- INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT,
- INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT,
+ INDIC_SYLLABIC_CATEGORY_OTHER = OT_X,
+
+ INDIC_SYLLABIC_CATEGORY_AVAGRAHA = OT_SM,
+ INDIC_SYLLABIC_CATEGORY_BINDU = OT_SM,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT = OT_C,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD = OT_C,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_C,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER = OT_C,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL = OT_C,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER = OT_NBSP,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_C,
+ INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_C,
+ INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_SM,
+ INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N,
+ INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_SM,
+ INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_V,
+ INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_M,
+ INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H,
+ INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM,
+ INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V,
+ INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M,
+ INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT = OT_V,
};
+/* Categories used in IndicSMatraCategory.txt from UCD */
enum indic_matra_category_t {
+ INDIC_MATRA_CATEGORY_NOT_APPLICABLE = 0,
+
INDIC_MATRA_CATEGORY_BOTTOM,
INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT,
INDIC_MATRA_CATEGORY_INVISIBLE,
INDIC_MATRA_CATEGORY_LEFT,
INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT,
- INDIC_MATRA_CATEGORY_NOT_APPLICABLE,
INDIC_MATRA_CATEGORY_OVERSTRUCK,
INDIC_MATRA_CATEGORY_RIGHT,
INDIC_MATRA_CATEGORY_TOP,
@@ -76,7 +99,10 @@ enum indic_matra_category_t {
INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT,
};
-#define INDIC_COMBINE_CATEGORIES(S,M) (S)
+#define INDIC_COMBINE_CATEGORIES(S,M) \
+ (ASSERT_STATIC_EXPR (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || (S == INDIC_SYLLABIC_CATEGORY_VIRAMA || S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT)), \
+ ASSERT_STATIC_EXPR (S < 16 && M < 16), \
+ (M << 4) | S)
#include "hb-ot-shape-complex-indic-table.hh"
commit 63b177e45c2405272da3fa6c26fe11ae37950bd0
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Jun 7 15:51:40 2011 -0400
Minor
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 9df92a3..34f1570 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -207,6 +207,7 @@ hb_form_clusters (hb_ot_shape_context_t *c)
{
unsigned int count = c->buffer->len;
for (unsigned int i = 1; i < count; i++)
+ /* TODO: Match other mark types too? */
if (c->buffer->info[i].general_category() == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
c->buffer->info[i].cluster = c->buffer->info[i - 1].cluster;
}
More information about the HarfBuzz
mailing list