diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-11-21 22:59:06 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-25 05:24:24 -0600 |
commit | cfcd8112c0cb459646ea8c17bd889c945e75f3a5 (patch) | |
tree | 0bc518cedfd8c1c1fb28760058457eb0a1e3af61 | |
parent | 8b6f67c676d15a3178d268ff9974155d6e130205 (diff) |
fdo#67802: Fix PS printing of non-CTL text with ligatures
The GlyphSet::AddGlyphID() was messing with glyphs of characters that
can be converted to Windows-1252 encoding, discarding whatever glyph it
was asked to use and using a random glyph that is supposed to belong to
the converted character. For ligatures this means the ligature glyphs
was discarded and the glyphs for its component was used, but this broken
for just any glyph substitution.
The code makes no sense at all, apart from the fact that it is verbatim
copy of GlyphSet::AddCharID() since 9754ad8d979557ea03cbfe04708b62b698d1276c
and just happened to work because we did not enable ligatures and other
typographic features for non-CTL text before.
Change-Id: I764f0b40f8acf61eae38a9038b0666d711c04a9d
Reviewed-on: https://gerrit.libreoffice.org/6762
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/generic/print/glyphset.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx index d22d2c89e56d..bb43ef52fa69 100644 --- a/vcl/generic/print/glyphset.cxx +++ b/vcl/generic/print/glyphset.cxx @@ -275,16 +275,14 @@ GlyphSet::AddGlyphID ( sal_Int32* nOutGlyphSetID ) { - sal_uChar nMappedChar; + sal_uChar nMappedChar = 0; // XXX important: avoid to reencode type1 symbol fonts if (mnBaseEncoding == RTL_TEXTENCODING_SYMBOL) nMappedChar = GetSymbolMapping (nUnicode); - else - nMappedChar = GetAnsiMapping (nUnicode); - // create an empty glyphmap that is reserved for iso1252 encoded glyphs - // (or -- unencoded -- symbol glyphs) and a second map that takes any other + // create an empty glyphmap that is reserved for unencoded symbol glyphs, + // and a second map that takes any other if (maGlyphList.empty()) { glyph_map_t aMap, aMapp; @@ -302,7 +300,7 @@ GlyphSet::AddGlyphID ( // insert a new glyph in the font subset if (nMappedChar) { - // always put iso1252 chars into the first map, map them on itself + // always put symbol glyphs into the first map, map them on itself glyph_map_t& aGlyphSet = maGlyphList.front(); AddNotdef (aGlyphSet); @@ -312,7 +310,7 @@ GlyphSet::AddGlyphID ( } else { - // other chars are just appended to the list + // other glyphs are just appended to the list glyph_map_t& aGlyphSet = maGlyphList.back(); AddNotdef (aGlyphSet); |