diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-04-06 00:20:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-06 13:18:04 +0000 |
commit | 34a327ac0d35adb36a988339044e2aed9423ec74 (patch) | |
tree | 8cbbbbc7c6f710712969b2e4eb48c4713bf44afe /vcl | |
parent | aaa6410fbb07659c183331f52a88cd31eb080cc2 (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)
(cherry picked from commit 2f89245fb7e1c94bed49dde10b08ab1cf41b597b)
Change-Id: I6542a3f7a01bdf46ae2bcf328fa04064f7f86332
Reviewed-on: https://gerrit.libreoffice.org/23850
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/font/PhysicalFontFamily.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index 8cfc0e895836..c685575ee87a 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -270,7 +270,7 @@ void PhysicalFontFamily::UpdateCloneFontList( PhysicalFontCollection& rFontColle { // This is rather expensive to do per face. OUString aFamilyName = GetEnglishSearchFontName( GetFamilyName() ); - PhysicalFontFamily* pFamily = rFontCollection.FindOrCreateFamily( aFamilyName ); + PhysicalFontFamily* pFamily(nullptr); for( PhysicalFontFace* pFace = mpFirst; pFace; pFace = pFace->GetNextFace() ) { @@ -279,6 +279,11 @@ void PhysicalFontFamily::UpdateCloneFontList( PhysicalFontCollection& rFontColle if( bEmbeddable && !pFace->IsEmbeddable() && !pFace->IsSubsettable() ) continue; + if (!pFamily) + { // tdf#98989 lazy create as family without faces won't work + pFamily = rFontCollection.FindOrCreateFamily( aFamilyName ); + } + assert(pFamily); PhysicalFontFace* pClonedFace = pFace->Clone(); assert( pClonedFace->GetFamilyName().replaceAll("-", "").trim() == GetFamilyName().replaceAll("-", "").trim() ); |