From 9642d924668222ee06eb897761646dd964bd5a29 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Wed, 1 Mar 2017 17:11:19 -0500 Subject: Improve catching narrow fonts on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the font name instead of the family name on Linux to increase the amount of fonts that get mapped to the default one. This is not done on the other OS because this is a hard-coding that should be avoided, and our bug PDF works fine on those OS. BUG=309664 Change-Id: I2d51f66d65dc042dd638c72c55a403ea78a90dfe Reviewed-on: https://pdfium-review.googlesource.com/2892 Commit-Queue: Nicolás Peña Reviewed-by: dsinclair --- core/fxge/ge/cfx_fontmapper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp index 02143ecc59..064fc9610a 100644 --- a/core/fxge/ge/cfx_fontmapper.cpp +++ b/core/fxge/ge/cfx_fontmapper.cpp @@ -582,15 +582,16 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bItalic = italic_angle != 0; weight = old_weight; } - if (family.Find("Narrow") > 0 || family.Find("Condensed") > 0) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ + if (SubstName.Find("Narrow") > 0 || SubstName.Find("Condensed") > 0) family = "LiberationSansNarrow"; #elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ + if (family.Find("Narrow") > 0 || family.Find("Condensed") > 0) family = "RobotoCondensed"; #else + if (family.Find("Narrow") > 0 || family.Find("Condensed") > 0) family = "ArialNarrow"; -#endif - } +#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ } else { pSubstFont->m_bSubstCJK = true; if (nStyle) -- cgit v1.2.3