diff options
author | László Németh <nemeth@numbertext.org> | 2014-02-04 19:10:44 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2014-02-04 22:04:02 +0100 |
commit | a831930986166a8c5cb231821426f5cf4d976df2 (patch) | |
tree | 0ee25c3a8ad1791363b6919ffb0b7c258c4b5fd8 /vcl | |
parent | fdo#44314 Unicode hyphenation at soft hyphens with two extra char. (diff) | |
download | core-a831930986166a8c5cb231821426f5cf4d976df2.tar.gz core-a831930986166a8c5cb231821426f5cf4d976df2.zip |
fdo#70666 fix Graphite ligature replacement at line breaks
Change-Id: I5b7c149f7f419ba18bd2cc59f4e77a0b61280caa
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/glyphs/graphite_layout.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 89b6feef1b90..bb16dd508c82 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -48,6 +48,10 @@ #include <unicode/ubidi.h> #include <unicode/uscript.h> +#include <vcl/unohelp.hxx> +#include <com/sun/star/i18n/XCharacterClassification.hpp> +#include <com/sun/star/i18n/UnicodeType.hpp> + // Graphite Libraries (must be after vcl headers on windows) #include <graphite_static.hxx> #include <graphite2/Segment.h> @@ -590,9 +594,13 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) nSegCharLimit - rArgs.mnEndCharPos, bRtl); } } -// int numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset, -// rArgs.mpStr + (rArgs.mnLength > limit + 64 ? limit + 64 : rArgs.mnLength), NULL); - int numchars = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, FIXME + + 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; if (mpFeatures) pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16, rArgs.mpStr + mnSegCharOffset, numchars, bRtl); |