diff options
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r-- | core/fpdfapi/font/cpdf_font.cpp | 24 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_fontencoding.cpp | 6 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_fontencoding.h | 2 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_truetypefont.cpp | 10 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_type1font.cpp | 20 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_type3char.cpp | 12 | ||||
-rw-r--r-- | core/fpdfapi/font/cpdf_type3char.h | 4 | ||||
-rw-r--r-- | core/fpdfapi/font/ttgsubtable.cpp | 12 | ||||
-rw-r--r-- | core/fpdfapi/font/ttgsubtable.h | 4 |
9 files changed, 47 insertions, 47 deletions
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp index caacc18a97..1cfecb8ded 100644 --- a/core/fpdfapi/font/cpdf_font.cpp +++ b/core/fpdfapi/font/cpdf_font.cpp @@ -166,33 +166,33 @@ uint32_t CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const { void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc) { m_Flags = pFontDesc->GetIntegerFor("Flags", PDFFONT_NONSYMBOLIC); int ItalicAngle = 0; - FX_BOOL bExistItalicAngle = FALSE; + bool bExistItalicAngle = false; if (pFontDesc->KeyExist("ItalicAngle")) { ItalicAngle = pFontDesc->GetIntegerFor("ItalicAngle"); - bExistItalicAngle = TRUE; + bExistItalicAngle = true; } if (ItalicAngle < 0) { m_Flags |= PDFFONT_ITALIC; m_ItalicAngle = ItalicAngle; } - FX_BOOL bExistStemV = FALSE; + bool bExistStemV = false; if (pFontDesc->KeyExist("StemV")) { m_StemV = pFontDesc->GetIntegerFor("StemV"); - bExistStemV = TRUE; + bExistStemV = true; } - FX_BOOL bExistAscent = FALSE; + bool bExistAscent = false; if (pFontDesc->KeyExist("Ascent")) { m_Ascent = pFontDesc->GetIntegerFor("Ascent"); - bExistAscent = TRUE; + bExistAscent = true; } - FX_BOOL bExistDescent = FALSE; + bool bExistDescent = false; if (pFontDesc->KeyExist("Descent")) { m_Descent = pFontDesc->GetIntegerFor("Descent"); - bExistDescent = TRUE; + bExistDescent = true; } - FX_BOOL bExistCapHeight = FALSE; + bool bExistCapHeight = false; if (pFontDesc->KeyExist("CapHeight")) { - bExistCapHeight = TRUE; + bExistCapHeight = true; } if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent && bExistStemV) { @@ -242,7 +242,7 @@ void CPDF_Font::CheckFontMetrics() { m_Ascent = TT2PDF(FXFT_Get_Face_Ascender(face), face); m_Descent = TT2PDF(FXFT_Get_Face_Descender(face), face); } else { - FX_BOOL bFirst = TRUE; + bool bFirst = true; for (int i = 0; i < 256; i++) { FX_RECT rect = GetCharBBox(i); if (rect.left == rect.right) { @@ -250,7 +250,7 @@ void CPDF_Font::CheckFontMetrics() { } if (bFirst) { m_FontBBox = rect; - bFirst = FALSE; + bFirst = false; } else { if (m_FontBBox.top < rect.top) { m_FontBBox.top = rect.top; diff --git a/core/fpdfapi/font/cpdf_fontencoding.cpp b/core/fpdfapi/font/cpdf_fontencoding.cpp index 38cc66411f..fba35a1062 100644 --- a/core/fpdfapi/font/cpdf_fontencoding.cpp +++ b/core/fpdfapi/font/cpdf_fontencoding.cpp @@ -1665,7 +1665,7 @@ CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding) { } } -FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const { +bool CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const { return FXSYS_memcmp(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0; } @@ -1675,10 +1675,10 @@ CPDF_Object* CPDF_FontEncoding::Realize(CFX_WeakPtr<CFX_ByteStringPool> pPool) { for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS; cs++) { const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(cs); - FX_BOOL match = TRUE; + bool match = true; for (int i = 0; i < 256; ++i) { if (m_Unicodes[i] != pSrc[i]) { - match = FALSE; + match = false; break; } } diff --git a/core/fpdfapi/font/cpdf_fontencoding.h b/core/fpdfapi/font/cpdf_fontencoding.h index a81035c825..a497681e5e 100644 --- a/core/fpdfapi/font/cpdf_fontencoding.h +++ b/core/fpdfapi/font/cpdf_fontencoding.h @@ -41,7 +41,7 @@ class CPDF_FontEncoding { void LoadEncoding(CPDF_Object* pEncoding); - FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const; + bool IsIdentical(CPDF_FontEncoding* pAnother) const; FX_WCHAR UnicodeFromCharCode(uint8_t charcode) const { return m_Unicodes[charcode]; diff --git a/core/fpdfapi/font/cpdf_truetypefont.cpp b/core/fpdfapi/font/cpdf_truetypefont.cpp index d94b3b908e..a395e47112 100644 --- a/core/fpdfapi/font/cpdf_truetypefont.cpp +++ b/core/fpdfapi/font/cpdf_truetypefont.cpp @@ -43,15 +43,15 @@ void CPDF_TrueTypeFont::LoadGlyphMap() { (baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI) && (m_Flags & PDFFONT_SYMBOLIC)) { - FX_BOOL bSupportWin = FALSE; - FX_BOOL bSupportMac = FALSE; + bool bSupportWin = false; + bool bSupportMac = false; for (int i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.GetFace()); i++) { int platform_id = FXFT_Get_Charmap_PlatformID( FXFT_Get_Face_Charmaps(m_Font.GetFace())[i]); if (platform_id == 0 || platform_id == 3) { - bSupportWin = TRUE; + bSupportWin = true; } else if (platform_id == 0 || platform_id == 1) { - bSupportMac = TRUE; + bSupportMac = true; } } if (baseEncoding == PDFFONT_ENCODING_WINANSI && !bSupportWin) { @@ -94,7 +94,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() { bMacRoman = !bMSSymbol && FT_UseTTCharmap(m_Font.GetFace(), 1, 0); } } - FX_BOOL bToUnicode = m_pFontDict->KeyExist("ToUnicode"); + bool bToUnicode = m_pFontDict->KeyExist("ToUnicode"); for (int charcode = 0; charcode < 256; charcode++) { const FX_CHAR* name = GetAdobeCharName(baseEncoding, m_CharNames, charcode); diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp index b7ee717889..127ec281ec 100644 --- a/core/fpdfapi/font/cpdf_type1font.cpp +++ b/core/fpdfapi/font/cpdf_type1font.cpp @@ -43,14 +43,14 @@ const FX_CHAR* GlyphNameRemap(const FX_CHAR* pStrAdobe) { #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ -FX_BOOL FT_UseType1Charmap(FXFT_Face face) { +bool FT_UseType1Charmap(FXFT_Face face) { if (FXFT_Get_Face_CharmapCount(face) == 0) { - return FALSE; + return false; } if (FXFT_Get_Face_CharmapCount(face) == 1 && FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) { - return FALSE; + return false; } if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) { @@ -58,7 +58,7 @@ FX_BOOL FT_UseType1Charmap(FXFT_Face face) { } else { FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]); } - return TRUE; + return true; } } // namespace @@ -132,7 +132,7 @@ void CPDF_Type1Font::LoadGlyphMap() { #endif if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) { if (FT_UseTTCharmap(m_Font.GetFace(), 3, 0)) { - FX_BOOL bGotOne = FALSE; + bool bGotOne = false; for (int charcode = 0; charcode < 256; charcode++) { const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2}; for (int j = 0; j < 4; j++) { @@ -154,7 +154,7 @@ void CPDF_Type1Font::LoadGlyphMap() { } #endif if (m_GlyphIndex[charcode]) { - bGotOne = TRUE; + bGotOne = true; break; } } @@ -267,9 +267,9 @@ void CPDF_Type1Font::LoadGlyphMap() { } return; } - FX_BOOL bUnicode = FALSE; + bool bUnicode = false; if (0 == FXFT_Select_Charmap(m_Font.GetFace(), FXFT_ENCODING_UNICODE)) { - bUnicode = TRUE; + bUnicode = true; } for (int charcode = 0; charcode < 256; charcode++) { const FX_CHAR* name = @@ -367,9 +367,9 @@ void CPDF_Type1Font::LoadGlyphMap() { #endif return; } - FX_BOOL bUnicode = FALSE; + bool bUnicode = false; if (0 == FXFT_Select_Charmap(m_Font.GetFace(), FXFT_ENCODING_UNICODE)) { - bUnicode = TRUE; + bUnicode = true; } for (int charcode = 0; charcode < 256; charcode++) { const FX_CHAR* name = diff --git a/core/fpdfapi/font/cpdf_type3char.cpp b/core/fpdfapi/font/cpdf_type3char.cpp index 332287f594..a4df2cc146 100644 --- a/core/fpdfapi/font/cpdf_type3char.cpp +++ b/core/fpdfapi/font/cpdf_type3char.cpp @@ -13,20 +13,20 @@ #include "core/fxge/fx_dib.h" CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) - : m_pForm(pForm), m_bColored(FALSE) {} + : m_pForm(pForm), m_bColored(false) {} CPDF_Type3Char::~CPDF_Type3Char() {} -FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) { +bool CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) { if (m_pBitmap || !m_pForm) - return TRUE; + return true; if (m_pForm->GetPageObjectList()->size() != 1 || m_bColored) - return FALSE; + return false; auto& pPageObj = m_pForm->GetPageObjectList()->front(); if (!pPageObj->IsImage()) - return FALSE; + return false; m_ImageMatrix = pPageObj->AsImage()->m_Matrix; std::unique_ptr<CFX_DIBSource> pSource( @@ -34,5 +34,5 @@ FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) { if (pSource) m_pBitmap.reset(pSource->Clone()); m_pForm.reset(); - return TRUE; + return true; } diff --git a/core/fpdfapi/font/cpdf_type3char.h b/core/fpdfapi/font/cpdf_type3char.h index ebb5ed440c..549f49e3da 100644 --- a/core/fpdfapi/font/cpdf_type3char.h +++ b/core/fpdfapi/font/cpdf_type3char.h @@ -22,11 +22,11 @@ class CPDF_Type3Char { explicit CPDF_Type3Char(CPDF_Form* pForm); ~CPDF_Type3Char(); - FX_BOOL LoadBitmap(CPDF_RenderContext* pContext); + bool LoadBitmap(CPDF_RenderContext* pContext); std::unique_ptr<CPDF_Form> m_pForm; std::unique_ptr<CFX_DIBitmap> m_pBitmap; - FX_BOOL m_bColored; + bool m_bColored; int m_Width; CFX_Matrix m_ImageMatrix; FX_RECT m_BBox; diff --git a/core/fpdfapi/font/ttgsubtable.cpp b/core/fpdfapi/font/ttgsubtable.cpp index 51f533d7d1..c037746c1e 100644 --- a/core/fpdfapi/font/ttgsubtable.cpp +++ b/core/fpdfapi/font/ttgsubtable.cpp @@ -47,22 +47,22 @@ void CFX_GlyphMap::SetAt(int key, int value) { m_Buffer.InsertBlock(low * sizeof(_IntPair), &pair, sizeof(_IntPair)); } -FX_BOOL CFX_GlyphMap::Lookup(int key, int& value) { +bool CFX_GlyphMap::Lookup(int key, int& value) { void* pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair), sizeof(_IntPair), _CompareInt); if (!pResult) { - return FALSE; + return false; } value = ((uint32_t*)pResult)[1]; - return TRUE; + return true; } CFX_CTTGSUBTable::CFX_CTTGSUBTable() - : m_bFeautureMapLoad(FALSE), loaded(false) {} + : m_bFeautureMapLoad(false), loaded(false) {} CFX_CTTGSUBTable::CFX_CTTGSUBTable(FT_Bytes gsub) - : m_bFeautureMapLoad(FALSE), loaded(false) { + : m_bFeautureMapLoad(false), loaded(false) { LoadGSUBTable(gsub); } @@ -115,7 +115,7 @@ bool CFX_CTTGSUBTable::GetVerticalGlyph(uint32_t glyphnum, } } } - m_bFeautureMapLoad = TRUE; + m_bFeautureMapLoad = true; } for (const auto& pair : m_featureMap) { if (GetVerticalGlyphSub(glyphnum, vglyphnum, diff --git a/core/fpdfapi/font/ttgsubtable.h b/core/fpdfapi/font/ttgsubtable.h index b3853912b2..e0e4bbbd05 100644 --- a/core/fpdfapi/font/ttgsubtable.h +++ b/core/fpdfapi/font/ttgsubtable.h @@ -22,7 +22,7 @@ class CFX_GlyphMap { ~CFX_GlyphMap(); void SetAt(int key, int value); - FX_BOOL Lookup(int key, int& value); + bool Lookup(int key, int& value); protected: CFX_BinaryBuf m_Buffer; @@ -290,7 +290,7 @@ class CFX_CTTGSUBTable { uint32_t GetUInt32(FT_Bytes& p) const; std::map<uint32_t, uint32_t> m_featureMap; - FX_BOOL m_bFeautureMapLoad; + bool m_bFeautureMapLoad; bool loaded; tt_gsub_header header; TScriptList ScriptList; |