summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_sysfontinfo.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 /fpdfsdk/fpdf_sysfontinfo.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 'fpdfsdk/fpdf_sysfontinfo.cpp')
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index f1f165afcb..9d5270c1f0 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -50,10 +50,11 @@ class CFX_ExternalFontInfo final : public IFX_SystemFontInfo {
bool bItalic,
int charset,
int pitch_family,
- const char* family,
- int& iExact) override {
+ const char* family) override {
if (!m_pInfo->MapFont)
return nullptr;
+
+ int iExact;
return m_pInfo->MapFont(m_pInfo, weight, bItalic, charset, pitch_family,
family, &iExact);
}
@@ -146,7 +147,7 @@ static void* DefaultMapFont(struct _FPDF_SYSFONTINFO* pThis,
int* bExact) {
auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis);
return pDefault->m_pFontInfo->MapFont(weight, !!bItalic, charset,
- pitch_family, family, *bExact);
+ pitch_family, family);
}
void* DefaultGetFont(struct _FPDF_SYSFONTINFO* pThis, const char* family) {