summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_fontmapper.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-05-25 22:58:39 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-25 22:58:39 +0000
commitdf93cd35530e7b8dd67abde8d199c36c3fae76be (patch)
treecc760bdcc560f0ad448db5a2d01de01d6ba8d1c7 /core/fxge/cfx_fontmapper.cpp
parent2aa4b2f3928ccd8393f60db8f7b740c75f4e8a8d (diff)
downloadpdfium-df93cd35530e7b8dd67abde8d199c36c3fae76be.tar.xz
Replace some #ifdef PDF_ENABLE_XFA with runtime checks.
Abstract GetUserPermissions() differences via new virtual method. Abstract GetPageCount() differences via existing virtual method. Remove unused ReadHeader() form for non-xfa. Remove unused FindSubstFontByUnicode() for xfa. Remove unused FXFONT_EXACTMATCH Change-Id: I0a3de01a9841db86fcbc96991d3fa2682393b9ad Reviewed-on: https://pdfium-review.googlesource.com/32831 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/cfx_fontmapper.cpp')
-rw-r--r--core/fxge/cfx_fontmapper.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index f44e7aab69..b9a8eac1a1 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -611,10 +611,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name,
void* hFont = m_pFontInfo->MapFont(weight, bItalic, Charset, PitchFamily,
family.c_str());
if (!hFont) {
-#ifdef PDF_ENABLE_XFA
- if (flags & FXFONT_EXACTMATCH)
- return nullptr;
-#endif // PDF_ENABLE_XFA
if (bCJK) {
bItalic = italic_angle != 0;
weight = old_weight;
@@ -697,41 +693,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name,
return face;
}
-#ifdef PDF_ENABLE_XFA
-FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(uint32_t dwUnicode,
- uint32_t flags,
- int weight,
- int italic_angle) {
- if (!m_pFontInfo)
- return nullptr;
-
- bool bItalic = (flags & FXFONT_ITALIC) != 0;
- int PitchFamily = 0;
- UpdatePitchFamily(flags, &PitchFamily);
- void* hFont =
- m_pFontInfo->MapFontByUnicode(dwUnicode, weight, bItalic, PitchFamily);
- if (!hFont)
- return nullptr;
-
- uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, nullptr, 0);
- uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0);
- if (font_size == 0 && ttc_size == 0) {
- m_pFontInfo->DeleteFont(hFont);
- return nullptr;
- }
- FXFT_Face face = nullptr;
- if (ttc_size) {
- face = GetCachedTTCFace(hFont, 0x74746366, ttc_size, font_size);
- } else {
- ByteString SubstName;
- m_pFontInfo->GetFaceName(hFont, &SubstName);
- face = GetCachedFace(hFont, SubstName, weight, bItalic, font_size);
- }
- m_pFontInfo->DeleteFont(hFont);
- return face;
-}
-#endif // PDF_ENABLE_XFA
-
int CFX_FontMapper::GetFaceSize() const {
return pdfium::CollectionSize<int>(m_FaceArray);
}