summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-06 00:20:28 +0200
committerMichael Stahl <mstahl@redhat.com>2016-04-06 11:47:20 +0200
commit2f89245fb7e1c94bed49dde10b08ab1cf41b597b (patch)
treef2d5c6ff744e90dd947b206c4269f1061e9baf42
parente6371f31623a25cc556922735459274ed48e7b7c (diff)
tdf#98989: vcl: fix handling of non-scalable fonts like "Courier"
For a VirtualDevice only scalable fonts are cloned, but for non-scalable bitmap fonts still an empty PhysicalFontFamily with no PhysicalFontFace is created, which causes text to disappear (height 0). Suppress creation of such families like it was done in LO 4.3, so that the fall-back can handle it and map "Courier" to "Courier New". (regression from 8d6697587776136f3121733e1c29d4200720dbd9) Change-Id: I6542a3f7a01bdf46ae2bcf328fa04064f7f86332
-rw-r--r--vcl/source/font/PhysicalFontFamily.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx
index 8cc63fa52445..b2eb5ceefe90 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -264,7 +264,7 @@ void PhysicalFontFamily::UpdateCloneFontList( PhysicalFontCollection& rFontColle
bool bEmbeddable ) const
{
OUString aFamilyName = GetEnglishSearchFontName( GetFamilyName() );
- PhysicalFontFamily* pFamily = rFontCollection.FindOrCreateFontFamily( aFamilyName );
+ PhysicalFontFamily* pFamily(nullptr);
for( std::vector< PhysicalFontFace* >::const_iterator it=maFontFaces.begin(); it != maFontFaces.end(); ++it )
{
@@ -275,6 +275,11 @@ void PhysicalFontFamily::UpdateCloneFontList( PhysicalFontCollection& rFontColle
if( bEmbeddable && !pFoundFontFace->CanEmbed() && !pFoundFontFace->CanSubset() )
continue;
+ if (!pFamily)
+ { // tdf#98989 lazy create as family without faces won't work
+ pFamily = rFontCollection.FindOrCreateFontFamily(aFamilyName);
+ }
+ assert(pFamily);
PhysicalFontFace* pClonedFace = pFoundFontFace->Clone();
#if OSL_DEBUG_LEVEL > 0