summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2013-08-06 13:14:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-08-06 16:15:18 +0200
commit022da4ea298d5d5c134c374546d963926dae2b37 (patch)
treed2ca792831973427fd9b33cd22b5a3404b8ff650 /vcl/win
parentb74d0aa083a8803b7b236e059b9b1c159b06272d (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/win')
-rw-r--r--vcl/win/source/gdi/winlayout.cxx11
1 files changed, 10 insertions, 1 deletions
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];
+ }
}
}