From 376588d3c6c8b83c663f350a7b2db499682e6a80 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 8 Mar 2022 14:29:54 +0200 Subject: Trust the family name in the font file if necessary in AddTempDevFontHelper() If the passed in font name is empty, use the one that has been read from the font file. Seems like a reasonable thing to do, and I have a use for this small improvement coming. Change-Id: I3598179bf85ba3acdaca6058982ba5bf81e68288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131300 Tested-by: Jenkins Reviewed-by: Tor Lillqvist --- vcl/unx/generic/print/genpspgraphics.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl/unx/generic') diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index da0a406dea0b..f903b30c6204 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -253,7 +253,8 @@ bool GenPspGraphics::AddTempDevFontHelper( vcl::font::PhysicalFontCollection* pF // prepare font data psp::FastPrintFontInfo aInfo; rMgr.getFontFastInfo( elem, aInfo ); - aInfo.m_aFamilyName = rFontName; + if (!rFontName.isEmpty()) + aInfo.m_aFamilyName = rFontName; // inform glyph cache of new font FontAttributes aDFA = GenPspGraphics::Info2FontAttributes( aInfo ); -- cgit