diff options
author | Herbert Dürr <hdu@apache.org> | 2013-08-06 13:14:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-06 16:15:18 +0200 |
commit | 022da4ea298d5d5c134c374546d963926dae2b37 (patch) | |
tree | d2ca792831973427fd9b33cd22b5a3404b8ff650 /vcl | |
parent | b74d0aa083a8803b7b236e059b9b1c159b06272d (diff) |
Resolves: #i122948# fill gaps in glyphs->chars mapping for usp10-layouts
using a heuristic that assumes a glyph with unknown char mapping
is the continuation of the preceding glyph. If there is no known
preceding mapping use the run bounds.
(cherry picked from commit 576e4ea626e1c1ffcf9d025e692db62fed8c3cab)
Change-Id: I70e58a02d814e14e9592ff8efc0ae630346ae5df
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 7 | ||||
-rw-r--r-- | vcl/win/source/gdi/winlayout.cxx | 11 |
2 files changed, 10 insertions, 8 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 4b1d536416b0..c6b8a3017779 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1730,12 +1730,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) for( n = 0; n < nLevel; ++n ) maFallbackRuns[n].ResetPos(); // get the next codepoint index that needs fallback - // and limit it to the minindex..endindex bounds int nActiveCharPos = nCharPos[0]; - if( nActiveCharPos < mnMinCharPos) - nActiveCharPos = mnMinCharPos; - else if( nActiveCharPos >= rArgs.mnEndCharPos ) - nActiveCharPos = rArgs.mnEndCharPos - 1; // get the end index of the active run int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])? rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1; @@ -1944,8 +1939,6 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) } } } -// if( !maFallbackRuns[i].PosIsInRun( nActiveCharPos ) ) -// maFallbackRuns[i].NextRun(); } mpLayouts[0]->Simplify( true ); diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 2210ca41670a..80f94aea354c 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -1739,8 +1739,9 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, { // create and reset the new array mpGlyphs2Chars = new int[ mnGlyphCapacity ]; + static const int CHARPOS_NONE = -1; for( int i = 0; i < mnGlyphCount; ++i ) - mpGlyphs2Chars[i] = -1; + mpGlyphs2Chars[i] = CHARPOS_NONE; // calculate the char->glyph mapping for( nItem = 0; nItem < mnItemCount; ++nItem ) { @@ -1780,6 +1781,14 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int i = mpLogClusters[c] + rVI.mnMinGlyphPos; mpGlyphs2Chars[i] = c; } + // use a heuristic to fill the gaps in the glyphs2chars array + c = !rVI.IsRTL() ? rVI.mnMinCharPos : rVI.mnEndCharPos - 1; + for( int i = rVI.mnMinGlyphPos; i < rVI.mnEndGlyphPos; ++i ) { + if( mpGlyphs2Chars[i] == CHARPOS_NONE ) + mpGlyphs2Chars[i] = c; + else + c = mpGlyphs2Chars[i]; + } } } |