Kaydet (Commit) a8319309 authored tarafından László Németh's avatar László Németh

fdo#70666 fix Graphite ligature replacement at line breaks

Change-Id: I5b7c149f7f419ba18bd2cc59f4e77a0b61280caa
üst 604a0b72
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
#include <unicode/ubidi.h> #include <unicode/ubidi.h>
#include <unicode/uscript.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) // Graphite Libraries (must be after vcl headers on windows)
#include <graphite_static.hxx> #include <graphite_static.hxx>
#include <graphite2/Segment.h> #include <graphite2/Segment.h>
...@@ -590,9 +594,13 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) ...@@ -590,9 +594,13 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
nSegCharLimit - rArgs.mnEndCharPos, bRtl); 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); static com::sun::star::uno::Reference< com::sun::star::i18n::XCharacterClassification > xCharClass;
int numchars = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, FIXME 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) if (mpFeatures)
pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16, pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16,
rArgs.mpStr + mnSegCharOffset, numchars, bRtl); rArgs.mpStr + mnSegCharOffset, numchars, bRtl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment