summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <shausman@rhea.troll.no>2007-02-14 15:46:23 +0100
committerSimon Hausmann <shausman@rhea.troll.no>2007-03-28 12:52:26 +0200
commitadb81ecce71bbb0a4ef71313b9c697f3ffa3e701 (patch)
treeedcab500314cc154ab2b62eb24446bf23c5f82ab /src
parent4bd1ac085e2e6d6b2173d60b0d53bd1d3689d518 (diff)
Make it possible to build the Harfbuzz shapers statically into Qt
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/harfbuzz-khmer.cpp1
-rw-r--r--src/harfbuzz-myanmar.cpp10
-rw-r--r--src/harfbuzz-shaper-all.cpp10
-rw-r--r--src/harfbuzz-shaper-private.h4
-rw-r--r--src/harfbuzz-shaper.cpp10
-rw-r--r--src/harfbuzz-tibetan.cpp4
-rw-r--r--src/harfbuzz.h1
8 files changed, 25 insertions, 16 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 73965fb..01170e0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,7 +15,6 @@ MAINSOURCES = \
harfbuzz-open.c \
harfbuzz-shaper.cpp \
harfbuzz-tibetan.cpp \
- harfbuzz-myanmar.cpp \
harfbuzz-khmer.cpp \
harfbuzz-indic.cpp \
harfbuzz-hebrew.cpp \
diff --git a/src/harfbuzz-khmer.cpp b/src/harfbuzz-khmer.cpp
index 5bdce6d..6891781 100644
--- a/src/harfbuzz-khmer.cpp
+++ b/src/harfbuzz-khmer.cpp
@@ -93,7 +93,6 @@ enum KhmerCharClassFlags {
enum KhmerChar {
C_SIGN_ZWNJ = 0x200C,
C_SIGN_ZWJ = 0x200D,
- C_DOTTED_CIRCLE = 0x25CC,
C_RO = 0x179A,
C_VOWEL_AA = 0x17B6,
C_SIGN_NIKAHIT = 0x17C6,
diff --git a/src/harfbuzz-myanmar.cpp b/src/harfbuzz-myanmar.cpp
index 5e01b19..a6ff391 100644
--- a/src/harfbuzz-myanmar.cpp
+++ b/src/harfbuzz-myanmar.cpp
@@ -13,10 +13,6 @@
#include <assert.h>
-enum {
- C_DOTTED_CIRCLE = 0x25CC
-};
-
enum MymrCharClassValues
{
Mymr_CC_RESERVED = 0,
@@ -256,7 +252,7 @@ static bool myanmar_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool i
int medial_ra = -1;
int base = -1;
- for (int i = 0; i < item->item.length; ++i) {
+ for (uint32_t i = 0; i < item->item.length; ++i) {
HB_UChar16 chr = uc[i];
if (chr == Mymr_C_VOWEL_E) {
@@ -475,7 +471,7 @@ HB_Bool HB_MyanmarShape(HB_ShaperItem *item)
// fix logcluster array
MMDEBUG("syllable:");
- for (int i = first_glyph; i < first_glyph + syllable.num_glyphs; ++i)
+ for (uint32_t i = first_glyph; i < first_glyph + syllable.num_glyphs; ++i)
MMDEBUG(" %d -> glyph %x", i, item->glyphs[i]);
MMDEBUG(" logclusters:");
for (int i = sstart; i < send; ++i) {
@@ -494,7 +490,7 @@ void HB_MyanmarAttributes(HB_Script /*script*/, const HB_UChar16 *text, uint32_t
int end = from + len;
const HB_UChar16 *uc = text + from;
attributes += from;
- int i = 0;
+ uint32_t i = 0;
while (i < len) {
bool invalid;
int boundary = myanmar_nextSyllableBoundary(text, from+i, end, &invalid) - from;
diff --git a/src/harfbuzz-shaper-all.cpp b/src/harfbuzz-shaper-all.cpp
new file mode 100644
index 0000000..897f4d6
--- /dev/null
+++ b/src/harfbuzz-shaper-all.cpp
@@ -0,0 +1,10 @@
+
+#include "harfbuzz-shaper.cpp"
+#include "harfbuzz-tibetan.cpp"
+#include "harfbuzz-khmer.cpp"
+#include "harfbuzz-indic.cpp"
+#include "harfbuzz-hebrew.cpp"
+#include "harfbuzz-arabic.cpp"
+#include "harfbuzz-hangul.cpp"
+#include "harfbuzz-myanmar.cpp"
+
diff --git a/src/harfbuzz-shaper-private.h b/src/harfbuzz-shaper-private.h
index f974940..1d6aced 100644
--- a/src/harfbuzz-shaper-private.h
+++ b/src/harfbuzz-shaper-private.h
@@ -12,6 +12,10 @@
FT_BEGIN_HEADER
+enum {
+ C_DOTTED_CIRCLE = 0x25CC
+};
+
typedef enum
{
HB_Combining_BelowLeftAttached = 200,
diff --git a/src/harfbuzz-shaper.cpp b/src/harfbuzz-shaper.cpp
index c62e417..70d6723 100644
--- a/src/harfbuzz-shaper.cpp
+++ b/src/harfbuzz-shaper.cpp
@@ -111,7 +111,7 @@ static void calcLineBreaks(const HB_UChar16 *uc, uint32_t len, HB_CharAttributes
charAttributes[0].charStop = true;
int lcls = cls;
- for (int i = 1; i < len; ++i) {
+ for (uint32_t i = 1; i < len; ++i) {
charAttributes[i].whiteSpace = false;
charAttributes[i].charStop = true;
@@ -381,8 +381,8 @@ void HB_HeuristicSetGlyphAttributes(HB_ShaperItem *item)
HB_GlyphAttributes *attributes = item->attributes;
unsigned short *logClusters = item->log_clusters;
- int glyph_pos = 0;
- for (int i = 0; i < length; i++) {
+ uint32_t glyph_pos = 0;
+ for (uint32_t i = 0; i < length; i++) {
if (HB_IsHighSurrogate(uc[i]) && i < length - 1
&& HB_IsLowSurrogate(uc[i + 1])) {
logClusters[i] = glyph_pos;
@@ -405,7 +405,7 @@ void HB_HeuristicSetGlyphAttributes(HB_ShaperItem *item)
HB_CharCategory lastCat;
int dummy;
HB_GetUnicodeCharProperties(uc[0], &lastCat, &dummy);
- for (int i = 1; i < length; ++i) {
+ for (uint32_t i = 1; i < length; ++i) {
if (logClusters[i] == pos)
// same glyph
continue;
@@ -575,7 +575,7 @@ void HB_GetCharAttributes(const HB_UChar16 *string, uint32_t stringLength,
{
calcLineBreaks(string, stringLength, attributes);
- for (int i = 0; i >= numItems; ++i) {
+ for (uint32_t i = 0; i >= numItems; ++i) {
HB_Script script = items[i].script;
if (script == HB_Script_Inherited)
script = HB_Script_Common;
diff --git a/src/harfbuzz-tibetan.cpp b/src/harfbuzz-tibetan.cpp
index 1ad263d..7ab9176 100644
--- a/src/harfbuzz-tibetan.cpp
+++ b/src/harfbuzz-tibetan.cpp
@@ -94,7 +94,7 @@ static bool tibetan_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool i
return false;
}
- int i;
+ uint32_t i;
HB_STACKARRAY(HB_UChar16, reordered, len + 4);
const HB_UChar16 *str = item->string + item->item.pos;
@@ -229,7 +229,7 @@ extern "C" void HB_TibetanAttributes(HB_Script /*script*/, const HB_UChar16 *tex
int end = from + len;
const HB_UChar16 *uc = text + from;
attributes += from;
- int i = 0;
+ uint32_t i = 0;
while (i < len) {
bool invalid;
int boundary = tibetan_nextSyllableBoundary(text, from+i, end, &invalid) - from;
diff --git a/src/harfbuzz.h b/src/harfbuzz.h
index 557581f..f5259f5 100644
--- a/src/harfbuzz.h
+++ b/src/harfbuzz.h
@@ -21,5 +21,6 @@
#ifdef HARFBUZZ_DUMP
#include "harfbuzz-dump.h"
#endif
+#include "harfbuzz-shaper.h"
#endif /* HARFBUZZ_OPEN_H */