summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxge')
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp2
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp25
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp9
3 files changed, 20 insertions, 16 deletions
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index 80483f07d3..2c310f3cea 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -622,7 +622,7 @@ FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf,
if (pIccTransform) {
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
-#endif
+#endif // PDF_ENABLE_XFA
FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(
dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top,
dst_plt);
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index ffd7b77fb4..e8c592e463 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -14,8 +14,8 @@
extern void _FPDFAPI_GetInternalFontData(int id1,
const uint8_t*& data,
FX_DWORD& size);
+#endif // PDF_ENABLE_XFA
-#endif
namespace {
#ifdef PDF_ENABLE_XFA
@@ -41,8 +41,8 @@ CFX_UnicodeEncodingEx* _FXFM_CreateFontEncoding(CFX_Font* pFont,
return nullptr;
return new CFX_UnicodeEncodingEx(pFont, nEncodingID);
}
+#endif // PDF_ENABLE_XFA
-#endif
FXFT_Face FT_LoadFont(const uint8_t* pData, int size) {
return CFX_GEModule::Get()->GetFontMgr()->GetFixedFace(pData, size, 0);
}
@@ -57,9 +57,6 @@ CFX_Font::CFX_Font() {
m_pFontData = NULL;
m_pFontDataAllocation = NULL;
m_dwSize = 0;
-#ifdef PDF_ENABLE_XFA
- m_pOwnedStream = NULL;
-#endif
m_pGsubData = NULL;
m_pPlatformFont = NULL;
m_pPlatformFontCollection = NULL;
@@ -68,7 +65,11 @@ CFX_Font::CFX_Font() {
m_bDwLoaded = FALSE;
#ifdef PDF_ENABLE_XFA
m_bLogic = FALSE;
+ m_pOwnedStream = NULL;
+#endif // PDF_ENABLE_XFA
}
+
+#ifdef PDF_ENABLE_XFA
FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) {
if (pFont == NULL) {
return FALSE;
@@ -100,7 +101,7 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) {
m_bDwLoaded = pFont->m_bDwLoaded;
m_pOwnedStream = pFont->m_pOwnedStream;
return TRUE;
-#endif
+#endif // PDF_ENABLE_XFA
}
CFX_Font::~CFX_Font() {
delete m_pSubstFont;
@@ -113,13 +114,13 @@ CFX_Font::~CFX_Font() {
m_OtfFontData.DetachBuffer();
return;
}
-#endif
+#endif // PDF_ENABLE_XFA
if (m_Face) {
#ifndef PDF_ENABLE_XFA
if (FXFT_Get_Face_External_Stream(m_Face)) {
FXFT_Clear_Face_External_Stream(m_Face);
}
-#endif
+#endif // PDF_ENABLE_XFA
if (m_bEmbedded) {
DeleteFace();
} else {
@@ -129,7 +130,7 @@ CFX_Font::~CFX_Font() {
#ifdef PDF_ENABLE_XFA
FX_Free(m_pOwnedStream);
m_pOwnedStream = NULL;
-#endif
+#endif // PDF_ENABLE_XFA
FX_Free(m_pGsubData);
m_pGsubData = NULL;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -226,7 +227,7 @@ FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile,
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
return TRUE;
}
-#endif
+#endif // PDF_ENABLE_XFA
int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index) {
if (!m_Face) {
@@ -482,8 +483,8 @@ FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode) {
}
return charcode;
}
-#ifdef PDF_ENABLE_XFA
+#ifdef PDF_ENABLE_XFA
CFX_UnicodeEncodingEx::CFX_UnicodeEncodingEx(CFX_Font* pFont,
FX_DWORD EncodingID)
: CFX_UnicodeEncoding(pFont), m_nEncodingID(EncodingID) {
@@ -555,4 +556,4 @@ CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(CFX_Font* pFont,
}
return NULL;
}
-#endif
+#endif // PDF_ENABLE_XFA
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 6b0d7bf7e8..73f89c4c05 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -1087,7 +1087,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
if (flags & FXFONT_EXACTMATCH) {
return NULL;
}
-#endif
+#endif // PDF_ENABLE_XFA
if (bCJK) {
if (italic_angle != 0) {
bItalic = TRUE;
@@ -1296,7 +1296,8 @@ FX_BOOL CFX_FontMapper::IsBuiltinFace(const FXFT_Face face) const {
}
return FALSE;
}
-#endif
+#endif // PDF_ENABLE_XFA
+
extern "C" {
unsigned long _FTStreamRead(FXFT_Stream stream,
unsigned long offset,
@@ -1518,6 +1519,7 @@ void* CFX_FolderFontInfo::MapFont(int weight,
int& iExact) {
return NULL;
}
+
#ifdef PDF_ENABLE_XFA
void* CFX_FolderFontInfo::MapFontByUnicode(FX_DWORD dwUnicode,
int weight,
@@ -1525,7 +1527,8 @@ void* CFX_FolderFontInfo::MapFontByUnicode(FX_DWORD dwUnicode,
int pitch_family) {
return NULL;
}
-#endif
+#endif // PDF_ENABLE_XFA
+
void* CFX_FolderFontInfo::GetFont(const FX_CHAR* face) {
auto it = m_FontList.find(face);
return it != m_FontList.end() ? it->second : nullptr;