summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-01-27 00:20:58 +0100
committerMichael Stahl <mstahl@redhat.com>2015-01-27 14:42:13 +0100
commit5183910a90e97cafc3cfaaad40acdaec0b792f6d (patch)
tree659334063e885f5348e692faf7e8774ec67b080e /vcl/unx
parentad3e0989d137ef765d634cb07a7a7a46ecc774ff (diff)
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
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx4
-rw-r--r--vcl/unx/generic/gdi/salgdi3.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 2e83c39ca5cd..4b1005d90856 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -637,7 +637,7 @@ void CairoTextRender::FreeEmbedFontData( const void* pData, long nLen )
GenPspGraphics::DoFreeEmbedFontData( pData, nLen );
}
-const Ucs2SIntMap* CairoTextRender::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded )
+const Ucs2SIntMap* CairoTextRender::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded, std::set<sal_Unicode> const** ppPriority)
{
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
@@ -645,7 +645,7 @@ const Ucs2SIntMap* CairoTextRender::GetFontEncodingVector( const PhysicalFontFac
// 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);
}
void CairoTextRender::GetGlyphWidths( const PhysicalFontFace* pFont,
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 6f5eadff7979..2e345a959298 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -187,9 +187,9 @@ void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen )
mpTextRenderImpl->FreeEmbedFontData(pData, nLen);
}
-const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded )
+const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded, std::set<sal_Unicode> const** ppPriority)
{
- return mpTextRenderImpl->GetFontEncodingVector(pFont, pNonEncoded);
+ return mpTextRenderImpl->GetFontEncodingVector(pFont, pNonEncoded, ppPriority);
}
void X11SalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,