From fcbbd6089da7e60bf616041517a2aee3017ae448 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 15 Dec 2016 09:59:59 +0200 Subject: tdf#103514: Try harder to ignore non-SFNT fonts It seems that Script (and probably other bitmap fonts) have zero nFontType, so instead if checking for RASTER_FONTTYPE, check for not TRUTYPE_FONTTYPE (which seems to cover both TrueType and CFF-based SFNT fonts). Reviewed-on: https://gerrit.libreoffice.org/32031 Tested-by: Jenkins Reviewed-by: Khaled Hosny (cherry picked from commit ef4b9032de55e6b1b182e4ead1bbe6e590df296e) Change-Id: Ie39ed99b219b756885b13b3ecbf3616556a277db Reviewed-on: https://gerrit.libreoffice.org/32040 Reviewed-by: Khaled Hosny Tested-by: Khaled Hosny --- vcl/win/gdi/salfont.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'vcl/win/gdi/salfont.cxx') diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index d2d964d47f4b..10ec674c9f07 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1370,19 +1370,15 @@ int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe, } else { + // Only SFNT fonts are supported, ignore anything else. + if (SalLayout::UseCommonLayout() || OpenGLWrapper::isVCLOpenGLEnabled()) + if (!(nFontType & TRUETYPE_FONTTYPE)) + return 1; + // Ignore non-device font on printer. if (pInfo->mbPrinter && !(nFontType & DEVICE_FONTTYPE)) return 1; - // Ignore non-scalable fonts. - if (nFontType & RASTER_FONTTYPE) - return 1; - - // Ignore font formats not supported by CommonSalLayout. - if (SalLayout::UseCommonLayout()) - if ((pMetric->ntmTm.ntmFlags & NTM_TYPE1) || (pMetric->ntmTm.ntmFlags & NTM_MULTIPLEMASTER)) - return 1; - WinFontFace* pData = ImplLogMetricToDevFontDataW( pLogFont, &(pMetric->ntmTm), nFontType ); pData->SetFontId( sal_IntPtr( pInfo->mnFontCount++ ) ); -- cgit v1.2.3