diff options
author | László Németh <nemeth@numbertext.org> | 2014-04-09 12:10:15 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2014-04-09 16:45:45 +0200 |
commit | 4a8cf5221f425118a7ec79e0cbf9cb0fb47bf823 (patch) | |
tree | e25f408b48f9a13a4277571c3fdd1d0dd101c6f2 /vcl/source | |
parent | b43ffeb8286ceb79a6142876342c5affe39df333 (diff) |
fdo#70666 avoid only bad Graphite ligature replacement
Change-Id: Ibd42c70edbd8a5ca5eba34bcb92e801c8dc97ba0
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/glyphs/graphite_layout.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 7983ae3d7e1b..26c2ee07069c 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -593,12 +593,14 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) } } + size_t numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset, + rArgs.mpStr + (rArgs.mnLength > limit + 64 ? limit + 64 : rArgs.mnLength), NULL); static com::sun::star::uno::Reference< com::sun::star::i18n::XCharacterClassification > xCharClass; if ( !xCharClass.is() ) xCharClass = vcl::unohelper::CreateCharacterClassification(); - int numchars = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, fdo#70666 avoid bad ligature replacement - if (xCharClass->getType(rArgs.mpStr, numchars + 1) != ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER) - numchars += 64; + int numchars2 = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, fdo#70666 avoid bad ligature replacement + if (numchars > numchars2 && xCharClass->getType(rArgs.mpStr, numchars2 + 1) == ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER) + numchars = numchars2; if (mpFeatures) pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16, rArgs.mpStr + mnSegCharOffset, numchars, bRtl); |