summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-01-13 14:40:27 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-16 16:02:50 +0000
commit38c8660228ccedcae079c277eaf0f4bbb5eae65b (patch)
tree3d71931936abb3bc7f89864c9330dcb00c1d4b6e /core
parentdd1bfe4b1438be802eb10a7de52ed77d8b9f32ac (diff)
downloadpdfium-38c8660228ccedcae079c277eaf0f4bbb5eae65b.tar.xz
Add default substitution for narrow fonts
BUG=669893 Change-Id: I0977c031d5b272ce5182da6b3020ac092e30aef4 Reviewed-on: https://pdfium-review.googlesource.com/2210 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fxge/ge/cfx_fontmapper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp
index 1b79520373..02143ecc59 100644
--- a/core/fxge/ge/cfx_fontmapper.cpp
+++ b/core/fxge/ge/cfx_fontmapper.cpp
@@ -582,6 +582,15 @@ 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_
+ family = "LiberationSansNarrow";
+#elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
+ family = "RobotoCondensed";
+#else
+ family = "ArialNarrow";
+#endif
+ }
} else {
pSubstFont->m_bSubstCJK = true;
if (nStyle)