summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2013-09-06 11:08:02 +0200
committerLászló Németh <nemeth@numbertext.org>2013-09-06 15:44:57 +0200
commitb2cec9e9313e7bf7912e4e43a80f843019924255 (patch)
tree9ddd4776b6c14757e62bc77dcbce5121f5aff4a1
parenta8e0c7b874a5c14b95c97b0e6f5cf8924fe33e52 (diff)
fdo#68313 fix combining diacritics problem with Graphite fonts
Change-Id: Ied29f864dc5fc21fc55aaa5ddd40b02b53a564f8
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 034842afdd21..a0f02eacc952 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -591,7 +591,16 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
}
int numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset,
rArgs.mpStr + (rArgs.mnLength > limit + 64 ? limit + 64 : rArgs.mnLength), NULL);
- if (rArgs.mnMinCharPos + numchars > limit) numchars = limit - rArgs.mnMinCharPos; // fdo#52540
+ if (mnSegCharOffset + numchars > limit)
+ {
+ int combining_char = 0;
+ for (int i = mnSegCharOffset; i < numchars; i++) {
+ int ch = rArgs.mpStr[i];
+ if ((ch >= 0x300 && ch <= 0x36F) || (ch >= 0x1DC0 && ch <= 0x1DFF) ||
+ (ch >= 0x20D0 && ch <= 0x20F0) || (ch >= 0xFE20 && ch <= 0xFE26)) combining_char++;
+ }
+ numchars = limit - mnSegCharOffset + combining_char; // fdo#52540, fdo#68313
+ }
if (mpFeatures)
pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16,
rArgs.mpStr + mnSegCharOffset, numchars, bRtl);