diff options
author | Jonathan Schultz <jonathan@imatix.com> | 2013-05-22 14:08:12 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2013-05-22 14:10:34 +0200 |
commit | 0b70e4ea4fcf0adccdfdf4886e5cc45d46479692 (patch) | |
tree | 45046466f899c707a2d83a2a59e98ba849c03aa9 /vcl/source/glyphs | |
parent | 2dec489ebb75030ffaeaa6daf7d42472e23a5eb6 (diff) |
fdo#62846 incorrect glyph to Unicode mappings in PDFs
Change-Id: Idebc7f69f95d8f72626373475d8611ea68f1483a
Diffstat (limited to 'vcl/source/glyphs')
-rw-r--r-- | vcl/source/glyphs/graphite_layout.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 3898ab1c7fdd..976ccc532983 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -294,7 +294,7 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc if (bCluster) { nBaseGlyphIndex = mvGlyphs.size(); - mvGlyph2Char[nBaseGlyphIndex] = iChar + mnSegCharOffset; + mvGlyph2Char[nBaseGlyphIndex] = firstChar + mnSegCharOffset; nFirstCharInCluster = firstChar; nLastCharInCluster = lastChar; } @@ -1295,6 +1295,24 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out, if (glyph_itr->mnGlyphIndex == GF_DROPPED) break; } + + // Calculate final pCharPosAry item + if (char_index) + { + if (glyph_slot >= (signed)mvGlyph2Char.size()) + { + *char_index++ = mnMinCharPos + mvCharDxs.size(); + } + else + { + assert(glyph_slot > -1); + if (mvGlyph2Char[glyph_slot] == -1) + *char_index++ = mnMinCharPos + mvCharDxs.size(); + else + *char_index++ = mvGlyph2Char[glyph_slot]; + } + } + int numGlyphs = glyph_slot - glyph_slot_begin; // move the next glyph_slot to a glyph that hasn't been dropped while (glyph_slot < static_cast<int>(mvGlyphs.size()) && |