From 979e916fde750e47f262c59dc75f4ca2dc19ed39 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 7 Nov 2017 16:32:20 +0000 Subject: Remove m_bFlagExact from CFX_SubstFont MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: Nicolás Peña Moreno --- core/fxge/apple/fx_mac_imp.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'core/fxge/apple') diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp index 324f0200b9..edd36bf2bc 100644 --- a/core/fxge/apple/fx_mac_imp.cpp +++ b/core/fxge/apple/fx_mac_imp.cpp @@ -44,8 +44,7 @@ class CFX_MacFontInfo : public CFX_FolderFontInfo { bool bItalic, int charset, int pitch_family, - const char* family, - int& iExact) override; + const char* family) override; }; const char JAPAN_GOTHIC[] = "Hiragino Kaku Gothic Pro W6"; @@ -64,13 +63,11 @@ void* CFX_MacFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, - const char* cstr_face, - int& iExact) { + const char* cstr_face) { ByteString face = cstr_face; for (size_t i = 0; i < FX_ArraySize(g_Base14Substs); ++i) { if (face == ByteStringView(g_Base14Substs[i].m_pName)) { face = g_Base14Substs[i].m_pSubstName; - iExact = true; return GetFont(face.c_str()); } } -- cgit v1.2.3