summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-03-01 17:11:19 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-03-02 15:39:27 +0000
commit9642d924668222ee06eb897761646dd964bd5a29 (patch)
treef325ec3983c3013c2d495a05e1364cba74aaeb11 /core/fxge
parent4a21114e3a95d3798c5027de33b8e90550fc0eb7 (diff)
downloadpdfium-9642d924668222ee06eb897761646dd964bd5a29.tar.xz
Improve catching narrow fonts on Linux
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 <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/ge/cfx_fontmapper.cpp7
1 files 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)