summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-23 13:36:00 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-23 13:36:00 -0700
commitf1e7c461dfabbff6b65a072f24f6711b34159361 (patch)
tree3b0bb772a59669f06b86824a444fd06642592d4b /core/src/fpdfapi/fpdf_font
parent320b2313d19869333ed453af546e61a9fc2b81c9 (diff)
downloadpdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/font_int.h34
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp152
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp138
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h10
5 files changed, 172 insertions, 172 deletions
diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h
index e52540853d..f57e52758a 100644
--- a/core/src/fpdfapi/fpdf_font/font_int.h
+++ b/core/src/fpdfapi/fpdf_font/font_int.h
@@ -12,15 +12,15 @@ class CPDF_CMapManager
public:
CPDF_CMapManager();
~CPDF_CMapManager();
- void* GetPackage(bool bPrompt);
- CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, bool bPrompt);
- CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, bool bPrompt);
+ void* GetPackage(FX_BOOL bPrompt);
+ CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
+ CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, FX_BOOL bPrompt);
void ReloadAll();
private:
- CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, bool bPrompt);
- CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(int charset, bool bPrompt);
- void DropAll(bool bReload);
- bool m_bPrompted;
+ CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
+ CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(int charset, FX_BOOL bPrompt);
+ void DropAll(FX_BOOL bReload);
+ FX_BOOL m_bPrompted;
CFX_MapByteStringToPtr m_CMaps;
CPDF_CID2UnicodeMap* m_CID2UnicodeMaps[6];
};
@@ -56,7 +56,7 @@ class CPDF_CMapParser
public:
CPDF_CMapParser();
~CPDF_CMapParser() {}
- bool Initialize(CPDF_CMap*);
+ FX_BOOL Initialize(CPDF_CMap*);
void ParseWord(const CFX_ByteStringC& str);
CFX_BinaryBuf m_AddMaps;
private:
@@ -80,10 +80,10 @@ class CPDF_CMap
{
public:
CPDF_CMap();
- bool LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, bool bPromptCJK);
- bool LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
+ FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, FX_BOOL bPromptCJK);
+ FX_BOOL LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
void Release();
- bool IsLoaded() const
+ FX_BOOL IsLoaded() const
{
return m_bLoaded;
}
@@ -91,7 +91,7 @@ public:
{
return m_Charset;
}
- bool IsVertWriting() const
+ FX_BOOL IsVertWriting() const
{
return m_bVertical;
}
@@ -109,14 +109,14 @@ protected:
friend class CPDF_CIDFont;
protected:
CFX_ByteString m_PredefinedCMap;
- bool m_bVertical;
+ FX_BOOL m_bVertical;
int m_Charset, m_Coding;
CodingScheme m_CodingScheme;
int m_nCodeRanges;
uint8_t* m_pLeadingBytes;
FX_WORD* m_pMapping;
uint8_t* m_pAddMapping;
- bool m_bLoaded;
+ FX_BOOL m_bLoaded;
const FXCMAP_CMap* m_pEmbedMap;
CPDF_CMap* m_pUseMap;
};
@@ -146,9 +146,9 @@ class CPDF_CID2UnicodeMap
public:
CPDF_CID2UnicodeMap();
~CPDF_CID2UnicodeMap();
- bool Initialize();
- bool IsLoaded();
- void Load(CPDF_CMapManager* pMgr, int charset, bool bPromptCJK);
+ FX_BOOL Initialize();
+ FX_BOOL IsLoaded();
+ void Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK);
FX_WCHAR UnicodeFromCID(FX_WORD CID);
protected:
int m_Charset;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index afcce6d18c..8037a8c674 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -12,16 +12,16 @@
#include "../fpdf_page/pageint.h"
#include "font_int.h"
-bool FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id)
+FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id)
{
for (int i = 0; i < FXFT_Get_Face_CharmapCount(face); i ++) {
if (FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(face)[i]) == platform_id &&
FXFT_Get_Charmap_EncodingID(FXFT_Get_Face_Charmaps(face)[i]) == encoding_id) {
FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[i]);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
CPDF_FontGlobals::CPDF_FontGlobals()
: m_pContrastRamps(NULL)
@@ -120,7 +120,7 @@ CPDF_Font::CPDF_Font(int fonttype) : m_FontType(fonttype)
m_pFontFile = NULL;
m_Flags = 0;
m_pToUnicodeMap = NULL;
- m_bToUnicodeLoaded = false;
+ m_bToUnicodeLoaded = FALSE;
m_pCharMap = new CPDF_FontCharMap(this);
}
CPDF_Font::~CPDF_Font()
@@ -135,9 +135,9 @@ CPDF_Font::~CPDF_Font()
m_pDocument->GetPageData()->ReleaseFontFileStreamAcc((CPDF_Stream*)m_pFontFile->GetStream());
}
}
-bool CPDF_Font::IsVertWriting() const
+FX_BOOL CPDF_Font::IsVertWriting() const
{
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -236,33 +236,33 @@ void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc)
{
m_Flags = pFontDesc->GetInteger(FX_BSTRC("Flags"), PDFFONT_NONSYMBOLIC);
int ItalicAngle = 0;
- bool bExistItalicAngle = false;
+ FX_BOOL bExistItalicAngle = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("ItalicAngle"))) {
ItalicAngle = pFontDesc->GetInteger(FX_BSTRC("ItalicAngle"));
- bExistItalicAngle = true;
+ bExistItalicAngle = TRUE;
}
if (ItalicAngle < 0) {
m_Flags |= PDFFONT_ITALIC;
m_ItalicAngle = ItalicAngle;
}
- bool bExistStemV = false;
+ FX_BOOL bExistStemV = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("StemV"))) {
m_StemV = pFontDesc->GetInteger(FX_BSTRC("StemV"));
- bExistStemV = true;
+ bExistStemV = TRUE;
}
- bool bExistAscent = false;
+ FX_BOOL bExistAscent = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("Ascent"))) {
m_Ascent = pFontDesc->GetInteger(FX_BSTRC("Ascent"));
- bExistAscent = true;
+ bExistAscent = TRUE;
}
- bool bExistDescent = false;
+ FX_BOOL bExistDescent = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("Descent"))) {
m_Descent = pFontDesc->GetInteger(FX_BSTRC("Descent"));
- bExistDescent = true;
+ bExistDescent = TRUE;
}
- bool bExistCapHeight = false;
+ FX_BOOL bExistCapHeight = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("CapHeight"))) {
- bExistCapHeight = true;
+ bExistCapHeight = TRUE;
}
if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent && bExistStemV) {
m_Flags |= PDFFONT_USEEXTERNATTR;
@@ -316,7 +316,7 @@ void CPDF_Font::CheckFontMetrics()
m_Ascent = TT2PDF(FXFT_Get_Face_Ascender(m_Font.m_Face), m_Font.m_Face);
m_Descent = TT2PDF(FXFT_Get_Face_Descender(m_Font.m_Face), m_Font.m_Face);
} else {
- bool bFirst = true;
+ FX_BOOL bFirst = TRUE;
for (int i = 0; i < 256; i ++) {
FX_RECT rect;
GetCharBBox(i, rect);
@@ -325,7 +325,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;
@@ -361,7 +361,7 @@ void CPDF_Font::CheckFontMetrics()
}
void CPDF_Font::LoadUnicodeMap()
{
- m_bToUnicodeLoaded = true;
+ m_bToUnicodeLoaded = TRUE;
CPDF_Stream* pStream = m_pFontDict->GetStream(FX_BSTRC("ToUnicode"));
if (pStream == NULL) {
return;
@@ -466,10 +466,10 @@ CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDic
}
return pFont;
}
-bool CPDF_Font::Load()
+FX_BOOL CPDF_Font::Load()
{
if (m_pFontDict == NULL) {
- return false;
+ return FALSE;
}
CFX_ByteString type = m_pFontDict->GetString(FX_BSTRC("Subtype"));
m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
@@ -623,7 +623,7 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream)
{
int CIDSet = 0;
CPDF_StreamAcc stream;
- stream.LoadAllData(pStream, false);
+ stream.LoadAllData(pStream, FALSE);
CPDF_SimpleParser parser(stream.GetData(), stream.GetSize());
m_Map.EstimateSize(stream.GetSize() / 8, 1024);
while (1) {
@@ -719,12 +719,12 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream)
}
}
if (CIDSet) {
- m_pBaseMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(CIDSet, false);
+ m_pBaseMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(CIDSet, FALSE);
} else {
m_pBaseMap = NULL;
}
}
-static bool GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
+static FX_BOOL GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
{
if (value == FX_BSTRC("WinAnsiEncoding")) {
basemap = PDFFONT_ENCODING_WINANSI;
@@ -735,12 +735,12 @@ static bool GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
} else if (value == FX_BSTRC("PDFDocEncoding")) {
basemap = PDFFONT_ENCODING_PDFDOC;
} else {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_ByteString*& pCharNames,
- bool bEmbedded, bool bTrueType)
+ FX_BOOL bEmbedded, FX_BOOL bTrueType)
{
if (pEncoding == NULL) {
if (m_BaseFont == FX_BSTRC("Symbol")) {
@@ -802,18 +802,18 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_
}
}
}
-bool CPDF_Font::IsStandardFont() const
+FX_BOOL CPDF_Font::IsStandardFont() const
{
if (m_FontType != PDFFONT_TYPE1) {
- return false;
+ return FALSE;
}
if (m_pFontFile != NULL) {
- return false;
+ return FALSE;
}
if (((CPDF_Type1Font*)this)->GetBase14Font() < 0) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype)
{
@@ -828,10 +828,10 @@ CPDF_SimpleFont::~CPDF_SimpleFont()
{
delete[] m_pCharNames;
}
-int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph)
+int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
{
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
if (charcode > 0xff) {
return -1;
@@ -923,7 +923,7 @@ const FX_CHAR* GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNa
}
return name;
}
-bool CPDF_SimpleFont::LoadCommon()
+FX_BOOL CPDF_SimpleFont::LoadCommon()
{
CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
if (pFontDesc) {
@@ -931,9 +931,9 @@ bool CPDF_SimpleFont::LoadCommon()
}
CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
int width_start = 0, width_end = -1;
- m_bUseFontWidth = true;
+ m_bUseFontWidth = TRUE;
if (pWidthArray) {
- m_bUseFontWidth = false;
+ m_bUseFontWidth = FALSE;
if (pFontDesc && pFontDesc->KeyExist(FX_BSTRC("MissingWidth"))) {
int MissingWidth = pFontDesc->GetInteger(FX_BSTRC("MissingWidth"));
for (int i = 0; i < 256; i ++) {
@@ -970,7 +970,7 @@ bool CPDF_SimpleFont::LoadCommon()
delete[] m_pCharNames;
m_pCharNames = NULL;
if (m_Font.m_Face == NULL) {
- return true;
+ return TRUE;
}
if (m_Flags & PDFFONT_ALLCAP) {
unsigned char lowercases[] = {'a', 'z', 0xe0, 0xf6, 0xf8, 0xfd};
@@ -988,7 +988,7 @@ bool CPDF_SimpleFont::LoadCommon()
}
}
CheckFontMetrics();
- return true;
+ return TRUE;
}
void CPDF_SimpleFont::LoadSubstFont()
{
@@ -1013,7 +1013,7 @@ void CPDF_SimpleFont::LoadSubstFont()
if (m_Font.m_pSubstFont->m_SubstFlags & FXFONT_SUBST_NONSYMBOL) {
}
}
-bool CPDF_SimpleFont::IsUnicodeCompatible() const
+FX_BOOL CPDF_SimpleFont::IsUnicodeCompatible() const
{
return m_BaseEncoding != PDFFONT_ENCODING_BUILTIN && m_BaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
m_BaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS;
@@ -1022,7 +1022,7 @@ CPDF_Type1Font::CPDF_Type1Font() : CPDF_SimpleFont(PDFFONT_TYPE1)
{
m_Base14Font = -1;
}
-bool CPDF_Type1Font::_Load()
+FX_BOOL CPDF_Type1Font::_Load()
{
m_Base14Font = _PDF_GetStandardFontName(m_BaseFont);
if (m_Base14Font >= 0) {
@@ -1046,21 +1046,21 @@ bool CPDF_Type1Font::_Load()
}
return LoadCommon();
}
-static bool FT_UseType1Charmap(FXFT_Face face)
+static FX_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) {
FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[1]);
} else {
FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]);
}
- return true;
+ return TRUE;
}
extern FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -1112,21 +1112,21 @@ void CPDF_Type1Font::LoadGlyphMap()
return;
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- bool bCoreText = true;
+ FX_BOOL bCoreText = TRUE;
CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
if (!m_Font.m_pPlatformFont) {
if (m_Font.GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- bCoreText = false;
+ bCoreText = FALSE;
}
m_Font.m_pPlatformFont = quartz2d.CreateFont(m_Font.m_pFontData, m_Font.m_dwSize);
if (NULL == m_Font.m_pPlatformFont) {
- bCoreText = false;
+ bCoreText = FALSE;
}
}
#endif
if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) {
if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
- bool bGotOne = false;
+ FX_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 ++) {
@@ -1143,7 +1143,7 @@ void CPDF_Type1Font::LoadGlyphMap()
}
#endif
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
break;
}
}
@@ -1237,9 +1237,9 @@ void CPDF_Type1Font::LoadGlyphMap()
}
return;
}
- bool bUnicode = false;
+ FX_BOOL bUnicode = FALSE;
if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
- bUnicode = true;
+ bUnicode = TRUE;
}
for (int charcode = 0; charcode < 256; charcode ++) {
const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
@@ -1315,9 +1315,9 @@ void CPDF_Type1Font::LoadGlyphMap()
#endif
return;
}
- bool bUnicode = false;
+ FX_BOOL bUnicode = FALSE;
if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
- bUnicode = true;
+ bUnicode = TRUE;
}
for (int charcode = 0; charcode < 256; charcode ++) {
const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
@@ -1363,7 +1363,7 @@ CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding)
m_Unicodes[i] = pSrc[i];
}
}
-bool CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const
+FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const
{
return FXSYS_memcmp(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0;
}
@@ -1372,10 +1372,10 @@ CPDF_Object* CPDF_FontEncoding::Realize()
int predefined = 0;
for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS; cs ++) {
const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
- bool match = true;
+ FX_BOOL match = TRUE;
for (int i = 0; i < 256; ++i) {
if (m_Unicodes[i] != pSrc[i]) {
- match = false;
+ match = FALSE;
break;
}
}
@@ -1413,7 +1413,7 @@ CPDF_Object* CPDF_FontEncoding::Realize()
CPDF_TrueTypeFont::CPDF_TrueTypeFont() : CPDF_SimpleFont(PDFFONT_TRUETYPE)
{
}
-bool CPDF_TrueTypeFont::_Load()
+FX_BOOL CPDF_TrueTypeFont::_Load()
{
return LoadCommon();
}
@@ -1426,14 +1426,14 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
if (m_pFontFile && m_Font.m_Face->num_charmaps > 0
&& (baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI)
&& (m_Flags & PDFFONT_SYMBOLIC)) {
- bool bSupportWin = false;
- bool bSupportMac = false;
+ FX_BOOL bSupportWin = FALSE;
+ FX_BOOL bSupportMac = FALSE;
for (int i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.m_Face); i++) {
int platform_id = FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(m_Font.m_Face)[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) {
@@ -1459,8 +1459,8 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
return;
}
- bool bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
- bool bMacRoman = false, bMSSymbol = false;
+ FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
+ FX_BOOL bMacRoman = FALSE, bMSSymbol = FALSE;
if (!bMSUnicode) {
if (m_Flags & PDFFONT_NONSYMBOLIC) {
bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
@@ -1470,7 +1470,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
bMacRoman = !bMSSymbol && FT_UseTTCharmap(m_Font.m_Face, 1, 0);
}
}
- bool bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
+ FX_BOOL bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
for (int charcode = 0; charcode < 256; charcode ++) {
const FX_CHAR* name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
if (name == NULL) {
@@ -1523,13 +1523,13 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
for (int j = 0; j < 4; j ++) {
FX_WORD unicode = prefix[j] * 256 + charcode;
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
break;
}
}
@@ -1552,12 +1552,12 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
}
if (FT_UseTTCharmap(m_Font.m_Face, 1, 0)) {
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
}
}
if (m_pFontFile || bGotOne) {
@@ -1565,7 +1565,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
}
if (FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE) == 0) {
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
const FX_WORD* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
for (int charcode = 0; charcode < 256; charcode ++) {
if (m_pFontFile == NULL) {
@@ -1580,7 +1580,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
}
}
if (bGotOne) {
@@ -1614,7 +1614,7 @@ CPDF_Type3Font::~CPDF_Type3Font()
delete (CPDF_Type3Char*)key;
}
}
-bool CPDF_Type3Font::_Load()
+FX_BOOL CPDF_Type3Font::_Load()
{
m_pFontResources = m_pFontDict->GetDict(FX_BSTRC("Resources"));
CPDF_Array* pMatrix = m_pFontDict->GetArray(FX_BSTRC("FontMatrix"));
@@ -1648,7 +1648,7 @@ bool CPDF_Type3Font::_Load()
m_pCharProcs = m_pFontDict->GetDict(FX_BSTRC("CharProcs"));
CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
if (pEncoding) {
- LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, false, false);
+ LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE);
if (m_pCharNames) {
for (int i = 0; i < 256; i ++) {
m_Encoding.m_Unicodes[i] = PDF_UnicodeFromAdobeName(m_pCharNames[i]);
@@ -1658,7 +1658,7 @@ bool CPDF_Type3Font::_Load()
}
}
}
- return true;
+ return TRUE;
}
void CPDF_Type3Font::CheckType3FontMetrics()
{
@@ -1736,8 +1736,8 @@ CPDF_Type3Char::CPDF_Type3Char()
{
m_pForm = NULL;
m_pBitmap = NULL;
- m_bPageRequired = false;
- m_bColored = false;
+ m_bPageRequired = FALSE;
+ m_bColored = FALSE;
}
CPDF_Type3Char::~CPDF_Type3Char()
{
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 8f95e59dee..f70b9ecfc4 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -13,18 +13,18 @@
#include "font_int.h"
extern short TT2PDF(int m, FXFT_Face face);
-extern bool FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
+extern FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
CPDF_CMapManager::CPDF_CMapManager()
{
- m_bPrompted = false;
+ m_bPrompted = FALSE;
FXSYS_memset(m_CID2UnicodeMaps, 0, sizeof m_CID2UnicodeMaps);
}
CPDF_CMapManager::~CPDF_CMapManager()
{
- DropAll(false);
+ DropAll(FALSE);
}
-CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, bool bPromptCJK)
+CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
{
CPDF_CMap* pCMap;
if (m_CMaps.Lookup(name, (void*&)pCMap)) {
@@ -37,7 +37,7 @@ CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, bool
m_CMaps.SetAt(name, pCMap);
return pCMap;
}
-CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, bool bPromptCJK)
+CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
{
CPDF_CMap* pCMap = new CPDF_CMap;
const FX_CHAR* pname = name;
@@ -59,9 +59,9 @@ int _CharsetFromOrdering(const CFX_ByteString& Ordering)
}
void CPDF_CMapManager::ReloadAll()
{
- DropAll(true);
+ DropAll(TRUE);
}
-void CPDF_CMapManager::DropAll(bool bReload)
+void CPDF_CMapManager::DropAll(FX_BOOL bReload)
{
FX_POSITION pos = m_CMaps.GetStartPosition();
while (pos) {
@@ -72,7 +72,7 @@ void CPDF_CMapManager::DropAll(bool bReload)
continue;
}
if (bReload) {
- pCMap->LoadPredefined(this, name, false);
+ pCMap->LoadPredefined(this, name, FALSE);
} else {
delete pCMap;
}
@@ -83,20 +83,20 @@ void CPDF_CMapManager::DropAll(bool bReload)
continue;
}
if (bReload) {
- pMap->Load(this, i, false);
+ pMap->Load(this, i, FALSE);
} else {
delete pMap;
}
}
}
-CPDF_CID2UnicodeMap* CPDF_CMapManager::GetCID2UnicodeMap(int charset, bool bPromptCJK)
+CPDF_CID2UnicodeMap* CPDF_CMapManager::GetCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
{
if (m_CID2UnicodeMaps[charset] == NULL) {
m_CID2UnicodeMaps[charset] = LoadCID2UnicodeMap(charset, bPromptCJK);
}
return m_CID2UnicodeMaps[charset];
}
-CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(int charset, bool bPromptCJK)
+CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
{
CPDF_CID2UnicodeMap* pMap = new CPDF_CID2UnicodeMap();
if (!pMap->Initialize()) {
@@ -112,13 +112,13 @@ CPDF_CMapParser::CPDF_CMapParser()
m_Status = 0;
m_CodeSeq = 0;
}
-bool CPDF_CMapParser::Initialize(CPDF_CMap* pCMap)
+FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap)
{
m_pCMap = pCMap;
m_Status = 0;
m_CodeSeq = 0;
m_AddMaps.EstimateSize(0, 10240);
- return true;
+ return TRUE;
}
static FX_DWORD CMap_GetCode(const CFX_ByteStringC& word)
{
@@ -147,10 +147,10 @@ static FX_DWORD CMap_GetCode(const CFX_ByteStringC& word)
}
return num;
}
-static bool _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& first, const CFX_ByteStringC& second)
+static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& first, const CFX_ByteStringC& second)
{
if (first.GetLength() == 0 || first.GetAt(0) != '<') {
- return false;
+ return FALSE;
}
int i;
for (i = 1; i < first.GetLength(); i ++)
@@ -159,7 +159,7 @@ static bool _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& fi
}
range.m_CharSize = (i - 1) / 2;
if (range.m_CharSize > 4) {
- return false;
+ return FALSE;
}
for (i = 0; i < range.m_CharSize; i ++) {
uint8_t digit1 = first.GetAt(i * 2 + 1);
@@ -176,7 +176,7 @@ static bool _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& fi
byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
range.m_Upper[i] = byte;
}
- return true;
+ return TRUE;
}
static CFX_ByteString CMap_GetString(const CFX_ByteStringC& word)
{
@@ -282,7 +282,7 @@ CPDF_CMap::CPDF_CMap()
m_Coding = CIDCODING_UNKNOWN;
m_CodingScheme = TwoBytes;
m_bVertical = 0;
- m_bLoaded = false;
+ m_bLoaded = FALSE;
m_pMapping = NULL;
m_pLeadingBytes = NULL;
m_pAddMapping = NULL;
@@ -346,14 +346,14 @@ const CPDF_PredefinedCMap g_PredefinedCMaps[] = {
};
extern void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap);
extern FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode);
-bool CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, bool bPromptCJK)
+FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, FX_BOOL bPromptCJK)
{
m_PredefinedCMap = pName;
if (m_PredefinedCMap == FX_BSTRC("Identity-H") || m_PredefinedCMap == FX_BSTRC("Identity-V")) {
m_Coding = CIDCODING_CID;
m_bVertical = pName[9] == 'V';
- m_bLoaded = true;
- return true;
+ m_bLoaded = TRUE;
+ return TRUE;
}
CFX_ByteString cmapid = m_PredefinedCMap;
m_bVertical = cmapid.Right(1) == FX_BSTRC("V");
@@ -363,7 +363,7 @@ bool CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, boo
int index = 0;
while (1) {
if (g_PredefinedCMaps[index].m_pName == NULL) {
- return false;
+ return FALSE;
}
if (cmapid == CFX_ByteStringC(g_PredefinedCMaps[index].m_pName)) {
break;
@@ -384,10 +384,10 @@ bool CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, boo
}
FPDFAPI_FindEmbeddedCMap(pName, m_Charset, m_Coding, m_pEmbedMap);
if (m_pEmbedMap) {
- m_bLoaded = true;
- return true;
+ m_bLoaded = TRUE;
+ return TRUE;
}
- return false;
+ return FALSE;
}
extern "C" {
static int compare_dword(const void* data1, const void* data2)
@@ -395,7 +395,7 @@ extern "C" {
return (*(FX_DWORD*)data1) - (*(FX_DWORD*)data2);
}
};
-bool CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
+FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
{
m_pMapping = FX_Alloc(FX_WORD, 65536);
CPDF_CMapParser parser;
@@ -414,7 +414,7 @@ bool CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
FXSYS_memcpy(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize());
FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword);
}
- return true;
+ return TRUE;
}
extern "C" {
static int compareCID(const void* key, const void* element)
@@ -668,11 +668,11 @@ CPDF_CID2UnicodeMap::CPDF_CID2UnicodeMap()
CPDF_CID2UnicodeMap::~CPDF_CID2UnicodeMap()
{
}
-bool CPDF_CID2UnicodeMap::Initialize()
+FX_BOOL CPDF_CID2UnicodeMap::Initialize()
{
- return true;
+ return TRUE;
}
-bool CPDF_CID2UnicodeMap::IsLoaded()
+FX_BOOL CPDF_CID2UnicodeMap::IsLoaded()
{
return m_EmbeddedCount != 0;
}
@@ -687,7 +687,7 @@ FX_WCHAR CPDF_CID2UnicodeMap::UnicodeFromCID(FX_WORD CID)
return 0;
}
void FPDFAPI_LoadCID2UnicodeMap(int charset, const FX_WORD*& pMap, FX_DWORD& count);
-void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, int charset, bool bPromptCJK)
+void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK)
{
m_Charset = charset;
FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount);
@@ -700,8 +700,8 @@ CPDF_CIDFont::CPDF_CIDFont() : CPDF_Font(PDFFONT_CIDFONT)
m_pCID2UnicodeMap = NULL;
m_pAnsiWidths = NULL;
m_pCIDToGIDMap = NULL;
- m_bCIDIsGID = false;
- m_bAdobeCourierStd = false;
+ m_bCIDIsGID = FALSE;
+ m_bAdobeCourierStd = FALSE;
m_pTTGSUBTable = NULL;
FXSYS_memset(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT));
}
@@ -721,9 +721,9 @@ FX_WORD CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const
}
return m_pCMap->CIDFromCharCode(charcode);
}
-bool CPDF_CIDFont::IsVertWriting() const
+FX_BOOL CPDF_CIDFont::IsVertWriting() const
{
- return m_pCMap ? m_pCMap->IsVertWriting() : false;
+ return m_pCMap ? m_pCMap->IsVertWriting() : FALSE;
}
extern FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid);
static FX_DWORD _EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, int charset, FX_WCHAR unicode)
@@ -873,27 +873,27 @@ static void FT_UseCIDCharmap(FXFT_Face face, int coding)
FXFT_Set_Charmap(face, *FXFT_Get_Face_Charmaps(face));
}
}
-bool CPDF_CIDFont::_Load()
+FX_BOOL CPDF_CIDFont::_Load()
{
if (m_pFontDict->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("TrueType")) {
return LoadGB2312();
}
CPDF_Array* pFonts = m_pFontDict->GetArray(FX_BSTRC("DescendantFonts"));
if (pFonts == NULL) {
- return false;
+ return FALSE;
}
if (pFonts->GetCount() != 1) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pCIDFontDict = pFonts->GetDict(0);
if (pCIDFontDict == NULL) {
- return false;
+ return FALSE;
}
m_BaseFont = pCIDFontDict->GetString(FX_BSTRC("BaseFont"));
if ((m_BaseFont.Compare("CourierStd") == 0 || m_BaseFont.Compare("CourierStd-Bold") == 0
|| m_BaseFont.Compare("CourierStd-BoldOblique") == 0 || m_BaseFont.Compare("CourierStd-Oblique") == 0)
&& !IsEmbedded()) {
- m_bAdobeCourierStd = true;
+ m_bAdobeCourierStd = TRUE;
}
CPDF_Dictionary* pFontDesc = pCIDFontDict->GetDict(FX_BSTRC("FontDescriptor"));
if (pFontDesc) {
@@ -901,12 +901,12 @@ bool CPDF_CIDFont::_Load()
}
CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
if (pEncoding == NULL) {
- return false;
+ return FALSE;
}
CFX_ByteString subtype = pCIDFontDict->GetString(FX_BSTRC("Subtype"));
- m_bType1 = false;
+ m_bType1 = FALSE;
if (subtype == FX_BSTRC("CIDFontType0")) {
- m_bType1 = true;
+ m_bType1 = TRUE;
}
if (pEncoding->GetType() == PDFOBJ_NAME) {
CFX_ByteString cmap = pEncoding->GetString();
@@ -916,13 +916,13 @@ bool CPDF_CIDFont::_Load()
m_pAllocatedCMap = m_pCMap = new CPDF_CMap;
CPDF_Stream* pStream = (CPDF_Stream*)pEncoding;
CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, false);
+ acc.LoadAllData(pStream, FALSE);
m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize());
} else {
- return false;
+ return FALSE;
}
if (m_pCMap == NULL) {
- return false;
+ return FALSE;
}
m_Charset = m_pCMap->m_Charset;
if (m_Charset == CIDSET_UNKNOWN) {
@@ -955,14 +955,14 @@ bool CPDF_CIDFont::_Load()
if (pmap) {
if (pmap->GetType() == PDFOBJ_STREAM) {
m_pCIDToGIDMap = new CPDF_StreamAcc;
- m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, false);
+ m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, FALSE);
} else if (pmap->GetString() == FX_BSTRC("Identity")) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (m_pFontFile) {
- m_bCIDIsGID = true;
+ m_bCIDIsGID = TRUE;
}
#else
- m_bCIDIsGID = true;
+ m_bCIDIsGID = TRUE;
#endif
}
}
@@ -983,7 +983,7 @@ bool CPDF_CIDFont::_Load()
m_DefaultW1 = -1000;
}
}
- return true;
+ return TRUE;
}
FX_FLOAT _CIDTransformToFloat(uint8_t ch)
{
@@ -1001,7 +1001,7 @@ void CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
rect.top = m_CharBBox[charcode].Top;
return;
}
- bool bVert = false;
+ FX_BOOL bVert = FALSE;
int glyph_index = GlyphFromCharCode(charcode, &bVert);
if (m_Font.m_Face == NULL) {
rect = FX_RECT(0, 0, 0, 0);
@@ -1120,10 +1120,10 @@ void CPDF_CIDFont::GetVertOrigin(FX_WORD CID, short& vx, short &vy) const
vx = (short)dwWidth / 2;
vy = (short)m_DefaultVY;
}
-int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, bool *pVertGlyph)
+int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL *pVertGlyph)
{
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
int index = FXFT_Get_Char_Index(m_Font.m_Face, unicode );
if (unicode == 0x2502) {
@@ -1136,7 +1136,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, bool *pVertGlyph)
if (vindex) {
index = vindex;
if (pVertGlyph) {
- *pVertGlyph = true;
+ *pVertGlyph = TRUE;
}
}
return index;
@@ -1157,21 +1157,21 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, bool *pVertGlyph)
if (vindex) {
index = vindex;
if (pVertGlyph) {
- *pVertGlyph = true;
+ *pVertGlyph = TRUE;
}
}
}
return index;
}
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
return index;
}
-int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph)
+int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
{
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
if (m_pFontFile == NULL && m_pCIDToGIDMap == NULL) {
FX_WORD cid = CIDFromCharCode(charcode);
@@ -1206,8 +1206,8 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph)
}
charcode += 31;
int index = 0, iBaseEncoding;
- bool bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
- bool bMacRoman = false;
+ FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
+ FX_BOOL bMacRoman = FALSE;
if (!bMSUnicode) {
bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
}
@@ -1327,16 +1327,16 @@ int CPDF_CIDFont::AppendChar(FX_CHAR* str, FX_DWORD charcode) const
{
return m_pCMap->AppendChar(str, charcode);
}
-bool CPDF_CIDFont::IsUnicodeCompatible() const
+FX_BOOL CPDF_CIDFont::IsUnicodeCompatible() const
{
if (!m_pCMap->IsLoaded() || m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
return m_pCMap->m_Coding != CIDCODING_UNKNOWN;
}
- return true;
+ return TRUE;
}
-bool CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const
+FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const
{
- return true;
+ return TRUE;
}
void CPDF_CIDFont::LoadSubstFont()
{
@@ -1390,7 +1390,7 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result,
}
}
}
-bool CPDF_CIDFont::LoadGB2312()
+FX_BOOL CPDF_CIDFont::LoadGB2312()
{
m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
@@ -1398,10 +1398,10 @@ bool CPDF_CIDFont::LoadGB2312()
LoadFontDescriptor(pFontDesc);
}
m_Charset = CIDSET_GB1;
- m_bType1 = false;
+ m_bType1 = FALSE;
m_pCMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetPredefinedCMap(
- FX_BSTRC("GBK-EUC-H"), false);
- m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset, false);
+ FX_BSTRC("GBK-EUC-H"), FALSE);
+ m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset, FALSE);
if (!IsEmbedded()) {
LoadSubstFont();
}
@@ -1411,7 +1411,7 @@ bool CPDF_CIDFont::LoadGB2312()
for (int i = 32; i < 127; i ++) {
m_pAnsiWidths[i] = 500;
}
- return true;
+ return TRUE;
}
const struct _CIDTransform {
FX_WORD CID;
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index 980e16c43e..a65359c1d4 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -48,15 +48,15 @@ void CFX_GlyphMap::SetAt(int key, int value)
}
m_Buffer.InsertBlock(low * sizeof(_IntPair), &pair, sizeof(_IntPair));
}
-bool CFX_GlyphMap::Lookup(int key, int &value)
+FX_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 == NULL) {
- return false;
+ return FALSE;
}
value = ((FX_DWORD*)pResult)[1];
- return true;
+ return TRUE;
}
bool CFX_CTTGSUBTable::LoadGSUBTable(FT_Bytes gsub)
{
@@ -108,7 +108,7 @@ bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t *vglyp
}
}
}
- m_bFeautureMapLoad = true;
+ m_bFeautureMapLoad = TRUE;
}
FX_POSITION pos = m_featureMap.GetStartPosition();
while (pos) {
@@ -420,7 +420,7 @@ void CFX_CTTGSUBTable::ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2
rec->Substitute[i] = GetUInt16(sp);
}
}
-bool CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
+FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
{
return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum);
}
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index 133667b4d8..1b18f82d6e 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -17,15 +17,15 @@ public:
CFX_GlyphMap();
~CFX_GlyphMap();
void SetAt(int key, int value);
- bool Lookup(int key, int &value);
+ FX_BOOL Lookup(int key, int &value);
protected:
CFX_BinaryBuf m_Buffer;
};
class CFX_CTTGSUBTable
{
public:
- CFX_CTTGSUBTable(void): m_bFeautureMapLoad(false), loaded(false) {};
- CFX_CTTGSUBTable(FT_Bytes gsub): m_bFeautureMapLoad(false), loaded(false)
+ CFX_CTTGSUBTable(void): m_bFeautureMapLoad(FALSE), loaded(false) {};
+ CFX_CTTGSUBTable(FT_Bytes gsub): m_bFeautureMapLoad(FALSE), loaded(false)
{
LoadGSUBTable(gsub);
}
@@ -395,7 +395,7 @@ private:
return ret;
}
CFX_CMapDWordToDWord m_featureMap;
- bool m_bFeautureMapLoad;
+ FX_BOOL m_bFeautureMapLoad;
bool loaded;
struct tt_gsub_header header;
struct TScriptList ScriptList;
@@ -406,7 +406,7 @@ class CFX_GSUBTable final : public IFX_GSUBTable
{
public:
~CFX_GSUBTable() override {}
- virtual bool GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) override;
+ virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) override;
CFX_CTTGSUBTable m_GsubImp;
};