diff options
Diffstat (limited to 'src/kernel/tqscriptengine_x11.cpp')
| -rw-r--r-- | src/kernel/tqscriptengine_x11.cpp | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/src/kernel/tqscriptengine_x11.cpp b/src/kernel/tqscriptengine_x11.cpp index 5d22fdf49..7d997457c 100644 --- a/src/kernel/tqscriptengine_x11.cpp +++ b/src/kernel/tqscriptengine_x11.cpp @@ -71,7 +71,7 @@ static bool thaana_shape(TQShaperItem *item) openType->selectScript(TQFont::Thaana); if (item->font->stringToCMap(item->string->unicode()+item->from, item->length, item->glyphs, item->advances, &item->num_glyphs, item->flags & TQTextEngine::RightToLeft) != TQFontEngine::NoError) - return FALSE; + return false; heuristicSetGlyphAttributes(item); openType->shape(item); return openType->positionAndAdd(item); @@ -1252,7 +1252,7 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool if (item->num_glyphs < len+4) { item->num_glyphs = len+4; - return FALSE; + return false; } TQVarLengthArray<unsigned short> reordered(len+4); @@ -1283,7 +1283,7 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool if (len != 1) { unsigned short *uc = reordered.data(); - bool beginsWithRa = FALSE; + bool beginsWithRa = false; // Rule 1: find base consonant // @@ -1306,7 +1306,7 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool beginsWithRa = (properties & HasReph) && ((len > 2) && *uc == ra && *(uc+1) == halant); if (beginsWithRa && form(*(uc+2)) == Control) - beginsWithRa = FALSE; + beginsWithRa = false; base = (beginsWithRa ? 2 : 0); IDEBUG(" length = %d, beginsWithRa = %d, base=%d", len, beginsWithRa, base); @@ -1320,7 +1320,7 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool // figure out possible base glyphs memset(position.data(), 0, len); if (script == TQFont::Devanagari || script == TQFont::Gujarati) { - bool vattu = FALSE; + bool vattu = false; for (i = base; i < len; ++i) { position[i] = form(uc[i]); if (position[i] == Consonant) { @@ -1552,22 +1552,22 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool if (item->font->stringToCMap((const TQChar *)reordered.data(), len, item->glyphs, item->advances, &item->num_glyphs, item->flags & TQTextEngine::RightToLeft) != TQFontEngine::NoError) - return FALSE; + return false; IDEBUG(" base=%d, reph=%d", base, reph); IDEBUG("reordered:"); for (i = 0; i < len; i++) { - item->attributes[i].mark = FALSE; - item->attributes[i].clusterStart = FALSE; + item->attributes[i].mark = false; + item->attributes[i].clusterStart = false; item->attributes[i].justification = 0; - item->attributes[i].zeroWidth = FALSE; + item->attributes[i].zeroWidth = false; IDEBUG(" %d: %4x", i, reordered[i]); } // now we have the syllable in the right order, and can start running it through open type. - bool control = FALSE; + bool control = false; for (i = 0; i < len; ++i) control |= (form(reordered[i]) == Control); @@ -1618,7 +1618,7 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool if (script == TQFont::Devanagari || script == TQFont::Gujarati) { // vattu glyphs need this aswell - bool vattu = FALSE; + bool vattu = false; for (i = base-2; i > 1; --i) { if (form(reordered[i]) == Consonant) { vattu = (!vattu && reordered[i] == ra); @@ -1694,8 +1694,8 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool } } - if (!openType->positionAndAdd(item, FALSE)) - return FALSE; + if (!openType->positionAndAdd(item, false)) + return false; if (control) { IDEBUG("found a control char in the syllable"); @@ -1716,9 +1716,9 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool } #endif - item->attributes[0].clusterStart = TRUE; + item->attributes[0].clusterStart = true; IDEBUG("<<<<<<"); - return TRUE; + return true; } @@ -1732,7 +1732,7 @@ static bool indic_shape_syllable(TQOpenType *openType, TQShaperItem *item, bool */ static int indic_nextSyllableBoundary(int script, const TQString &s, int start, int end, bool *invalid) { - *invalid = FALSE; + *invalid = false; IDEBUG("indic_nextSyllableBoundary: start=%d, end=%d", start, end); const TQChar *uc = s.unicode()+start; @@ -1743,7 +1743,7 @@ static int indic_nextSyllableBoundary(int script, const TQString &s, int start, if (state != Consonant && state != IndependentVowel) { if (state != Other) - *invalid = TRUE; + *invalid = true; goto finish; } @@ -1846,7 +1846,7 @@ static bool indic_shape(TQShaperItem *item) if (!indic_shape_syllable(openType, &syllable, invalid)) { IDEBUG("syllable shaping failed, syllable requests %d glyphs", syllable.num_glyphs); item->num_glyphs += syllable.num_glyphs; - return FALSE; + return false; } item->has_positioning |= syllable.has_positioning; @@ -1864,7 +1864,7 @@ static bool indic_shape(TQShaperItem *item) first_glyph += syllable.num_glyphs; } item->num_glyphs = first_glyph; - return TRUE; + return true; } @@ -1877,12 +1877,12 @@ static void indic_attributes(int script, const TQString &text, int from, int len while (i < len) { bool invalid; int boundary = indic_nextSyllableBoundary(script, text, from+i, end, &invalid) - from; - attributes[i].charStop = TRUE; + attributes[i].charStop = true; if (boundary > len-1) boundary = len; i++; while (i < boundary) { - attributes[i].charStop = FALSE; + attributes[i].charStop = false; ++uc; ++i; } @@ -1932,13 +1932,13 @@ static void thaiWordBreaks(const TQChar *string, const int len, TQCharAttributes numbreaks = th_brk(cstr.data(),break_positions, numbreaks); } - attributes[0].softBreak = TRUE; + attributes[0].softBreak = true; int i; for (i = 1; i < len; ++i) - attributes[i].softBreak = FALSE; + attributes[i].softBreak = false; for (i = 0; i < numbreaks; ++i) - attributes[break_positions[i]].softBreak = TRUE; + attributes[break_positions[i]].softBreak = true; if (break_positions != brp) delete [] break_positions; @@ -2042,7 +2042,7 @@ static bool tibetan_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo if (item->num_glyphs < item->length + 4) { item->num_glyphs = item->length + 4; - return FALSE; + return false; } int i; @@ -2058,13 +2058,13 @@ static bool tibetan_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo if (item->font->stringToCMap(str, len, item->glyphs, item->advances, &item->num_glyphs, item->flags & TQTextEngine::RightToLeft) != TQFontEngine::NoError) - return FALSE; + return false; for (i = 0; i < item->length; i++) { - item->attributes[i].mark = FALSE; - item->attributes[i].clusterStart = FALSE; + item->attributes[i].mark = false; + item->attributes[i].clusterStart = false; item->attributes[i].justification = 0; - item->attributes[i].zeroWidth = FALSE; + item->attributes[i].zeroWidth = false; IDEBUG(" %d: %4x", i, str[i].unicode()); } @@ -2075,13 +2075,13 @@ static bool tibetan_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo openType->selectScript(TQFont::Tibetan, tibetan_features); openType->shape(item); - if (!openType->positionAndAdd(item, FALSE)) - return FALSE; + if (!openType->positionAndAdd(item, false)) + return false; } #endif - item->attributes[0].clusterStart = TRUE; - return TRUE; + item->attributes[0].clusterStart = true; + return true; } @@ -2097,7 +2097,7 @@ static int tibetan_nextSyllableBoundary(const TQString &s, int start, int end, b if (state != TibetanHeadConsonant) { if (state != TibetanOther) - *invalid = TRUE; + *invalid = true; goto finish; } @@ -2125,7 +2125,7 @@ static int tibetan_nextSyllableBoundary(const TQString &s, int start, int end, b } finish: - *invalid = FALSE; + *invalid = false; return start+pos; } @@ -2161,7 +2161,7 @@ static bool tibetan_shape(TQShaperItem *item) syllable.num_glyphs = item->num_glyphs - first_glyph; if (!tibetan_shape_syllable(openType, &syllable, invalid)) { item->num_glyphs += syllable.num_glyphs; - return FALSE; + return false; } item->has_positioning |= syllable.has_positioning; @@ -2172,7 +2172,7 @@ static bool tibetan_shape(TQShaperItem *item) first_glyph += syllable.num_glyphs; } item->num_glyphs = first_glyph; - return TRUE; + return true; } static void tibetan_attributes(int script, const TQString &text, int from, int len, TQCharAttributes *attributes) @@ -2187,12 +2187,12 @@ static void tibetan_attributes(int script, const TQString &text, int from, int l bool invalid; int boundary = tibetan_nextSyllableBoundary(text, from+i, end, &invalid) - from; - attributes[i].charStop = TRUE; + attributes[i].charStop = true; if (boundary > len-1) boundary = len; i++; while (i < boundary) { - attributes[i].charStop = FALSE; + attributes[i].charStop = false; ++uc; ++i; } @@ -2484,7 +2484,7 @@ static const signed char khmerStateTable[][CC_COUNT] = // static inline int khmer_nextSyllableBoundary(const TQString &s, int start, int end, bool *invalid) { - *invalid = FALSE; + *invalid = false; const TQChar *uc = s.unicode() + start; int state = 0; int pos = start; @@ -2710,14 +2710,14 @@ static bool khmer_shape_syllable(TQOpenType *openType, TQShaperItem *item) if (item->font->stringToCMap((const TQChar *)reordered, len, item->glyphs, item->advances, &item->num_glyphs, item->flags & TQTextEngine::RightToLeft) != TQFontEngine::NoError) - return FALSE; + return false; KHDEBUG("after shaping: len=%d", len); for (i = 0; i < len; i++) { - item->attributes[i].mark = FALSE; - item->attributes[i].clusterStart = FALSE; + item->attributes[i].mark = false; + item->attributes[i].clusterStart = false; item->attributes[i].justification = 0; - item->attributes[i].zeroWidth = FALSE; + item->attributes[i].zeroWidth = false; KHDEBUG(" %d: %4x property=%x", i, reordered[i], properties[i]); } @@ -2745,8 +2745,8 @@ static bool khmer_shape_syllable(TQOpenType *openType, TQShaperItem *item) } openType->shape(item, where); - if (!openType->positionAndAdd(item, FALSE)) - return FALSE; + if (!openType->positionAndAdd(item, false)) + return false; } else #endif { @@ -2754,8 +2754,8 @@ static bool khmer_shape_syllable(TQOpenType *openType, TQShaperItem *item) Q_UNUSED(openType); } - item->attributes[0].clusterStart = TRUE; - return TRUE; + item->attributes[0].clusterStart = true; + return true; } static bool khmer_shape(TQShaperItem *item) @@ -2792,7 +2792,7 @@ static bool khmer_shape(TQShaperItem *item) if (!khmer_shape_syllable(openType, &syllable)) { KHDEBUG("syllable shaping failed, syllable requests %d glyphs", syllable.num_glyphs); item->num_glyphs += syllable.num_glyphs; - return FALSE; + return false; } item->has_positioning |= syllable.has_positioning; @@ -2810,7 +2810,7 @@ static bool khmer_shape(TQShaperItem *item) first_glyph += syllable.num_glyphs; } item->num_glyphs = first_glyph; - return TRUE; + return true; } static void khmer_attributes( int script, const TQString &text, int from, int len, TQCharAttributes *attributes ) @@ -2825,12 +2825,12 @@ static void khmer_attributes( int script, const TQString &text, int from, int le bool invalid; int boundary = khmer_nextSyllableBoundary( text, from+i, end, &invalid ) - from; - attributes[i].charStop = TRUE; + attributes[i].charStop = true; if ( boundary > len-1 ) boundary = len; i++; while ( i < boundary ) { - attributes[i].charStop = FALSE; + attributes[i].charStop = false; ++uc; ++i; } @@ -3008,7 +3008,7 @@ static const signed char mymrStateTable[][Mymr_CC_COUNT] = // static inline int myanmar_nextSyllableBoundary(const TQString &s, int start, int end, bool *invalid) { - *invalid = FALSE; + *invalid = false; const TQChar *uc = s.unicode() + start; int state = 0; int pos = start; @@ -3152,7 +3152,7 @@ static bool myanmar_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo ++len; } - bool lastWasVirama = FALSE; + bool lastWasVirama = false; int basePos = -1; // copy the rest of the syllable to the output, inserting the kinzi // at the correct place @@ -3217,14 +3217,14 @@ static bool myanmar_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo if (item->font->stringToCMap((const TQChar *)reordered, len, item->glyphs, item->advances, &item->num_glyphs, item->flags & TQTextEngine::RightToLeft) != TQFontEngine::NoError) - return FALSE; + return false; MMDEBUG("after shaping: len=%d", len); for (i = 0; i < len; i++) { - item->attributes[i].mark = FALSE; - item->attributes[i].clusterStart = FALSE; + item->attributes[i].mark = false; + item->attributes[i].clusterStart = false; item->attributes[i].justification = 0; - item->attributes[i].zeroWidth = FALSE; + item->attributes[i].zeroWidth = false; MMDEBUG(" %d: %4x property=%x", i, reordered[i], properties[i]); } @@ -3252,8 +3252,8 @@ static bool myanmar_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo } openType->shape(item, where); - if (!openType->positionAndAdd(item, FALSE)) - return FALSE; + if (!openType->positionAndAdd(item, false)) + return false; } else #endif { @@ -3261,8 +3261,8 @@ static bool myanmar_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo Q_UNUSED(openType); } - item->attributes[0].clusterStart = TRUE; - return TRUE; + item->attributes[0].clusterStart = true; + return true; } static bool myanmar_shape(TQShaperItem *item) @@ -3299,7 +3299,7 @@ static bool myanmar_shape(TQShaperItem *item) if (!myanmar_shape_syllable(openType, &syllable, invalid)) { MMDEBUG("syllable shaping failed, syllable requests %d glyphs", syllable.num_glyphs); item->num_glyphs += syllable.num_glyphs; - return FALSE; + return false; } item->has_positioning |= syllable.has_positioning; @@ -3317,7 +3317,7 @@ static bool myanmar_shape(TQShaperItem *item) first_glyph += syllable.num_glyphs; } item->num_glyphs = first_glyph; - return TRUE; + return true; } static void myanmar_attributes( int script, const TQString &text, int from, int len, TQCharAttributes *attributes ) @@ -3332,14 +3332,14 @@ static void myanmar_attributes( int script, const TQString &text, int from, int bool invalid; int boundary = myanmar_nextSyllableBoundary( text, from+i, end, &invalid ) - from; - attributes[i].charStop = TRUE; - attributes[i].softBreak = TRUE; + attributes[i].charStop = true; + attributes[i].softBreak = true; if ( boundary > len-1 ) boundary = len; i++; while ( i < boundary ) { - attributes[i].charStop = FALSE; - attributes[i].softBreak = FALSE; + attributes[i].charStop = false; + attributes[i].softBreak = false; ++uc; ++i; } @@ -3501,12 +3501,12 @@ static bool hangul_shape_syllable(TQOpenType *openType, TQShaperItem *item) if (item->font->stringToCMap(ch, len, item->glyphs, item->advances, &item->num_glyphs, item->flags & TQTextEngine::RightToLeft) != TQFontEngine::NoError) - return FALSE; + return false; for (i = 0; i < len; i++) { - item->attributes[i].mark = FALSE; - item->attributes[i].clusterStart = FALSE; + item->attributes[i].mark = false; + item->attributes[i].clusterStart = false; item->attributes[i].justification = 0; - item->attributes[i].zeroWidth = FALSE; + item->attributes[i].zeroWidth = false; IDEBUG(" %d: %4x", i, ch[i].unicode()); } @@ -3519,14 +3519,14 @@ static bool hangul_shape_syllable(TQOpenType *openType, TQShaperItem *item) item->log_clusters = logClusters.data(); openType->shape(item); - if (!openType->positionAndAdd(item, FALSE)) - return FALSE; + if (!openType->positionAndAdd(item, false)) + return false; } #endif - item->attributes[0].clusterStart = TRUE; - return TRUE; + item->attributes[0].clusterStart = true; + return true; } static bool hangul_shape(TQShaperItem *item) @@ -3535,10 +3535,10 @@ static bool hangul_shape(TQShaperItem *item) const TQChar *uc = item->string->unicode() + item->from; - bool allPrecomposed = TRUE; + bool allPrecomposed = true; for (int i = 0; i < item->length; ++i) { if (!hangul_isPrecomposed(uc[i].unicode())) { - allPrecomposed = FALSE; + allPrecomposed = false; break; } } @@ -3573,7 +3573,7 @@ static bool hangul_shape(TQShaperItem *item) syllable.num_glyphs = item->num_glyphs - first_glyph; if (!hangul_shape_syllable(openType, &syllable)) { item->num_glyphs += syllable.num_glyphs; - return FALSE; + return false; } item->has_positioning |= syllable.has_positioning; // fix logcluster array @@ -3583,7 +3583,7 @@ static bool hangul_shape(TQShaperItem *item) first_glyph += syllable.num_glyphs; } item->num_glyphs = first_glyph; - return TRUE; + return true; } return basic_shape(item); @@ -3600,12 +3600,12 @@ static void hangul_attributes(int script, const TQString &text, int from, int le while (i < len) { int boundary = hangul_nextSyllableBoundary(text, from+i, end) - from; - attributes[i].charStop = TRUE; + attributes[i].charStop = true; if (boundary > len-1) boundary = len; i++; while (i < boundary) { - attributes[i].charStop = FALSE; + attributes[i].charStop = false; ++uc; ++i; } |
