From 065c35006d96eaca324f49248d20d83709a25fbe Mon Sep 17 00:00:00 2001 From: npm Date: Thu, 6 Oct 2016 12:29:09 -0700 Subject: Split m_InstalledTTFonts into two vectors to avoid sketchy logic. Instead of relying on ' ' to determine whether the CFX_Bytestring is added on one place or another, use another vector. When trying to match fonts from the fontmapper, compare with both vectors. BUG=pdfium:510 Review-Url: https://codereview.chromium.org/2395883002 --- fpdfsdk/cfx_systemhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fpdfsdk/cfx_systemhandler.cpp') diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp index bfa80df126..72cb9f57ed 100644 --- a/fpdfsdk/cfx_systemhandler.cpp +++ b/fpdfsdk/cfx_systemhandler.cpp @@ -106,6 +106,10 @@ bool CFX_SystemHandler::FindNativeTrueTypeFont(CFX_ByteString sFontFaceName) { if (font.Compare(sFontFaceName.AsStringC())) return true; } + for (const auto& fontPair : pFontMapper->m_LocalizedTTFonts) { + if (fontPair.first.Compare(sFontFaceName.AsStringC())) + return true; + } return false; } -- cgit v1.2.3