summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-21 15:00:20 -0700
committerTom Sepez <tsepez@chromium.org>2016-03-21 15:00:20 -0700
commit62a70f90c49cf7714c960186eb063ad55333e6f3 (patch)
tree84b5d0f70b770e6a9ec261342d46638f4d5102bd /core/fpdfapi/fpdf_font
parent4161c5ca6c5438476bf07b6dacfafb61ea611cc5 (diff)
downloadpdfium-62a70f90c49cf7714c960186eb063ad55333e6f3.tar.xz
Remove FX_WORD in favor of uint16_t.
It isn't buying us anthing, and it looks strange in a struct when other uint types are already present. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1821043003 .
Diffstat (limited to 'core/fpdfapi/fpdf_font')
-rw-r--r--core/fpdfapi/fpdf_font/font_int.h14
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font.cpp18
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font_charset.cpp24
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font_cid.cpp63
4 files changed, 60 insertions, 59 deletions
diff --git a/core/fpdfapi/fpdf_font/font_int.h b/core/fpdfapi/fpdf_font/font_int.h
index 8ceefe353e..c9981387e6 100644
--- a/core/fpdfapi/fpdf_font/font_int.h
+++ b/core/fpdfapi/fpdf_font/font_int.h
@@ -71,7 +71,7 @@ class CPDF_FontGlobals {
int m_Count;
} m_EmbeddedCharsets[CIDSET_NUM_SETS];
struct {
- const FX_WORD* m_pMap;
+ const uint16_t* m_pMap;
int m_Count;
} m_EmbeddedToUnicodes[CIDSET_NUM_SETS];
@@ -128,8 +128,8 @@ class CPDF_CMap {
void Release();
FX_BOOL IsLoaded() const { return m_bLoaded; }
FX_BOOL IsVertWriting() const { return m_bVertical; }
- FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
- FX_DWORD CharCodeFromCID(FX_WORD CID) const;
+ uint16_t CIDFromCharCode(FX_DWORD charcode) const;
+ FX_DWORD CharCodeFromCID(uint16_t CID) const;
int GetCharSize(FX_DWORD charcode) const;
FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const;
int CountChar(const FX_CHAR* pString, int size) const;
@@ -155,7 +155,7 @@ class CPDF_CMap {
CodingScheme m_CodingScheme;
int m_nCodeRanges;
uint8_t* m_pLeadingBytes;
- FX_WORD* m_pMapping;
+ uint16_t* m_pMapping;
uint8_t* m_pAddMapping;
FX_BOOL m_bLoaded;
const FXCMAP_CMap* m_pEmbedMap;
@@ -169,11 +169,11 @@ class CPDF_CID2UnicodeMap {
FX_BOOL Initialize();
FX_BOOL IsLoaded();
void Load(CPDF_CMapManager* pMgr, CIDSet charset, FX_BOOL bPromptCJK);
- FX_WCHAR UnicodeFromCID(FX_WORD CID);
+ FX_WCHAR UnicodeFromCID(uint16_t CID);
protected:
CIDSet m_Charset;
- const FX_WORD* m_pEmbeddedMap;
+ const uint16_t* m_pEmbeddedMap;
FX_DWORD m_EmbeddedCount;
};
@@ -197,7 +197,7 @@ class CPDF_ToUnicodeMap {
};
void FPDFAPI_LoadCID2UnicodeMap(CIDSet charset,
- const FX_WORD*& pMap,
+ const uint16_t*& pMap,
FX_DWORD& count);
#endif // CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_
diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp
index 0f58bcba09..d079110679 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -531,7 +531,7 @@ CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode) {
return CFX_WideString(buf + index + 1, len);
}
if (m_pBaseMap) {
- return m_pBaseMap->UnicodeFromCID((FX_WORD)charcode);
+ return m_pBaseMap->UnicodeFromCID((uint16_t)charcode);
}
return CFX_WideString();
}
@@ -1106,7 +1106,7 @@ void CPDF_Type1Font::LoadGlyphMap() {
for (int charcode = 0; charcode < 256; charcode++) {
const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
for (int j = 0; j < 4; j++) {
- FX_WORD unicode = prefix[j] * 256 + charcode;
+ uint16_t unicode = prefix[j] * 256 + charcode;
m_GlyphIndex[charcode] =
FXFT_Get_Char_Index(m_Font.GetFace(), unicode);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -1383,7 +1383,7 @@ int CPDF_FontEncoding::CharCodeFromUnicode(FX_WCHAR unicode) const {
}
CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding) {
- const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding);
+ const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding);
if (!pSrc) {
FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes));
} else {
@@ -1401,7 +1401,7 @@ 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);
+ const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
FX_BOOL match = TRUE;
for (int i = 0; i < 256; ++i) {
if (m_Unicodes[i] != pSrc[i]) {
@@ -1426,7 +1426,7 @@ CPDF_Object* CPDF_FontEncoding::Realize() {
}
return NULL;
}
- const FX_WORD* pStandard =
+ const uint16_t* pStandard =
PDF_UnicodesForPredefinedCharSet(PDFFONT_ENCODING_WINANSI);
CPDF_Array* pDiff = new CPDF_Array;
for (int i = 0; i < 256; i++) {
@@ -1503,7 +1503,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
for (; charcode < nStartChar; charcode++) {
m_GlyphIndex[charcode] = 0;
}
- FX_WORD nGlyph = charcode - nStartChar + 3;
+ uint16_t nGlyph = charcode - nStartChar + 3;
for (; charcode < 256; charcode++, nGlyph++) {
m_GlyphIndex[charcode] = nGlyph;
}
@@ -1533,7 +1533,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
if (bMSSymbol) {
const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
for (int j = 0; j < 4; j++) {
- FX_WORD unicode = prefix[j] * 256 + charcode;
+ uint16_t unicode = prefix[j] * 256 + charcode;
m_GlyphIndex[charcode] =
FXFT_Get_Char_Index(m_Font.GetFace(), unicode);
if (m_GlyphIndex[charcode]) {
@@ -1587,7 +1587,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
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;
+ uint16_t unicode = prefix[j] * 256 + charcode;
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), unicode);
if (m_GlyphIndex[charcode]) {
bGotOne = TRUE;
@@ -1630,7 +1630,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
}
if (FXFT_Select_Charmap(m_Font.GetFace(), FXFT_ENCODING_UNICODE) == 0) {
FX_BOOL bGotOne = FALSE;
- const FX_WORD* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
+ const uint16_t* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
for (int charcode = 0; charcode < 256; charcode++) {
if (m_pFontFile) {
m_Encoding.m_Unicodes[charcode] = charcode;
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_charset.cpp b/core/fpdfapi/fpdf_font/fpdf_font_charset.cpp
index 642efd62ca..1b503c69a6 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_charset.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_charset.cpp
@@ -9,7 +9,7 @@
#include "core/include/fxge/fx_freetype.h"
static const struct _UnicodeAlt {
- FX_WORD m_Unicode;
+ uint16_t m_Unicode;
const FX_CHAR* m_Alter;
} UnicodeAlts[] = {
{0x00a0, " "}, {0x00a1, "!"}, {0x00a2, "c"}, {0x00a3, "P"},
@@ -60,7 +60,7 @@ const FX_CHAR* FCS_GetAltStr(FX_WCHAR unicode) {
int end = sizeof UnicodeAlts / sizeof(struct _UnicodeAlt) - 1;
while (begin <= end) {
int middle = (begin + end) / 2;
- FX_WORD middlecode = UnicodeAlts[middle].m_Unicode;
+ uint16_t middlecode = UnicodeAlts[middle].m_Unicode;
if (middlecode > unicode) {
end = middle - 1;
} else if (middlecode < unicode) {
@@ -71,7 +71,7 @@ const FX_CHAR* FCS_GetAltStr(FX_WCHAR unicode) {
}
return NULL;
}
-static const FX_WORD StandardEncoding[256] = {
+static const uint16_t StandardEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -101,7 +101,7 @@ static const FX_WORD StandardEncoding[256] = {
0x0152, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00e6, 0x0000,
0x0000, 0x0000, 0x0131, 0x0000, 0x0000, 0x0142, 0x00f8, 0x0153, 0x00df,
0x0000, 0x0000, 0x0000, 0x0000};
-static const FX_WORD MacRomanEncoding[256] = {
+static const uint16_t MacRomanEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -131,7 +131,7 @@ static const FX_WORD MacRomanEncoding[256] = {
0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, 0x0000, 0x00d2, 0x00da,
0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da,
0x00b8, 0x02dd, 0x02db, 0x02c7};
-static const FX_WORD AdobeWinAnsiEncoding[256] = {
+static const uint16_t AdobeWinAnsiEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -161,7 +161,7 @@ static const FX_WORD AdobeWinAnsiEncoding[256] = {
0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2,
0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb,
0x00fc, 0x00fd, 0x00fe, 0x00ff};
-static const FX_WORD MacExpertEncoding[256] = {
+static const uint16_t MacExpertEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -191,7 +191,7 @@ static const FX_WORD MacExpertEncoding[256] = {
0xf6f2, 0xf6eb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf6ee, 0xf6fb,
0xf6f4, 0xf7af, 0xf6ea, 0x207f, 0xf6ef, 0xf6e2, 0xf6e8, 0xf6f7, 0xf6fc,
0x0000, 0x0000, 0x0000, 0x0000};
-static const FX_WORD AdobeSymbolEncoding[256] = {
+static const uint16_t AdobeSymbolEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -222,7 +222,7 @@ static const FX_WORD AdobeSymbolEncoding[256] = {
0x2320, 0xF8F5, 0x2321, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, 0xF8FA, 0xF8FB,
0xF8FC, 0xF8FD, 0xF8FE, 0x0000,
};
-static const FX_WORD ZapfEncoding[256] = {
+static const uint16_t ZapfEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -1677,7 +1677,7 @@ const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding,
FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) {
switch (encoding) {
case FXFT_ENCODING_UNICODE:
- return (FX_WORD)charcode;
+ return (uint16_t)charcode;
case FXFT_ENCODING_ADOBE_STANDARD:
return StandardEncoding[(uint8_t)charcode];
case FXFT_ENCODING_ADOBE_EXPERT:
@@ -1691,14 +1691,14 @@ FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) {
}
return 0;
}
-static FX_DWORD PDF_FindCode(const FX_WORD* pCodes, FX_WORD unicode) {
+static FX_DWORD PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) {
for (FX_DWORD i = 0; i < 256; i++)
if (pCodes[i] == unicode) {
return i;
}
return 0;
}
-static const FX_WORD MSSymbolEncoding[256] = {
+static const uint16_t MSSymbolEncoding[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -1747,7 +1747,7 @@ FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) {
}
return 0;
}
-const FX_WORD* PDF_UnicodesForPredefinedCharSet(int encoding) {
+const uint16_t* PDF_UnicodesForPredefinedCharSet(int encoding) {
switch (encoding) {
case PDFFONT_ENCODING_WINANSI:
return AdobeWinAnsiEncoding;
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index f370b86049..60fa40103b 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -306,7 +306,7 @@ FX_DWORD EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap,
CPDF_FontGlobals* pFontGlobals =
CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
+ const uint16_t* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
if (!pCodes)
return 0;
@@ -329,13 +329,13 @@ FX_WCHAR EmbeddedUnicodeFromCharcode(const FXCMAP_CMap* pEmbedMap,
if (!IsValidEmbeddedCharcodeFromUnicodeCharset(charset))
return 0;
- FX_WORD cid = FPDFAPI_CIDFromCharCode(pEmbedMap, charcode);
+ uint16_t cid = FPDFAPI_CIDFromCharCode(pEmbedMap, charcode);
if (cid == 0)
return 0;
CPDF_FontGlobals* pFontGlobals =
CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
+ const uint16_t* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
if (!pCodes)
return 0;
@@ -372,7 +372,7 @@ void FT_UseCIDCharmap(FXFT_Face face, int coding) {
}
const struct CIDTransform {
- FX_WORD CID;
+ uint16_t CID;
uint8_t a, b, c, d, e, f;
} g_Japan1_VertCIDs[] = {
{97, 129, 0, 0, 127, 55, 0}, {7887, 127, 0, 0, 127, 76, 89},
@@ -455,7 +455,7 @@ const struct CIDTransform {
};
int CompareCIDTransform(const void* key, const void* element) {
- FX_WORD CID = *static_cast<const FX_WORD*>(key);
+ uint16_t CID = *static_cast<const uint16_t*>(key);
return CID - static_cast<const struct CIDTransform*>(element)->CID;
}
@@ -565,24 +565,24 @@ void CPDF_CMapParser::ParseWord(const CFX_ByteStringC& word) {
m_CodePoints[m_CodeSeq] = CMap_GetCode(word);
m_CodeSeq++;
FX_DWORD StartCode, EndCode;
- FX_WORD StartCID;
+ uint16_t StartCID;
if (m_Status == 1) {
if (m_CodeSeq < 2) {
return;
}
EndCode = StartCode = m_CodePoints[0];
- StartCID = (FX_WORD)m_CodePoints[1];
+ StartCID = (uint16_t)m_CodePoints[1];
} else {
if (m_CodeSeq < 3) {
return;
}
StartCode = m_CodePoints[0];
EndCode = m_CodePoints[1];
- StartCID = (FX_WORD)m_CodePoints[2];
+ StartCID = (uint16_t)m_CodePoints[2];
}
if (EndCode < 0x10000) {
for (FX_DWORD code = StartCode; code <= EndCode; code++) {
- m_pCMap->m_pMapping[code] = (FX_WORD)(StartCID + code - StartCode);
+ m_pCMap->m_pMapping[code] = (uint16_t)(StartCID + code - StartCode);
}
} else {
FX_DWORD buf[2];
@@ -755,7 +755,7 @@ FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr,
return FALSE;
}
FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size) {
- m_pMapping = FX_Alloc(FX_WORD, 65536);
+ m_pMapping = FX_Alloc(uint16_t, 65536);
CPDF_CMapParser parser;
parser.Initialize(this);
CPDF_SimpleParser syntax(pData, size);
@@ -777,15 +777,15 @@ FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size) {
return TRUE;
}
-FX_WORD CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const {
+uint16_t CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const {
if (m_Coding == CIDCODING_CID) {
- return (FX_WORD)charcode;
+ return (uint16_t)charcode;
}
if (m_pEmbedMap) {
return FPDFAPI_CIDFromCharCode(m_pEmbedMap, charcode);
}
if (!m_pMapping) {
- return (FX_WORD)charcode;
+ return (uint16_t)charcode;
}
if (charcode >> 16) {
if (m_pAddMapping) {
@@ -797,8 +797,8 @@ FX_WORD CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const {
}
return 0;
}
- return (FX_WORD)(((FX_DWORD*)found)[1] % 65536 + charcode -
- *(FX_DWORD*)found);
+ return (uint16_t)(((FX_DWORD*)found)[1] % 65536 + charcode -
+ *(FX_DWORD*)found);
}
if (m_pUseMap)
return m_pUseMap->CIDFromCharCode(charcode);
@@ -807,7 +807,7 @@ FX_WORD CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const {
FX_DWORD CID = m_pMapping[charcode];
if (!CID && m_pUseMap)
return m_pUseMap->CIDFromCharCode(charcode);
- return (FX_WORD)CID;
+ return (uint16_t)CID;
}
FX_DWORD CPDF_CMap::GetNextChar(const FX_CHAR* pString,
@@ -956,7 +956,7 @@ FX_BOOL CPDF_CID2UnicodeMap::Initialize() {
FX_BOOL CPDF_CID2UnicodeMap::IsLoaded() {
return m_EmbeddedCount != 0;
}
-FX_WCHAR CPDF_CID2UnicodeMap::UnicodeFromCID(FX_WORD CID) {
+FX_WCHAR CPDF_CID2UnicodeMap::UnicodeFromCID(uint16_t CID) {
if (m_Charset == CIDSET_UNICODE) {
return CID;
}
@@ -1004,9 +1004,9 @@ CPDF_CIDFont* CPDF_CIDFont::AsCIDFont() {
return this;
}
-FX_WORD CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const {
+uint16_t CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const {
if (!m_pCMap) {
- return (FX_WORD)charcode;
+ return (uint16_t)charcode;
}
return m_pCMap->CIDFromCharCode(charcode);
}
@@ -1034,7 +1034,7 @@ FX_WCHAR CPDF_CIDFont::GetUnicodeFromCharCode(FX_DWORD charcode) const {
if (!m_pCID2UnicodeMap || !m_pCID2UnicodeMap->IsLoaded()) {
return 0;
}
- return m_pCID2UnicodeMap->UnicodeFromCID((FX_WORD)charcode);
+ return m_pCID2UnicodeMap->UnicodeFromCID((uint16_t)charcode);
}
if (!m_pCMap->IsLoaded() || !m_pCID2UnicodeMap ||
!m_pCID2UnicodeMap->IsLoaded()) {
@@ -1078,7 +1078,8 @@ FX_DWORD CPDF_CIDFont::CharCodeFromUnicode(FX_WCHAR unicode) const {
}
FX_DWORD CID = 0;
while (CID < 65536) {
- FX_WCHAR this_unicode = m_pCID2UnicodeMap->UnicodeFromCID((FX_WORD)CID);
+ FX_WCHAR this_unicode =
+ m_pCID2UnicodeMap->UnicodeFromCID((uint16_t)CID);
if (this_unicode == unicode) {
return CID;
}
@@ -1287,7 +1288,7 @@ FX_RECT CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, int level) {
}
}
if (!m_pFontFile && m_Charset == CIDSET_JAPAN1) {
- FX_WORD CID = CIDFromCharCode(charcode);
+ uint16_t CID = CIDFromCharCode(charcode);
const uint8_t* pTransform = GetCIDTransform(CID);
if (pTransform && !bVert) {
CFX_Matrix matrix(CIDTransformToFloat(pTransform[0]),
@@ -1310,7 +1311,7 @@ int CPDF_CIDFont::GetCharWidthF(FX_DWORD charcode, int level) {
if (m_pAnsiWidths && charcode < 0x80) {
return m_pAnsiWidths[charcode];
}
- FX_WORD cid = CIDFromCharCode(charcode);
+ uint16_t cid = CIDFromCharCode(charcode);
int size = m_WidthList.GetSize();
FX_DWORD* list = m_WidthList.GetData();
for (int i = 0; i < size; i += 3) {
@@ -1320,7 +1321,7 @@ int CPDF_CIDFont::GetCharWidthF(FX_DWORD charcode, int level) {
}
return m_DefaultWidth;
}
-short CPDF_CIDFont::GetVertWidth(FX_WORD CID) const {
+short CPDF_CIDFont::GetVertWidth(uint16_t CID) const {
FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
if (vertsize == 0) {
return m_DefaultW1;
@@ -1332,7 +1333,7 @@ short CPDF_CIDFont::GetVertWidth(FX_WORD CID) const {
}
return m_DefaultW1;
}
-void CPDF_CIDFont::GetVertOrigin(FX_WORD CID, short& vx, short& vy) const {
+void CPDF_CIDFont::GetVertOrigin(uint16_t CID, short& vx, short& vy) const {
FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
if (vertsize) {
const FX_DWORD* pTable = m_VertMetrics.GetData();
@@ -1348,7 +1349,7 @@ void CPDF_CIDFont::GetVertOrigin(FX_WORD CID, short& vx, short& vy) const {
const FX_DWORD* list = m_WidthList.GetData();
for (int i = 0; i < size; i += 3) {
if (CID >= list[i] && CID <= list[i + 1]) {
- dwWidth = (FX_WORD)list[i + 2];
+ dwWidth = (uint16_t)list[i + 2];
break;
}
}
@@ -1410,7 +1411,7 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph) {
*pVertGlyph = FALSE;
}
if (!m_pFontFile && !m_pCIDToGIDMap) {
- FX_WORD cid = CIDFromCharCode(charcode);
+ uint16_t cid = CIDFromCharCode(charcode);
FX_WCHAR unicode = 0;
if (m_bCIDIsGID) {
#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
@@ -1458,7 +1459,7 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph) {
if (!name) {
return charcode == 0 ? -1 : (int)charcode;
}
- FX_WORD unicode = PDF_UnicodeFromAdobeName(name);
+ uint16_t unicode = PDF_UnicodeFromAdobeName(name);
if (unicode) {
if (bMSUnicode) {
index = FXFT_Get_Char_Index(face, unicode);
@@ -1520,7 +1521,7 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph) {
if (!m_Font.GetFace())
return -1;
- FX_WORD cid = CIDFromCharCode(charcode);
+ uint16_t cid = CIDFromCharCode(charcode);
if (m_bType1) {
if (!m_pCIDToGIDMap) {
return cid;
@@ -1658,14 +1659,14 @@ FX_BOOL CPDF_CIDFont::LoadGB2312() {
}
CheckFontMetrics();
m_DefaultWidth = 1000;
- m_pAnsiWidths = FX_Alloc(FX_WORD, 128);
+ m_pAnsiWidths = FX_Alloc(uint16_t, 128);
for (int i = 32; i < 127; i++) {
m_pAnsiWidths[i] = 500;
}
return TRUE;
}
-const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const {
+const uint8_t* CPDF_CIDFont::GetCIDTransform(uint16_t CID) const {
if (m_Charset != CIDSET_JAPAN1 || m_pFontFile)
return nullptr;