summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2015-12-09 19:49:24 -0800
committerJun Fang <jun_fang@foxitsoftware.com>2015-12-09 19:49:24 -0800
commit3d8f56d817baf2864caac844f0b403b5da7ef8b0 (patch)
tree487c9f68cd8f1b23fddfd899a5321847b642b6d9
parent2b13af09bd788afbf9e9eecc5938820cdc037134 (diff)
downloadpdfium-3d8f56d817baf2864caac844f0b403b5da7ef8b0.tar.xz
Add CFX_FontMapper::IsBuiltinFace() in master branch
BUG=452793, 561478 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1511613005 .
-rw-r--r--core/include/fxge/fx_font.h1
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 95b036e0bc..085ead88c7 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -257,6 +257,7 @@ class CFX_FontMapper {
int italic_angle,
int CharsetCP,
CFX_SubstFont* pSubstFont);
+ FX_BOOL IsBuiltinFace(const FXFT_Face face) const;
private:
static const size_t MM_FACE_COUNT = 2;
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 77f9486560..29a29db6fe 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -1214,6 +1214,17 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
m_pFontInfo->DeleteFont(hFont);
return face;
}
+FX_BOOL CFX_FontMapper::IsBuiltinFace(const FXFT_Face face) const {
+ for (int i = 0; i < MM_FACE_COUNT; ++i) {
+ if (m_MMFaces[i] == face)
+ return TRUE;
+ }
+ for (int i = 0; i < FOXIT_FACE_COUNT; ++i) {
+ if (m_FoxitFaces[i] == face)
+ return TRUE;
+ }
+ return FALSE;
+}
extern "C" {
unsigned long _FTStreamRead(FXFT_Stream stream,
unsigned long offset,