summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_fontmapper.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-11-07 16:32:20 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-07 16:32:20 +0000
commit979e916fde750e47f262c59dc75f4ca2dc19ed39 (patch)
tree5e767486014c58e384f827f3fd7dc11efe658865 /core/fxge/cfx_fontmapper.cpp
parentf2f12b32b601f022b5c10fddd8c4d19d00072630 (diff)
downloadpdfium-979e916fde750e47f262c59dc75f4ca2dc19ed39.tar.xz
Remove m_bFlagExact from CFX_SubstFont
This CL removes the single use case from |m_bFlagExact|. This flag allows the PDF viewer to treat a substitute font with a matching name as if it was actually an embedded font, which is wrong. For all substitute fonts, it is important to follow the longer process of first obtaining the unicode from the charcode to then obtain the glyph in the substitute font that corresponds to that unicode. Bug: chromium:781785 Change-Id: Ie5958b43914e0e46334b89b7c2c55c02d0da0c11 Reviewed-on: https://pdfium-review.googlesource.com/17859 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fxge/cfx_fontmapper.cpp')
-rw-r--r--core/fxge/cfx_fontmapper.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index 00372885f6..0511b0a76a 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -337,9 +337,7 @@ void CFX_FontMapper::AddInstalledFont(const ByteString& name, int charset) {
if (bLocalized) {
void* hFont = m_pFontInfo->GetFont(name.c_str());
if (!hFont) {
- int iExact;
- hFont = m_pFontInfo->MapFont(0, 0, FX_CHARSET_Default, 0, name.c_str(),
- iExact);
+ hFont = m_pFontInfo->MapFont(0, 0, FX_CHARSET_Default, 0, name.c_str());
if (!hFont)
return;
}
@@ -554,7 +552,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name,
if (FontStyleIsItalic(nStyle))
bItalic = true;
- int iExact = 0;
int Charset = FX_CHARSET_ANSI;
if (WindowCP)
Charset = GetCharsetFromCodePage(WindowCP);
@@ -622,11 +619,8 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name,
} else if (FontStyleIsItalic(flags)) {
bItalic = true;
}
- iExact = !match.IsEmpty();
void* hFont = m_pFontInfo->MapFont(weight, bItalic, Charset, PitchFamily,
- family.c_str(), iExact);
- if (iExact)
- pSubstFont->m_bFlagExact = true;
+ family.c_str());
if (!hFont) {
#ifdef PDF_ENABLE_XFA
if (flags & FXFONT_EXACTMATCH)