diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-11-16 15:27:28 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-24 12:11:04 +0100 |
commit | 6ef939455f925be5e52d474105da740da6fafe21 (patch) | |
tree | 9f8238c6bbcd50a6d4fc48d4d967cfcbe04de59b /src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | |
parent | 656e0d3422cec625417b1eaac4e4421e15b8a73f (diff) |
Fix HarfBuzz Thai character SARA AM handling
This patch is contributed by Thanomsub Noppaburana from libthai. It
added a special thai shaping function to handle SARA AM character
for fonts without OpenType rules to support it, like Nokia Pure Text
AS.
With modification to logClusters assignment to make sure that
QTextLine::glyphRuns(int from, int length) returns correct glyphs.
Task-number: QTBUG-21206
Change-Id: I5a78ee1ab2b4c874c7d0df17d4ee6d264ed5a790
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp')
-rw-r--r-- | src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index 7f4bb0cf17..0734442fe0 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -630,7 +630,7 @@ const HB_ScriptEngine HB_ScriptEngines[] = { // Sinhala { HB_IndicShape, HB_IndicAttributes }, // Thai - { HB_BasicShape, HB_ThaiAttributes }, + { HB_ThaiShape, HB_ThaiAttributes }, // Lao { HB_BasicShape, 0 }, // Tibetan @@ -1337,18 +1337,18 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do #ifdef OT_DEBUG if (doLogClusters) { - DEBUG("log clusters after shaping:"); - for (int j = 0; j < length; j++) - DEBUG(" log[%d] = %d", j, item->log_clusters[j]); + DEBUG("log clusters after shaping:\n"); + for (unsigned int j = 0; j < item->item.length; j++) + DEBUG(" log[%d] = %d\n", j, item->log_clusters[j]); } - DEBUG("final glyphs:"); - for (int i = 0; i < (int)hb_buffer->in_length; ++i) - DEBUG(" glyph=%4x char_index=%d mark: %d cmp: %d, clusterStart: %d advance=%d/%d offset=%d/%d", - glyphs[i].glyph, hb_buffer->in_string[i].cluster, glyphs[i].attributes.mark, - glyphs[i].attributes.combiningClass, glyphs[i].attributes.clusterStart, - glyphs[i].advance.x.toInt(), glyphs[i].advance.y.toInt(), - glyphs[i].offset.x.toInt(), glyphs[i].offset.y.toInt()); - DEBUG("-----------------------------------------"); + DEBUG("final glyphs:\n"); + for (unsigned int i = 0; i < item->num_glyphs; ++i) + DEBUG(" glyph=%4x char_index=%d mark: %d cmp: %d, clusterStart: %d advance=%d offset=%d/%d\n", + glyphs[i], face->buffer->in_string[i].cluster, attributes[i].mark, + attributes[i].combiningClass, attributes[i].clusterStart, + item->advances[i] >> 6, + item->offsets[i].x >> 6, item->offsets[i].y >> 6); + DEBUG("-----------------------------------------\n"); #endif return true; } |