From 5183910a90e97cafc3cfaaad40acdaec0b792f6d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 27 Jan 2015 00:20:58 +0100 Subject: rhbz#1177022: vcl: fix PDF embedding of Type 1 fonts Problem is that for the "CM Typewriter" font the Width for "space" (32) is exported as 0 instead of 525, which is the correct value in the AFM. The reason is that PDFWriterImpl::emitEmbeddedFont() has various arrays to map from font code points to Unicode code points, and there are duplicate mappings, so the 160->32 mapping overrides 32->32. The PrintFontManager::PrintFont::readAfmMetrics() actually creates a Unicode to font code mapping (which may legitimately be n:1) that is then inverted; add an additional hack to store a set of "preferred" Unicodes so that PDFWriterImpl can pick the right Unicode. Presumably the code that is stored explicitly via "C" or "CH" in the AFM should take priority over more generic mappings. Change-Id: Id4205a1cd45ba6a0a5facee1e39f70c3535e7dd4 --- vcl/headless/svptext.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/headless/svptext.cxx') diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 84a35e103325..3b0cf05c2bc3 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -321,7 +321,7 @@ bool SvpSalGraphics::CreateFontSubset( return bSuccess; } -const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded ) +const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded, std::set const** ppPriority) { // in this context the pFont->GetFontId() is a valid PSP // font since they are the only ones left after the PDF @@ -329,7 +329,7 @@ const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace // which this method was created). The correct way would // be to have the GlyphCache search for the PhysicalFontFace pFont psp::fontID aFont = pFont->GetFontId(); - return GenPspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded ); + return GenPspGraphics::DoGetFontEncodingVector(aFont, pNonEncoded, ppPriority); } const void* SvpSalGraphics::GetEmbedFontData( -- cgit