From a31d4a90f3446df76d8d3ffa0b441db0ad4623af Mon Sep 17 00:00:00 2001 From: thestig Date: Wed, 1 Jun 2016 20:18:41 -0700 Subject: Change CFX_Font::GetPsName() to return a CFX_ByteString. So everyone can avoid doing Byte to WideString conversions. Also remove CFX_GEFont::GetPsName() and deduplicate a couple of GetPsName() calls. Review-Url: https://codereview.chromium.org/2019173002 --- core/fpdfapi/fpdf_font/cpdf_type1font.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'core/fpdfapi/fpdf_font') diff --git a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp index 5fbc520ae5..fc12ae78ee 100644 --- a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp @@ -118,19 +118,18 @@ void CPDF_Type1Font::LoadGlyphMap() { return; #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - FX_BOOL bCoreText = TRUE; + bool bCoreText = true; CQuartz2D& quartz2d = static_cast(CFX_GEModule::Get()->GetPlatformData()) ->m_quartz2d; if (!m_Font.GetPlatformFont()) { - if (m_Font.GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) { - bCoreText = FALSE; - } + if (m_Font.GetPsName() == "DFHeiStd-W5") + bCoreText = false; + m_Font.SetPlatformFont( quartz2d.CreateFont(m_Font.GetFontData(), m_Font.GetSize())); - if (!m_Font.GetPlatformFont()) { - bCoreText = FALSE; - } + if (!m_Font.GetPlatformFont()) + bCoreText = false; } #endif if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) { @@ -164,9 +163,8 @@ void CPDF_Type1Font::LoadGlyphMap() { } if (bGotOne) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!bCoreText) { + if (!bCoreText) FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); - } #endif return; } @@ -218,9 +216,8 @@ void CPDF_Type1Font::LoadGlyphMap() { } } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!bCoreText) { + if (!bCoreText) FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); - } #endif return; } @@ -366,9 +363,9 @@ void CPDF_Type1Font::LoadGlyphMap() { } } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!bCoreText) { + if (!bCoreText) FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); - } + #endif return; } @@ -397,8 +394,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!bCoreText) { + if (!bCoreText) FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256); - } #endif } -- cgit v1.2.3