summaryrefslogtreecommitdiff
path: root/xfa/fgas/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 /xfa/fgas/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 'xfa/fgas/font')
-rw-r--r--xfa/fgas/font/fgas_font.h30
-rw-r--r--xfa/fgas/font/fgas_fontutils.cpp4
-rw-r--r--xfa/fgas/font/fgas_fontutils.h4
-rw-r--r--xfa/fgas/font/fgas_gefont.cpp10
-rw-r--r--xfa/fgas/font/fgas_gefont.h6
-rw-r--r--xfa/fgas/font/fgas_stdfontmgr.cpp61
-rw-r--r--xfa/fgas/font/fgas_stdfontmgr.h26
7 files changed, 71 insertions, 70 deletions
diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h
index 5c362122ba..b13602cee6 100644
--- a/xfa/fgas/font/fgas_font.h
+++ b/xfa/fgas/font/fgas_font.h
@@ -61,7 +61,7 @@ class IFX_Font {
public:
static IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
IFX_FontMgr* pFontMgr);
static IFX_Font* LoadFont(const uint8_t* pBuffer,
int32_t iLength,
@@ -76,7 +76,7 @@ class IFX_Font {
virtual ~IFX_Font() {}
virtual void Release() = 0;
virtual IFX_Font* Retain() = 0;
- virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0) = 0;
+ virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0) = 0;
virtual void GetFamilyName(CFX_WideString& wsFamily) const = 0;
virtual void GetPsName(CFX_WideString& wsName) const = 0;
virtual FX_DWORD GetFontStyles() const = 0;
@@ -108,7 +108,7 @@ struct FX_FONTMATCHPARAMS {
FX_DWORD dwUSB;
FX_DWORD dwMatchFlags;
FX_WCHAR wUnicode;
- FX_WORD wCodePage;
+ uint16_t wCodePage;
};
typedef FX_FONTMATCHPARAMS* FX_LPFONTMATCHPARAMS;
typedef FX_FONTMATCHPARAMS const* FX_LPCFONTMATCHPARAMS;
@@ -161,7 +161,7 @@ class IFX_FontMgr {
virtual ~IFX_FontMgr() {}
virtual void Release() = 0;
virtual IFX_Font* GetDefFontByCodePage(
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByCharset(
@@ -173,22 +173,22 @@ class IFX_FontMgr {
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(
- FX_WORD wLanguage,
+ uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage = 0xFFFF) = 0;
+ uint16_t wCodePage = 0xFFFF) = 0;
virtual IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength) = 0;
virtual IFX_Font* LoadFont(const FX_WCHAR* pszFileName) = 0;
virtual IFX_Font* LoadFont(IFX_Stream* pFontStream,
const FX_WCHAR* pszFontAlias = NULL,
FX_DWORD dwFontStyles = 0,
- FX_WORD wCodePage = 0,
+ uint16_t wCodePage = 0,
FX_BOOL bSaveStream = FALSE) = 0;
virtual IFX_Font* LoadFont(IFX_Font* pSrcFont,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage = 0xFFFF) = 0;
+ uint16_t wCodePage = 0xFFFF) = 0;
virtual void ClearFontCache() = 0;
virtual void RemoveFont(IFX_Font* pFont) = 0;
};
@@ -198,7 +198,7 @@ class IFX_FontMgrDelegate {
virtual ~IFX_FontMgrDelegate() {}
virtual IFX_Font* GetDefFontByCodePage(
IFX_FontMgr* pFontMgr,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByCharset(
@@ -213,7 +213,7 @@ class IFX_FontMgrDelegate {
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(
IFX_FontMgr* pFontMgr,
- FX_WORD wLanguage,
+ uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
};
@@ -233,7 +233,7 @@ class IFX_FontMgr {
virtual ~IFX_FontMgr() {}
virtual void Release() = 0;
virtual IFX_Font* GetDefFontByCodePage(
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByCharset(
@@ -245,15 +245,15 @@ class IFX_FontMgr {
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(
- FX_WORD wLanguage,
+ uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage,
+ virtual IFX_Font* GetFontByCodePage(uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
inline IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage) {
+ uint16_t wCodePage) {
return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
}
virtual IFX_Font* GetFontByCharset(uint8_t nCharset,
@@ -262,7 +262,7 @@ class IFX_FontMgr {
virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage,
+ virtual IFX_Font* GetFontByLanguage(uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL) = 0;
virtual IFX_Font* LoadFont(const uint8_t* pBuffer,
diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp
index 51bba0123e..e115e0f42d 100644
--- a/xfa/fgas/font/fgas_fontutils.cpp
+++ b/xfa/fgas/font/fgas_fontutils.cpp
@@ -9,7 +9,7 @@
#include "core/include/fxcrt/fx_ext.h"
#include "xfa/fgas/font/fgas_font.h"
-FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) {
+FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles) {
FX_DWORD dwHash = wCodePage;
if (dwFontStyles & FX_FONTSTYLE_FixedPitch) {
dwHash |= 0x00010000;
@@ -33,7 +33,7 @@ FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) {
}
FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage) {
+ uint16_t wCodePage) {
CFX_WideString wsFont(pszFontFamily);
if (dwFontStyles & FX_FONTSTYLE_Bold) {
wsFont += L"Bold";
diff --git a/xfa/fgas/font/fgas_fontutils.h b/xfa/fgas/font/fgas_fontutils.h
index ab567aee6b..d5608063ca 100644
--- a/xfa/fgas/font/fgas_fontutils.h
+++ b/xfa/fgas/font/fgas_fontutils.h
@@ -16,10 +16,10 @@ struct FGAS_FONTUSB {
uint16_t wCodePage;
};
-FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles);
+FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles);
FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage);
+ uint16_t wCodePage);
const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode);
#endif // XFA_FGAS_FONT_FGAS_FONTUTILS_H_
diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp
index 831da7e7d6..75ed0b2a1f 100644
--- a/xfa/fgas/font/fgas_gefont.cpp
+++ b/xfa/fgas/font/fgas_gefont.cpp
@@ -11,7 +11,7 @@
IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
IFX_FontMgr* pFontMgr) {
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
if (NULL != pFontMgr) {
@@ -189,7 +189,7 @@ IFX_Font* CFX_GEFont::Retain() {
}
FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage) {
+ uint16_t wCodePage) {
if (m_pFont) {
return FALSE;
}
@@ -221,7 +221,7 @@ FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily,
}
int32_t iWeight =
(dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
- FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage);
+ uint16_t wCharSet = FX_GetCharsetFromCodePage(wCodePage);
if (wCharSet == 0xFFFF) {
wCharSet = FXSYS_GetACP();
}
@@ -329,7 +329,7 @@ FX_BOOL CFX_GEFont::InitFont() {
}
return TRUE;
}
-IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage) {
+IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, uint16_t wCodePage) {
if (GetFontStyles() == dwFontStyles) {
return Retain();
}
@@ -489,7 +489,7 @@ int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode,
if (pFontUSB == NULL) {
return 0xFFFF;
}
- FX_WORD wBitField = pFontUSB->wBitField;
+ uint16_t wBitField = pFontUSB->wBitField;
if (wBitField >= 128) {
return 0xFFFF;
}
diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h
index 034220ef64..03bc32ce63 100644
--- a/xfa/fgas/font/fgas_gefont.h
+++ b/xfa/fgas/font/fgas_gefont.h
@@ -21,12 +21,12 @@ class CFX_GEFont : public IFX_Font {
virtual IFX_Font* Retain();
FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage);
+ uint16_t wCodePage);
FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t length);
FX_BOOL LoadFont(const FX_WCHAR* pszFileName);
FX_BOOL LoadFont(IFX_Stream* pFontStream, FX_BOOL bSaveStream);
FX_BOOL LoadFont(CFX_Font* pExtFont, FX_BOOL bTakeOver = FALSE);
- virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0);
+ virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0);
virtual void GetFamilyName(CFX_WideString& wsFamily) const;
virtual void GetPsName(CFX_WideString& wsName) const;
virtual FX_DWORD GetFontStyles() const;
@@ -71,7 +71,7 @@ class CFX_GEFont : public IFX_Font {
CFX_RectMassArray* m_pRectArray;
CFX_MapPtrToPtr* m_pBBoxMap;
IFX_FontProvider* m_pProvider;
- FX_WORD m_wCharSet;
+ uint16_t m_wCharSet;
CFX_PtrArray m_SubstFonts;
CFX_MapPtrToPtr m_FontMapper;
FX_BOOL InitFont();
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index ffe520dc87..331ea86582 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -57,7 +57,7 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() {
m_Fonts.RemoveAll();
}
IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily) {
FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
@@ -115,7 +115,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(
if (!pFD)
return nullptr;
- FX_WORD wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet);
+ uint16_t wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet);
const FX_WCHAR* pFontFace = pFD->wsFontFace;
pFont = IFX_Font::LoadFont(pFontFace, dwFontStyles, wCodePage, this);
if (pFont) {
@@ -131,7 +131,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(
}
IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage(
- FX_WORD wLanguage,
+ uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily) {
return GetDefFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage),
@@ -139,7 +139,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage(
}
IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage) {
+ uint16_t wCodePage) {
FX_DWORD dwHash =
FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage);
IFX_Font* pFont = NULL;
@@ -203,7 +203,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFileName) {
IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream,
const FX_WCHAR* pszFontAlias,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_BOOL bSaveStream) {
FXSYS_assert(pFontStream != NULL && pFontStream->GetLength() > 0);
IFX_Font* pFont = NULL;
@@ -232,7 +232,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream,
}
IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font* pSrcFont,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage) {
+ uint16_t wCodePage) {
FXSYS_assert(pSrcFont != NULL);
if (pSrcFont->GetFontStyles() == dwFontStyles) {
return pSrcFont->Retain();
@@ -299,7 +299,7 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font* pFont) {
FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
FX_DWORD dwMatchFlags,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwUSB,
FX_WCHAR wUnicode) {
if (m_pMatcher == NULL) {
@@ -688,7 +688,7 @@ void CFX_FontMgrImp::Release() {
}
delete this;
}
-IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage,
+IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily) {
return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage(
@@ -709,14 +709,14 @@ IFX_Font* CFX_FontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode,
: m_pDelegate->GetDefFontByUnicode(
this, wUnicode, dwFontStyles, pszFontFamily);
}
-IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(FX_WORD wLanguage,
+IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily) {
return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByLanguage(
this, wLanguage, dwFontStyles,
pszFontFamily);
}
-IFX_Font* CFX_FontMgrImp::GetFontByCodePage(FX_WORD wCodePage,
+IFX_Font* CFX_FontMgrImp::GetFontByCodePage(uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily) {
CFX_ByteString bsHash;
@@ -770,8 +770,8 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode(FX_WCHAR wUnicode,
if (m_FailedUnicodes2NULL.Lookup(wUnicode, pFont))
return nullptr;
const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wUnicode);
- FX_WORD wCodePage = x ? x->wCodePage : 0xFFFF;
- FX_WORD wBitField = x ? x->wBitField : 0x03E7;
+ uint16_t wCodePage = x ? x->wCodePage : 0xFFFF;
+ uint16_t wBitField = x ? x->wBitField : 0x03E7;
CFX_ByteString bsHash;
if (wCodePage == 0xFFFF)
bsHash.Format("%d, %d, %d", wCodePage, wBitField, dwFontStyles);
@@ -851,7 +851,7 @@ FX_BOOL CFX_FontMgrImp::VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode) {
}
return TRUE;
}
-IFX_Font* CFX_FontMgrImp::GetFontByLanguage(FX_WORD wLanguage,
+IFX_Font* CFX_FontMgrImp::GetFontByLanguage(uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily) {
return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles,
@@ -1072,7 +1072,7 @@ IFX_FileRead* CFX_FontMgrImp::CreateFontStream(
return nullptr;
}
int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const CFX_WideString& FontName,
FX_WCHAR wcUnicode) {
@@ -1104,8 +1104,8 @@ int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts,
return MatchedFonts.GetSize();
}
struct FX_BitCodePage {
- FX_WORD wBit;
- FX_WORD wCodePage;
+ uint16_t wBit;
+ uint16_t wCodePage;
};
static const FX_BitCodePage g_Bit2CodePage[] = {
{0, 1252}, {1, 1250}, {2, 1251}, {3, 1253}, {4, 1254}, {5, 1255},
@@ -1121,21 +1121,21 @@ static const FX_BitCodePage g_Bit2CodePage[] = {
{60, 737}, {61, 708}, {62, 850}, {63, 437},
};
-FX_WORD FX_GetCodePageBit(FX_WORD wCodePage) {
+uint16_t FX_GetCodePageBit(uint16_t wCodePage) {
for (size_t i = 0; i < FX_ArraySize(g_Bit2CodePage); ++i) {
if (g_Bit2CodePage[i].wCodePage == wCodePage)
return g_Bit2CodePage[i].wBit;
}
- return (FX_WORD)-1;
+ return (uint16_t)-1;
}
-FX_WORD FX_GetUnicodeBit(FX_WCHAR wcUnicode) {
+uint16_t FX_GetUnicodeBit(FX_WCHAR wcUnicode) {
const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wcUnicode);
return x ? x->wBitField : 999;
}
int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const CFX_WideString& FontName,
FX_WCHAR wcUnicode) {
@@ -1192,10 +1192,10 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled,
if (nPenalty >= 0xFFFF) {
return 0xFFFF;
}
- FX_WORD wBit =
- ((0 == wCodePage || 0xFFFF == wCodePage) ? (FX_WORD)-1
+ uint16_t wBit =
+ ((0 == wCodePage || 0xFFFF == wCodePage) ? (uint16_t)-1
: FX_GetCodePageBit(wCodePage));
- if (wBit != (FX_WORD)-1) {
+ if (wBit != (uint16_t)-1) {
FXSYS_assert(wBit < 64);
if (0 == (pInstalled->m_dwCsb[wBit / 32] & (1 << (wBit % 32)))) {
nPenalty += 0xFFFF;
@@ -1204,9 +1204,9 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled,
}
}
wBit =
- ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (FX_WORD)999
+ ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (uint16_t)999
: FX_GetUnicodeBit(wcUnicode));
- if (wBit != (FX_WORD)999) {
+ if (wBit != (uint16_t)999) {
FXSYS_assert(wBit < 128);
if (0 == (pInstalled->m_dwUsb[wBit / 32] & (1 << (wBit % 32)))) {
nPenalty += 0xFFFF;
@@ -1290,7 +1290,7 @@ void CFX_FontMgrImp::RegisterFace(FXFT_Face pFace,
pFont->m_dwFontStyles |= FXFT_Is_Face_Bold(pFace) ? FX_FONTSTYLE_Bold : 0;
pFont->m_dwFontStyles |= FXFT_Is_Face_Italic(pFace) ? FX_FONTSTYLE_Italic : 0;
pFont->m_dwFontStyles |= GetFlags(pFace);
- CFX_WordArray Charsets;
+ CFX_ArrayTemplate<uint16_t> Charsets;
GetCharsets(pFace, Charsets);
GetUSBCSB(pFace, pFont->m_dwUsb, pFont->m_dwCsb);
unsigned long nLength = 0;
@@ -1404,8 +1404,8 @@ void CFX_FontMgrImp::GetNames(const uint8_t* name_table,
#undef GetUInt16
#undef GetUInt32
struct FX_BIT2CHARSET {
- FX_WORD wBit;
- FX_WORD wCharset;
+ uint16_t wBit;
+ uint16_t wCharset;
};
FX_BIT2CHARSET g_FX_Bit2Charset1[16] = {
{1 << 0, FX_CHARSET_ANSI},
@@ -1469,11 +1469,12 @@ FX_BIT2CHARSET g_FX_Bit2Charset4[16] = {
Charsets.Add(g_FX_Bit2Charset##n[i].wCharset); \
} \
}
-void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace, CFX_WordArray& Charsets) {
+void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace,
+ CFX_ArrayTemplate<uint16_t>& Charsets) {
Charsets.RemoveAll();
TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(pFace, ft_sfnt_os2);
if (NULL != pOS2) {
- FX_WORD a1, a2, a3, a4;
+ uint16_t a1, a2, a3, a4;
a1 = pOS2->ulCodePageRange1 & 0x0000ffff;
CODEPAGERANGE_IMPLEMENT(1);
a2 = (pOS2->ulCodePageRange1 >> 16) & 0x0000ffff;
diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h
index e646c28917..e548cf5d2b 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.h
+++ b/xfa/fgas/font/fgas_stdfontmgr.h
@@ -26,7 +26,7 @@ class CFX_StdFontMgrImp : public IFX_FontMgr {
void* pUserData);
~CFX_StdFontMgrImp();
virtual void Release() { delete this; }
- virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage,
+ virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset,
@@ -35,22 +35,22 @@ class CFX_StdFontMgrImp : public IFX_FontMgr {
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
- virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage,
+ virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
virtual IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage = 0xFFFF);
+ uint16_t wCodePage = 0xFFFF);
virtual IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength);
virtual IFX_Font* LoadFont(const FX_WCHAR* pszFileName);
virtual IFX_Font* LoadFont(IFX_Stream* pFontStream,
const FX_WCHAR* pszFontAlias = NULL,
FX_DWORD dwFontStyles = 0,
- FX_WORD wCodePage = 0,
+ uint16_t wCodePage = 0,
FX_BOOL bSaveStream = FALSE);
virtual IFX_Font* LoadFont(IFX_Font* pSrcFont,
FX_DWORD dwFontStyles,
- FX_WORD wCodePage = 0xFFFF);
+ uint16_t wCodePage = 0xFFFF);
virtual void ClearFontCache();
virtual void RemoveFont(IFX_Font* pFont);
@@ -71,7 +71,7 @@ class CFX_StdFontMgrImp : public IFX_FontMgr {
FX_LPCFONTDESCRIPTOR FindFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
FX_DWORD dwMatchFlags,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwUSB = 999,
FX_WCHAR wUnicode = 0);
IFX_Font* GetFont(FX_LPCFONTDESCRIPTOR pFD, FX_DWORD dwFontStyles);
@@ -159,7 +159,7 @@ class CFX_FontMgrImp : public IFX_FontMgr {
IFX_FontMgrDelegate* pDelegate = NULL,
void* pUserData = NULL);
virtual void Release();
- virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage,
+ virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset,
@@ -168,10 +168,10 @@ class CFX_FontMgrImp : public IFX_FontMgr {
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
- virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage,
+ virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
- virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage,
+ virtual IFX_Font* GetFontByCodePage(uint16_t wCodePage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
virtual IFX_Font* GetFontByCharset(uint8_t nCharset,
@@ -180,7 +180,7 @@ class CFX_FontMgrImp : public IFX_FontMgr {
virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
- virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage,
+ virtual IFX_Font* GetFontByLanguage(uint16_t wLanguage,
FX_DWORD dwFontStyles,
const FX_WCHAR* pszFontFamily = NULL);
virtual IFX_Font* LoadFont(const uint8_t* pBuffer,
@@ -211,7 +211,7 @@ class CFX_FontMgrImp : public IFX_FontMgr {
void RegisterFaces(IFX_FileRead* pFontStream,
const CFX_WideString* pFaceName);
void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names);
- void GetCharsets(FXFT_Face pFace, CFX_WordArray& Charsets);
+ void GetCharsets(FXFT_Face pFace, CFX_ArrayTemplate<uint16_t>& Charsets);
void GetUSBCSB(FXFT_Face pFace, FX_DWORD* USB, FX_DWORD* CSB);
FX_DWORD GetFlags(FXFT_Face pFace);
CFX_FontDescriptors m_InstalledFonts;
@@ -219,12 +219,12 @@ class CFX_FontMgrImp : public IFX_FontMgr {
FX_BOOL VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode);
int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const CFX_WideString& FontName,
FX_WCHAR wcUnicode = 0xFFFE);
int32_t CalcPenalty(CFX_FontDescriptor* pInstalled,
- FX_WORD wCodePage,
+ uint16_t wCodePage,
FX_DWORD dwFontStyles,
const CFX_WideString& FontName,
FX_WCHAR wcUnicode = 0xFFFE);