summaryrefslogtreecommitdiff
path: root/vcl/unx/headless
diff options
context:
space:
mode:
authorHerbert Duerr <hdu@openoffice.org>2009-11-06 14:38:53 +0000
committerHerbert Duerr <hdu@openoffice.org>2009-11-06 14:38:53 +0000
commit8239c5f0abf4cfc5b24b31fad64e247b5e343195 (patch)
treecfed421a16b9463791751e03604e3fd1737b0a82 /vcl/unx/headless
parent25ea9e73b66a5747c34cbb82f27d0069c2a677e0 (diff)
#i106572# explicitly distinguish between PFA/PFB in DoGetEmbedFontData() result
Diffstat (limited to 'vcl/unx/headless')
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 3e9d67bcbbe9..1311aaed4ee4 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -986,13 +986,6 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico
return NULL;
// fill in font info
- switch( aFontInfo.m_eType )
- {
- case psp::fonttype::TrueType: rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF; break;
- case psp::fonttype::Type1: rInfo.m_nFontType = FontSubsetInfo::ANY_TYPE1; break;
- default:
- return NULL;
- }
rInfo.m_nAscent = aFontInfo.m_nAscend;
rInfo.m_nDescent = aFontInfo.m_nDescend;
rInfo.m_aPSName = rMgr.getPSName( aFont );
@@ -1029,9 +1022,22 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico
rInfo.m_nCapHeight = yMax; // Well ...
for( int i = 0; i < 256; i++ )
-
pWidths[i] = (aMetrics[i].width > 0 ? aMetrics[i].width : 0);
+ switch( aFontInfo.m_eType )
+ {
+ case psp::fonttype::TrueType:
+ rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF;
+ break;
+ case psp::fonttype::Type1: {
+ const bool bPFA = ((*(unsigned char*)pFile) < 0x80);
+ rInfo.m_nFontType = bPFA ? FontSubsetInfo::TYPE1_PFA : FontSubsetInfo::TYPE1_PFB;
+ }
+ break;
+ default:
+ return NULL;
+ }
+
return pFile;
}