diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-26 16:24:49 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-27 01:04:13 +0000 |
commit | 698aed79d6ad6e8e3a0c7a500c108d69f944b82d (patch) | |
tree | fbf7e66e0a2ec096561cd0ba5d3c4d577cd64667 /core/fpdfapi/font | |
parent | 3070e94f608f36e7312fad2d471e3d7546f82ca2 (diff) | |
download | pdfium-698aed79d6ad6e8e3a0c7a500c108d69f944b82d.tar.xz |
Cleanup FX macros
This CL renames the FX_OS defines to have _OS_ in their names and drops
the _DESKTOP suffix. The FXM defines have been changed to just FX.
Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74
Reviewed-on: https://pdfium-review.googlesource.com/14833
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r-- | core/fpdfapi/font/cpdf_cidfont.cpp | 14 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_type1font.cpp | 30 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_type1font.h | 2 |
3 files changed, 23 insertions, 23 deletions
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp index 9b326f5c4f..49413d24f5 100644 --- a/core/fpdfapi/font/cpdf_cidfont.cpp +++ b/core/fpdfapi/font/cpdf_cidfont.cpp @@ -125,7 +125,7 @@ CPDF_FontGlobals* GetFontGlobals() { return CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ bool IsValidEmbeddedCharcodeFromUnicodeCharset(CIDSet charset) { switch (charset) { @@ -174,7 +174,7 @@ uint32_t EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, return 0; } -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ void FT_UseCIDCharmap(FXFT_Face face, int coding) { int encoding; @@ -260,7 +260,7 @@ wchar_t CPDF_CIDFont::GetUnicodeFromCharCode(uint32_t charcode) const { if (m_pCID2UnicodeMap && m_pCID2UnicodeMap->IsLoaded() && m_pCMap->IsLoaded()) return m_pCID2UnicodeMap->UnicodeFromCID(CIDFromCharCode(charcode)); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ wchar_t unicode; int charsize = 1; if (charcode > 255) { @@ -308,7 +308,7 @@ uint32_t CPDF_CIDFont::CharCodeFromUnicode(wchar_t unicode) const { return static_cast<uint32_t>(unicode); if (m_pCMap->m_Coding == CIDCODING_CID) return 0; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ uint8_t buffer[32]; int ret = FXSYS_WideCharToMultiByte( g_CharsetCPs[m_pCMap->m_Coding], 0, &unicode, 1, @@ -408,7 +408,7 @@ bool CPDF_CIDFont::Load() { m_pStreamAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream); m_pStreamAcc->LoadAllData(false); } else if (pmap->GetString() == "Identity") { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (m_pFontFile) m_bCIDIsGID = true; #else @@ -615,7 +615,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) { uint16_t cid = CIDFromCharCode(charcode); wchar_t unicode = 0; if (m_bCIDIsGID) { -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ return cid; #else if (m_Flags & FXFONT_SYMBOLIC) @@ -680,7 +680,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) { if (m_Charset == CIDSET_JAPAN1) { if (unicode == '\\') { unicode = '/'; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ } else if (unicode == 0xa5) { unicode = 0x5c; #endif diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp index a7ac264fe0..296351fc82 100644 --- a/core/fpdfapi/font/cpdf_type1font.cpp +++ b/core/fpdfapi/font/cpdf_type1font.cpp @@ -10,13 +10,13 @@ #include "core/fxge/cfx_gemodule.h" #include "core/fxge/fx_freetype.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ #include "core/fxge/apple/apple_int.h" #endif namespace { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ struct GlyphNameMap { const char* m_pStrAdobe; const char* m_pStrUnicode; @@ -40,7 +40,7 @@ const char* GlyphNameRemap(const char* pStrAdobe) { return found ? found->m_pStrUnicode : nullptr; } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ bool FT_UseType1Charmap(FXFT_Face face) { if (FXFT_Get_Face_CharmapCount(face) == 0) { @@ -114,7 +114,7 @@ void CPDF_Type1Font::LoadGlyphMap() { if (!m_Font.GetFace()) return; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ bool bCoreText = true; CQuartz2D& quartz2d = static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData()) @@ -138,7 +138,7 @@ void CPDF_Type1Font::LoadGlyphMap() { uint16_t unicode = prefix[j] * 256 + charcode; m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), unicode); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CalcExtGID(charcode); #endif if (m_GlyphIndex[charcode]) { @@ -148,7 +148,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } } if (bGotOne) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); #endif @@ -168,25 +168,25 @@ void CPDF_Type1Font::LoadGlyphMap() { m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name); m_GlyphIndex[charcode] = FXFT_Get_Char_Index( m_Font.GetFace(), m_Encoding.m_Unicodes[charcode]); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CalcExtGID(charcode); #endif if (m_GlyphIndex[charcode] == 0 && strcmp(name, ".notdef") == 0) { m_Encoding.m_Unicodes[charcode] = 0x20; m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), 0x20); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ CalcExtGID(charcode); #endif } } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); #endif return; } FT_UseType1Charmap(m_Font.GetFace()); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (bCoreText) { if (m_Flags & FXFONT_SYMBOLIC) { for (int charcode = 0; charcode < 256; charcode++) { @@ -254,7 +254,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } return; } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (m_Flags & FXFONT_SYMBOLIC) { for (int charcode = 0; charcode < 256; charcode++) { const char* name = @@ -283,7 +283,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } } } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); @@ -312,13 +312,13 @@ void CPDF_Type1Font::LoadGlyphMap() { } } } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (!bCoreText) memcpy(m_ExtGID, m_GlyphIndex, 256); #endif } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void CPDF_Type1Font::SetExtGID(const char* name, int charcode) { CFStringRef name_ct = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull); @@ -335,4 +335,4 @@ void CPDF_Type1Font::CalcExtGID(int charcode) { name_glyph[255] = 0; SetExtGID(name_glyph, charcode); } -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ diff --git a/core/fpdfapi/font/cpdf_type1font.h b/core/fpdfapi/font/cpdf_type1font.h index 8039583d8e..76c4962ecb 100644 --- a/core/fpdfapi/font/cpdf_type1font.h +++ b/core/fpdfapi/font/cpdf_type1font.h @@ -29,7 +29,7 @@ class CPDF_Type1Font : public CPDF_SimpleFont { // CPDF_SimpleFont: void LoadGlyphMap() override; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void SetExtGID(const char* name, int charcode); void CalcExtGID(int charcode); #endif |