summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 11:30:25 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 11:30:25 -0700
commitbb17868d736f698d5217c30d52c5bbfed62c5936 (patch)
tree9d4d3e2538a81e6241d4992570bc3f3c1af71d28 /core/src/fpdfapi/fpdf_font
parentbf6c2a4873f8cc12ad910fb904218a78087a3735 (diff)
downloadpdfium-bb17868d736f698d5217c30d52c5bbfed62c5936.tar.xz
Use stdint.h types throughout PDFium.
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/common.h6
-rw-r--r--core/src/fpdfapi/fpdf_font/font_int.h16
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp34
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp68
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp6
6 files changed, 71 insertions, 71 deletions
diff --git a/core/src/fpdfapi/fpdf_font/common.h b/core/src/fpdfapi/fpdf_font/common.h
index 923a394662..57461d1908 100644
--- a/core/src/fpdfapi/fpdf_font/common.h
+++ b/core/src/fpdfapi/fpdf_font/common.h
@@ -11,9 +11,9 @@ typedef signed char TT_int8_t;
typedef unsigned char TT_uint8_t;
typedef signed short TT_int16_t;
typedef unsigned short TT_uint16_t;
-typedef FX_INT32 TT_int32_t;
+typedef int32_t TT_int32_t;
typedef FX_DWORD TT_uint32_t;
-typedef FX_INT64 TT_int64_t;
-typedef FX_UINT64 TT_uint64_t;
+typedef int64_t TT_int64_t;
+typedef uint64_t TT_uint64_t;
#endif // CORE_SRC_FPDFAPI_FPDF_FONT_COMMON_H_
diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h
index 697ccffafd..1e52607d98 100644
--- a/core/src/fpdfapi/fpdf_font/font_int.h
+++ b/core/src/fpdfapi/fpdf_font/font_int.h
@@ -48,8 +48,8 @@ private:
};
struct _CMap_CodeRange {
int m_CharSize;
- FX_BYTE m_Lower[4];
- FX_BYTE m_Upper[4];
+ uint8_t m_Lower[4];
+ uint8_t m_Upper[4];
};
class CPDF_CMapParser
{
@@ -113,7 +113,7 @@ protected:
int m_Charset, m_Coding;
CodingScheme m_CodingScheme;
int m_nCodeRanges;
- FX_BYTE* m_pLeadingBytes;
+ uint8_t* m_pLeadingBytes;
FX_WORD* m_pMapping;
FX_LPBYTE m_pAddMapping;
FX_BOOL m_bLoaded;
@@ -128,13 +128,13 @@ public:
int m_Coding;
CPDF_CMap::CodingScheme m_CodingScheme;
FX_DWORD m_LeadingSegCount;
- FX_BYTE m_LeadingSegs[4];
+ uint8_t m_LeadingSegs[4];
};
typedef struct _FileHeader {
- FX_BYTE btTag[4];
- FX_BYTE btVersion;
- FX_BYTE btFormat;
- FX_BYTE btReserved1[2];
+ uint8_t btTag[4];
+ uint8_t btVersion;
+ uint8_t btFormat;
+ uint8_t btReserved1[2];
FX_DWORD dwStartIndex;
FX_DWORD dwEndIndex;
FX_DWORD dwDataSize;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 80dd1df803..0058e140d4 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -412,7 +412,7 @@ CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc, FX_BSTR name)
pFontGlobals->Set(pDoc, font_id, pFont);
return pFont;
}
-const FX_BYTE ChineseFontNames[][5] = {
+const uint8_t ChineseFontNames[][5] = {
{0xCB, 0xCE, 0xCC, 0xE5, 0x00},
{0xBF, 0xAC, 0xCC, 0xE5, 0x00},
{0xBA, 0xDA, 0xCC, 0xE5, 0x00},
@@ -816,7 +816,7 @@ FX_BOOL CPDF_Font::IsStandardFont() const
}
return TRUE;
}
-extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode);
+extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode);
CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype)
{
FXSYS_memset8(m_CharBBox, 0xff, sizeof m_CharBBox);
@@ -838,7 +838,7 @@ int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
if (charcode > 0xff) {
return -1;
}
- int index = m_GlyphIndex[(FX_BYTE)charcode];
+ int index = m_GlyphIndex[(uint8_t)charcode];
if (index == 0xffff) {
return -1;
}
@@ -892,14 +892,14 @@ int CPDF_SimpleFont::GetCharWidthF(FX_DWORD charcode, int level)
m_CharWidth[charcode] = 0;
}
}
- return (FX_INT16)m_CharWidth[charcode];
+ return (int16_t)m_CharWidth[charcode];
}
void CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
{
if (charcode > 0xff) {
charcode = 0;
}
- if (m_CharBBox[charcode].Left == (FX_SHORT)0xffff) {
+ if (m_CharBBox[charcode].Left == (int16_t)0xffff) {
LoadCharMetrics(charcode);
}
rect.left = m_CharBBox[charcode].Left;
@@ -1073,7 +1073,7 @@ int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode)
if (charcode > 0xff) {
return -1;
}
- int index = m_ExtGID[(FX_BYTE)charcode];
+ int index = m_ExtGID[(uint8_t)charcode];
if (index == 0xffff) {
return -1;
}
@@ -1130,7 +1130,7 @@ void CPDF_Type1Font::LoadGlyphMap()
if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
- const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
+ const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
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);
@@ -1482,7 +1482,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
if (bMSSymbol) {
- const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
+ const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
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);
@@ -1525,7 +1525,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
return;
}
if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
- const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
+ const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
for (int j = 0; j < 4; j ++) {
@@ -1627,10 +1627,10 @@ FX_BOOL CPDF_Type3Font::_Load()
}
CPDF_Array* pBBox = m_pFontDict->GetArray(FX_BSTRC("FontBBox"));
if (pBBox) {
- m_FontBBox.left = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(0), xscale) * 1000);
- m_FontBBox.bottom = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(1), yscale) * 1000);
- m_FontBBox.right = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(2), xscale) * 1000);
- m_FontBBox.top = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(3), yscale) * 1000);
+ m_FontBBox.left = (int32_t)(FXSYS_Mul(pBBox->GetNumber(0), xscale) * 1000);
+ m_FontBBox.bottom = (int32_t)(FXSYS_Mul(pBBox->GetNumber(1), yscale) * 1000);
+ m_FontBBox.right = (int32_t)(FXSYS_Mul(pBBox->GetNumber(2), xscale) * 1000);
+ m_FontBBox.top = (int32_t)(FXSYS_Mul(pBBox->GetNumber(3), yscale) * 1000);
}
int StartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"));
CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
@@ -1671,10 +1671,10 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
return NULL;
}
CPDF_Type3Char* pChar = NULL;
- if (m_CacheMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (FX_LPVOID&)pChar)) {
+ if (m_CacheMap.Lookup((FX_LPVOID)(uintptr_t)charcode, (FX_LPVOID&)pChar)) {
if (pChar->m_bPageRequired && m_pPageResources) {
delete pChar;
- m_CacheMap.RemoveKey((FX_LPVOID)(FX_UINTPTR)charcode);
+ m_CacheMap.RemoveKey((FX_LPVOID)(uintptr_t)charcode);
return LoadChar(charcode, level + 1);
}
return pChar;
@@ -1691,7 +1691,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
pChar->m_pForm = new CPDF_Form(m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, NULL);
pChar->m_pForm->ParseContent(NULL, NULL, pChar, NULL, level + 1);
FX_FLOAT scale = m_FontMatrix.GetXUnit();
- pChar->m_Width = (FX_INT32)(pChar->m_Width * scale + 0.5f);
+ pChar->m_Width = (int32_t)(pChar->m_Width * scale + 0.5f);
FX_RECT &rcBBox = pChar->m_BBox;
CFX_FloatRect char_rect((FX_FLOAT)rcBBox.left / 1000.0f, (FX_FLOAT)rcBBox.bottom / 1000.0f,
(FX_FLOAT)rcBBox.right / 1000.0f, (FX_FLOAT)rcBBox.top / 1000.0f);
@@ -1703,7 +1703,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
rcBBox.right = FXSYS_round(char_rect.right * 1000);
rcBBox.top = FXSYS_round(char_rect.top * 1000);
rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000);
- m_CacheMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pChar);
+ m_CacheMap.SetAt((FX_LPVOID)(uintptr_t)charcode, pChar);
if (pChar->m_pForm->CountObjects() == 0) {
delete pChar->m_pForm;
pChar->m_pForm = NULL;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
index c7110d39c9..8e8fccd8a3 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
@@ -475,7 +475,7 @@ const FX_LPCSTR ZapfEncodingNames[224] = {
NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198",
"a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL
};
-const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode)
+const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode)
{
if (encoding == PDFFONT_ENCODING_PDFDOC) {
if (charcode < 24) {
@@ -512,15 +512,15 @@ FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode)
case FXFT_ENCODING_UNICODE:
return (FX_WORD)charcode;
case FXFT_ENCODING_ADOBE_STANDARD:
- return StandardEncoding[(FX_BYTE)charcode];
+ return StandardEncoding[(uint8_t)charcode];
case FXFT_ENCODING_ADOBE_EXPERT:
- return MacExpertEncoding[(FX_BYTE)charcode];
+ return MacExpertEncoding[(uint8_t)charcode];
case FXFT_ENCODING_ADOBE_LATIN_1:
- return AdobeWinAnsiEncoding[(FX_BYTE)charcode];
+ return AdobeWinAnsiEncoding[(uint8_t)charcode];
case FXFT_ENCODING_APPLE_ROMAN:
- return MacRomanEncoding[(FX_BYTE)charcode];
+ return MacRomanEncoding[(uint8_t)charcode];
case PDFFONT_ENCODING_PDFDOC:
- return PDFDocEncoding[(FX_BYTE)charcode];
+ return PDFDocEncoding[(uint8_t)charcode];
}
return 0;
}
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index a08660c52f..a6209cb536 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -124,7 +124,7 @@ static FX_DWORD CMap_GetCode(FX_BSTR word)
int num = 0;
if (word.GetAt(0) == '<') {
for (int i = 1; i < word.GetLength(); i ++) {
- FX_BYTE digit = word.GetAt(i);
+ uint8_t digit = word.GetAt(i);
if (digit >= '0' && digit <= '9') {
digit = digit - '0';
} else if (digit >= 'a' && digit <= 'f') {
@@ -161,17 +161,17 @@ static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR
return FALSE;
}
for (i = 0; i < range.m_CharSize; i ++) {
- FX_BYTE digit1 = first.GetAt(i * 2 + 1);
- FX_BYTE digit2 = first.GetAt(i * 2 + 2);
- FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
+ uint8_t digit1 = first.GetAt(i * 2 + 1);
+ uint8_t digit2 = first.GetAt(i * 2 + 2);
+ uint8_t byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
range.m_Lower[i] = byte;
}
FX_DWORD size = second.GetLength();
for (i = 0; i < range.m_CharSize; i ++) {
- FX_BYTE digit1 = ((FX_DWORD)i * 2 + 1 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 1) : 0;
- FX_BYTE digit2 = ((FX_DWORD)i * 2 + 2 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 2) : 0;
- FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
+ uint8_t digit1 = ((FX_DWORD)i * 2 + 1 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 1) : 0;
+ uint8_t digit2 = ((FX_DWORD)i * 2 + 2 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 2) : 0;
+ uint8_t byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
range.m_Upper[i] = byte;
}
@@ -254,7 +254,7 @@ void CPDF_CMapParser::ParseWord(FX_BSTR word)
if (nSegs > 1) {
m_pCMap->m_CodingScheme = CPDF_CMap::MixedFourBytes;
m_pCMap->m_nCodeRanges = nSegs;
- m_pCMap->m_pLeadingBytes = FX_Alloc2D(FX_BYTE, nSegs, sizeof(_CMap_CodeRange));
+ m_pCMap->m_pLeadingBytes = FX_Alloc2D(uint8_t, nSegs, sizeof(_CMap_CodeRange));
FXSYS_memcpy32(m_pCMap->m_pLeadingBytes, m_CodeRanges.GetData(), nSegs * sizeof(_CMap_CodeRange));
} else if (nSegs == 1) {
m_pCMap->m_CodingScheme = (m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte;
@@ -376,7 +376,7 @@ FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, FX_LPCSTR pName, FX_BO
m_Coding = map.m_Coding;
m_CodingScheme = map.m_CodingScheme;
if (m_CodingScheme == MixedTwoBytes) {
- m_pLeadingBytes = FX_Alloc(FX_BYTE, 256);
+ m_pLeadingBytes = FX_Alloc(uint8_t, 256);
for (FX_DWORD i = 0; i < map.m_LeadingSegCount; i ++) {
for (int b = map.m_LeadingSegs[i * 2]; b <= map.m_LeadingSegs[i * 2 + 1]; b ++) {
m_pLeadingBytes[b] = 1;
@@ -410,7 +410,7 @@ FX_BOOL CPDF_CMap::LoadEmbedded(FX_LPCBYTE pData, FX_DWORD size)
parser.ParseWord(word);
}
if (m_CodingScheme == MixedFourBytes && parser.m_AddMaps.GetSize()) {
- m_pAddMapping = FX_Alloc(FX_BYTE, parser.m_AddMaps.GetSize() + 4);
+ m_pAddMapping = FX_Alloc(uint8_t, parser.m_AddMaps.GetSize() + 4);
*(FX_DWORD*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8;
FXSYS_memcpy32(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize());
FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword);
@@ -500,15 +500,15 @@ FX_DWORD CPDF_CMap::GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) con
offset += 2;
return ((FX_LPBYTE)pString)[offset - 2] * 256 + ((FX_LPBYTE)pString)[offset - 1];
case MixedTwoBytes: {
- FX_BYTE byte1 = ((FX_LPBYTE)pString)[offset++];
+ uint8_t byte1 = ((FX_LPBYTE)pString)[offset++];
if (!m_pLeadingBytes[byte1]) {
return byte1;
}
- FX_BYTE byte2 = ((FX_LPBYTE)pString)[offset++];
+ uint8_t byte2 = ((FX_LPBYTE)pString)[offset++];
return byte1 * 256 + byte2;
}
case MixedFourBytes: {
- FX_BYTE codes[4];
+ uint8_t codes[4];
int char_size = 1;
codes[0] = ((FX_LPBYTE)pString)[offset++];
_CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes;
@@ -589,10 +589,10 @@ int _GetCharSize(FX_DWORD charcode, _CMap_CodeRange* pRanges, int iRangesSize)
if (!iRangesSize) {
return 1;
}
- FX_BYTE codes[4];
+ uint8_t codes[4];
codes[0] = codes[1] = 0x00;
- codes[2] = (FX_BYTE)(charcode >> 8 & 0xFF);
- codes[3] = (FX_BYTE)charcode;
+ codes[2] = (uint8_t)(charcode >> 8 & 0xFF);
+ codes[3] = (uint8_t)charcode;
int offset = 0, size = 4;
for (int i = 0; i < 4; ++i) {
int iSeg = iRangesSize - 1;
@@ -623,11 +623,11 @@ int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
{
switch (m_CodingScheme) {
case OneByte:
- str[0] = (FX_BYTE)charcode;
+ str[0] = (uint8_t)charcode;
return 1;
case TwoBytes:
- str[0] = (FX_BYTE)(charcode / 256);
- str[1] = (FX_BYTE)(charcode % 256);
+ str[0] = (uint8_t)(charcode / 256);
+ str[1] = (uint8_t)(charcode % 256);
return 2;
case MixedTwoBytes:
case MixedFourBytes:
@@ -638,24 +638,24 @@ int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
iSize = 1;
}
if (iSize > 1) {
- FXSYS_memset32(str, 0, sizeof(FX_BYTE) * iSize);
+ FXSYS_memset32(str, 0, sizeof(uint8_t) * iSize);
}
- str[iSize - 1] = (FX_BYTE)charcode;
+ str[iSize - 1] = (uint8_t)charcode;
return iSize;
} else if (charcode < 0x10000) {
- str[0] = (FX_BYTE)(charcode >> 8);
- str[1] = (FX_BYTE)charcode;
+ str[0] = (uint8_t)(charcode >> 8);
+ str[1] = (uint8_t)charcode;
return 2;
} else if (charcode < 0x1000000) {
- str[0] = (FX_BYTE)(charcode >> 16);
- str[1] = (FX_BYTE)(charcode >> 8);
- str[2] = (FX_BYTE)charcode;
+ str[0] = (uint8_t)(charcode >> 16);
+ str[1] = (uint8_t)(charcode >> 8);
+ str[2] = (uint8_t)charcode;
return 3;
} else {
- str[0] = (FX_BYTE)(charcode >> 24);
- str[1] = (FX_BYTE)(charcode >> 16);
- str[2] = (FX_BYTE)(charcode >> 8);
- str[3] = (FX_BYTE)charcode;
+ str[0] = (uint8_t)(charcode >> 24);
+ str[1] = (uint8_t)(charcode >> 16);
+ str[2] = (uint8_t)(charcode >> 8);
+ str[3] = (uint8_t)charcode;
return 4;
}
}
@@ -837,7 +837,7 @@ FX_DWORD CPDF_CIDFont::_CharCodeFromUnicode(FX_WCHAR unicode) const
return 0;
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_BYTE buffer[32];
+ uint8_t buffer[32];
int ret = FXSYS_WideCharToMultiByte(g_CharsetCPs[m_pCMap->m_Coding], 0, &unicode, 1, (char*)buffer, 4, NULL, NULL);
if (ret == 1) {
return buffer[0];
@@ -990,7 +990,7 @@ FX_BOOL CPDF_CIDFont::_Load()
}
return TRUE;
}
-FX_FLOAT _CIDTransformToFloat(FX_BYTE ch)
+FX_FLOAT _CIDTransformToFloat(uint8_t ch)
{
if (ch < 128) {
return ch * 1.0f / 127;
@@ -1150,7 +1150,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL *pVertGlyph)
unsigned long length = 0;
int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
if (!error) {
- m_Font.m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length);
+ m_Font.m_pGsubData = (unsigned char*)FX_Alloc(uint8_t, length);
}
}
int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, m_Font.m_pGsubData, NULL);
@@ -1421,7 +1421,7 @@ FX_BOOL CPDF_CIDFont::LoadGB2312()
}
const struct _CIDTransform {
FX_WORD CID;
- FX_BYTE a, b, c, d, e, f;
+ uint8_t a, b, c, d, e, f;
}
Japan1_VertCIDs[] = {
{97, 129, 0, 0, 127, 55, 0},
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index ae67d2f0ef..ab15c47cb3 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -20,8 +20,8 @@ extern "C" {
}
};
struct _IntPair {
- FX_INT32 key;
- FX_INT32 value;
+ int32_t key;
+ int32_t value;
};
void CFX_GlyphMap::SetAt(int key, int value)
{
@@ -431,7 +431,7 @@ IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont)
unsigned long length = 0;
int error = FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
if (!error) {
- pFont->m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length);
+ pFont->m_pGsubData = (unsigned char*)FX_Alloc(uint8_t, length);
}
if (!pFont->m_pGsubData) {
return NULL;