vcl/source/font/PhysicalFontFamily.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 34a327ac0d35adb36a988339044e2aed9423ec74 Author: Michael Stahl <mst...@redhat.com> Date: Wed Apr 6 00:20:28 2016 +0200 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 <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index 8cfc0e8..c685575 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() ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits