Kaydet (Commit) 576e4ea6 authored tarafından Herbert Dürr's avatar Herbert Dürr

#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.
üst e6852804
...@@ -1869,12 +1869,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) ...@@ -1869,12 +1869,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
for( n = 0; n < nLevel; ++n ) for( n = 0; n < nLevel; ++n )
maFallbackRuns[n].ResetPos(); maFallbackRuns[n].ResetPos();
// get the next codepoint index that needs fallback // get the next codepoint index that needs fallback
// and limit it to the minindex..endindex bounds
int nActiveCharPos = nCharPos[0]; 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 // get the end index of the active run
int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])? int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])?
rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1; rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1;
...@@ -2083,8 +2078,6 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) ...@@ -2083,8 +2078,6 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
} }
} }
} }
// if( !maFallbackRuns[i].PosIsInRun( nActiveCharPos ) )
// maFallbackRuns[i].NextRun();
} }
mpLayouts[0]->Simplify( true ); mpLayouts[0]->Simplify( true );
......
...@@ -1850,8 +1850,9 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, ...@@ -1850,8 +1850,9 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
{ {
// create and reset the new array // create and reset the new array
mpGlyphs2Chars = new int[ mnGlyphCapacity ]; mpGlyphs2Chars = new int[ mnGlyphCapacity ];
static const int CHARPOS_NONE = -1;
for( int i = 0; i < mnGlyphCount; ++i ) for( int i = 0; i < mnGlyphCount; ++i )
mpGlyphs2Chars[i] = -1; mpGlyphs2Chars[i] = CHARPOS_NONE;
// calculate the char->glyph mapping // calculate the char->glyph mapping
for( nItem = 0; nItem < mnItemCount; ++nItem ) for( nItem = 0; nItem < mnItemCount; ++nItem )
{ {
...@@ -1867,6 +1868,14 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, ...@@ -1867,6 +1868,14 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
int i = mpLogClusters[c] + rVI.mnMinGlyphPos; int i = mpLogClusters[c] + rVI.mnMinGlyphPos;
mpGlyphs2Chars[i] = c; 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];
}
} }
} }
......
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