Index: core/src/fxge/ge/fx_ge_fontmap.cpp |
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp |
index acae306d6ff644d17acdf9379271eec2f8357c72..4df7def3b9cad77ee81cdb6768204a91bf5a087b 100644 |
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp |
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp |
@@ -38,7 +38,7 @@ CTTFontDesc::~CTTFontDesc() |
FX_Free(m_pFontData); |
} |
} |
-FX_INT32 CTTFontDesc::ReleaseFace(FXFT_Face face) |
+int32_t CTTFontDesc::ReleaseFace(FXFT_Face face) |
{ |
if (m_Type == 1) { |
if (m_SingleFace.m_pFace != face) { |
@@ -582,7 +582,7 @@ CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont) |
CFX_ByteString result; |
FX_DWORD size = m_pFontInfo->GetFontData(hFont, 0x6e616d65, NULL, 0); |
if (size) { |
- FX_LPBYTE buffer = FX_Alloc(FX_BYTE, size); |
+ FX_LPBYTE buffer = FX_Alloc(uint8_t, size); |
m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size); |
result = _FPDF_GetNameFromTT(buffer, 6); |
FX_Free(buffer); |
@@ -661,7 +661,7 @@ CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_na |
return match; |
} |
typedef struct _CHARSET_MAP_ { |
- FX_BYTE charset; |
+ uint8_t charset; |
FX_WORD codepage; |
} CHARSET_MAP; |
static const CHARSET_MAP g_Codepage2CharsetTable[] = { |
@@ -697,11 +697,11 @@ static const CHARSET_MAP g_Codepage2CharsetTable[] = { |
{ 88, 10029 }, |
{ 89, 10007 }, |
}; |
-FX_BYTE _GetCharsetFromCodePage(FX_WORD codepage) |
+uint8_t _GetCharsetFromCodePage(FX_WORD codepage) |
{ |
- FX_INT32 iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1; |
+ int32_t iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1; |
FXSYS_assert(iEnd >= 0); |
- FX_INT32 iStart = 0, iMid; |
+ int32_t iStart = 0, iMid; |
do { |
iMid = (iStart + iEnd) / 2; |
const CHARSET_MAP & cp = g_Codepage2CharsetTable[iMid]; |
@@ -841,7 +841,7 @@ static CFX_ByteString _GetFontFamily(CFX_ByteString fontName, int nStyle) |
}; |
typedef struct _FX_FontStyle { |
FX_LPCSTR style; |
- FX_INT32 len; |
+ int32_t len; |
} FX_FontStyle; |
const FX_FontStyle g_FontStyles[] = { |
{ "Bold", 4 }, |
@@ -865,9 +865,9 @@ CFX_ByteString ParseStyle(FX_LPCSTR pStyle, int iLen, int iIndex) |
} |
return buf.GetByteString(); |
} |
-FX_INT32 GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert) |
+int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert) |
{ |
- FX_INT32 iLen = bsStyle.GetLength(); |
+ int32_t iLen = bsStyle.GetLength(); |
if (!iLen) { |
return -1; |
} |
@@ -985,7 +985,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru |
} |
if (!bHasHypen) { |
int nLen = family.GetLength(); |
- FX_INT32 nRet = GetStyleType(family, TRUE); |
+ int32_t nRet = GetStyleType(family, TRUE); |
if (nRet > -1) { |
family = family.Left(nLen - g_FontStyles[nRet].len); |
if (nRet == 0) { |
@@ -1017,7 +1017,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru |
CFX_ByteString buf; |
while (i < nLen) { |
buf = ParseStyle(pStyle, nLen, i); |
- FX_INT32 nRet = GetStyleType(buf, FALSE); |
+ int32_t nRet = GetStyleType(buf, FALSE); |
if ((i && !bStyleAvail) || (!i && nRet < 0)) { |
family = SubstName; |
iBaseFont = 12; |
@@ -1218,7 +1218,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru |
} |
FXFT_Face face = NULL; |
if (ttc_size) { |
- FX_BYTE temp[1024]; |
+ uint8_t temp[1024]; |
m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024); |
FX_DWORD checksum = 0; |
for (int i = 0; i < 256; i ++) { |
@@ -1227,7 +1227,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru |
FX_LPBYTE pFontData; |
face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData); |
if (face == NULL) { |
- pFontData = FX_Alloc(FX_BYTE, ttc_size); |
+ pFontData = FX_Alloc(uint8_t, ttc_size); |
m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size); |
face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size, |
ttc_size - font_size); |
@@ -1236,7 +1236,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru |
FX_LPBYTE pFontData; |
face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData); |
if (face == NULL) { |
- pFontData = FX_Alloc(FX_BYTE, font_size); |
+ pFontData = FX_Alloc(uint8_t, font_size); |
m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size); |
face = m_pFontMgr->AddCachedFace(SubstName, weight, bItalic, pFontData, font_size, m_pFontInfo->GetFaceIndex(hFont)); |
} |
@@ -1303,7 +1303,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl |
} |
FXFT_Face face = NULL; |
if (ttc_size) { |
- FX_BYTE temp[1024]; |
+ uint8_t temp[1024]; |
m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024); |
FX_DWORD checksum = 0; |
for (int i = 0; i < 256; i ++) { |
@@ -1312,7 +1312,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl |
FX_LPBYTE pFontData; |
face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData); |
if (face == NULL) { |
- pFontData = FX_Alloc(FX_BYTE, ttc_size); |
+ pFontData = FX_Alloc(uint8_t, ttc_size); |
if (pFontData) { |
m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size); |
face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size, |
@@ -1325,7 +1325,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD fl |
FX_LPBYTE pFontData; |
face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData); |
if (face == NULL) { |
- pFontData = FX_Alloc(FX_BYTE, font_size); |
+ pFontData = FX_Alloc(uint8_t, font_size); |
if (!pFontData) { |
m_pFontInfo->DeleteFont(hFont); |
return NULL; |
@@ -1454,7 +1454,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path) |
} |
FXSYS_fseek(pFile, 0, FXSYS_SEEK_END); |
FX_DWORD filesize = FXSYS_ftell(pFile); |
- FX_BYTE buffer[16]; |
+ uint8_t buffer[16]; |
FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET); |
size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile); |
if (readCnt != 1) { |
@@ -1469,7 +1469,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path) |
return; |
} |
FX_DWORD face_bytes = nFaces * 4; |
- FX_LPBYTE offsets = FX_Alloc(FX_BYTE, face_bytes); |
+ FX_LPBYTE offsets = FX_Alloc(uint8_t, face_bytes); |
readCnt = FXSYS_fread(offsets, face_bytes, 1, pFile); |
if (readCnt != face_bytes) { |
FX_Free(offsets); |