diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-13 16:43:37 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 14:14:51 +0000 |
commit | 812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 (patch) | |
tree | f0b0607f6b757eb22237527215094bd87b5d03ba /core/fpdfapi/font/cpdf_type1font.cpp | |
parent | 893822aa5b6254591f8e80fbffcbb4fa6ad849aa (diff) | |
download | pdfium-812e96c2b4c5908a1979da5e27cdcecda0d1dfc9.tar.xz |
Replace FX_CHAR and FX_WCHAR with underlying types.
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8
Reviewed-on: https://pdfium-review.googlesource.com/2967
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_type1font.cpp')
-rw-r--r-- | core/fpdfapi/font/cpdf_type1font.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp index 1a37555a50..4c7b86a567 100644 --- a/core/fpdfapi/font/cpdf_type1font.cpp +++ b/core/fpdfapi/font/cpdf_type1font.cpp @@ -19,8 +19,8 @@ namespace { #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ struct GlyphNameMap { - const FX_CHAR* m_pStrAdobe; - const FX_CHAR* m_pStrUnicode; + const char* m_pStrAdobe; + const char* m_pStrUnicode; }; const GlyphNameMap g_GlyphNameSubsts[] = {{"ff", "uniFB00"}, @@ -30,11 +30,11 @@ const GlyphNameMap g_GlyphNameSubsts[] = {{"ff", "uniFB00"}, {"fl", "uniFB02"}}; int compareString(const void* key, const void* element) { - return FXSYS_stricmp(static_cast<const FX_CHAR*>(key), + return FXSYS_stricmp(static_cast<const char*>(key), static_cast<const GlyphNameMap*>(element)->m_pStrAdobe); } -const FX_CHAR* GlyphNameRemap(const FX_CHAR* pStrAdobe) { +const char* GlyphNameRemap(const char* pStrAdobe) { const GlyphNameMap* found = static_cast<const GlyphNameMap*>(FXSYS_bsearch( pStrAdobe, g_GlyphNameSubsts, FX_ArraySize(g_GlyphNameSubsts), sizeof(GlyphNameMap), compareString)); @@ -161,7 +161,7 @@ void CPDF_Type1Font::LoadGlyphMap() { m_BaseEncoding = PDFFONT_ENCODING_STANDARD; } for (int charcode = 0; charcode < 256; charcode++) { - const FX_CHAR* name = + const char* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); if (!name) continue; @@ -191,7 +191,7 @@ void CPDF_Type1Font::LoadGlyphMap() { if (bCoreText) { if (m_Flags & FXFONT_SYMBOLIC) { for (int charcode = 0; charcode < 256; charcode++) { - const FX_CHAR* name = + const char* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); if (name) { m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name); @@ -201,12 +201,12 @@ void CPDF_Type1Font::LoadGlyphMap() { } else { m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), charcode); - FX_WCHAR unicode = 0; + wchar_t unicode = 0; if (m_GlyphIndex[charcode]) { unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode); } - FX_CHAR name_glyph[256]; + char name_glyph[256]; FXSYS_memset(name_glyph, 0, sizeof(name_glyph)); FXFT_Get_Glyph_Name(m_Font.GetFace(), m_GlyphIndex[charcode], name_glyph, 256); @@ -225,13 +225,13 @@ void CPDF_Type1Font::LoadGlyphMap() { bUnicode = true; } for (int charcode = 0; charcode < 256; charcode++) { - const FX_CHAR* name = + const char* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); if (!name) { continue; } m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name); - const FX_CHAR* pStrUnicode = GlyphNameRemap(name); + const char* pStrUnicode = GlyphNameRemap(name); if (pStrUnicode && 0 == FXFT_Get_Name_Index(m_Font.GetFace(), (char*)name)) { name = pStrUnicode; @@ -259,7 +259,7 @@ void CPDF_Type1Font::LoadGlyphMap() { #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ if (m_Flags & FXFONT_SYMBOLIC) { for (int charcode = 0; charcode < 256; charcode++) { - const FX_CHAR* name = + const char* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); if (name) { m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name); @@ -269,10 +269,10 @@ void CPDF_Type1Font::LoadGlyphMap() { m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), charcode); if (m_GlyphIndex[charcode]) { - FX_WCHAR unicode = + wchar_t unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode); if (unicode == 0) { - FX_CHAR name_glyph[256]; + char name_glyph[256]; FXSYS_memset(name_glyph, 0, sizeof(name_glyph)); FXFT_Get_Glyph_Name(m_Font.GetFace(), m_GlyphIndex[charcode], name_glyph, 256); @@ -297,8 +297,7 @@ void CPDF_Type1Font::LoadGlyphMap() { bUnicode = true; } for (int charcode = 0; charcode < 256; charcode++) { - const FX_CHAR* name = - GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); + const char* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); if (!name) { continue; } @@ -323,7 +322,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ -void CPDF_Type1Font::SetExtGID(const FX_CHAR* name, int charcode) { +void CPDF_Type1Font::SetExtGID(const char* name, int charcode) { CFStringRef name_ct = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull); m_ExtGID[charcode] = @@ -333,7 +332,7 @@ void CPDF_Type1Font::SetExtGID(const FX_CHAR* name, int charcode) { } void CPDF_Type1Font::CalcExtGID(int charcode) { - FX_CHAR name_glyph[256]; + char name_glyph[256]; FXFT_Get_Glyph_Name(m_Font.GetFace(), m_GlyphIndex[charcode], name_glyph, 256); name_glyph[255] = 0; |