From 81ee14da357bb8bb141930d96e07a46f6d472720 Mon Sep 17 00:00:00 2001 From: npm Date: Mon, 29 Aug 2016 09:35:12 -0700 Subject: Move CFX_SubstFont and CTTFontDesc into their own files Review-Url: https://codereview.chromium.org/2292503002 --- core/fxge/include/cfx_fontmapper.h | 2 ++ core/fxge/include/cfx_fontmgr.h | 2 ++ core/fxge/include/cfx_substfont.h | 34 +++++++++++++++++++++ core/fxge/include/fx_font.h | 61 +------------------------------------- 4 files changed, 39 insertions(+), 60 deletions(-) create mode 100644 core/fxge/include/cfx_substfont.h (limited to 'core/fxge/include') diff --git a/core/fxge/include/cfx_fontmapper.h b/core/fxge/include/cfx_fontmapper.h index 09d5429044..0d82855c41 100644 --- a/core/fxge/include/cfx_fontmapper.h +++ b/core/fxge/include/cfx_fontmapper.h @@ -13,6 +13,8 @@ #include "core/fxge/include/cfx_fontmgr.h" #include "core/fxge/include/fx_font.h" +class CFX_SubstFont; + class CFX_FontMapper { public: explicit CFX_FontMapper(CFX_FontMgr* mgr); diff --git a/core/fxge/include/cfx_fontmgr.h b/core/fxge/include/cfx_fontmgr.h index dac8c5ac7b..c8e66aee14 100644 --- a/core/fxge/include/cfx_fontmgr.h +++ b/core/fxge/include/cfx_fontmgr.h @@ -14,6 +14,8 @@ class IFX_SystemFontInfo; class CFX_FontMapper; +class CFX_SubstFont; +class CTTFontDesc; class CFX_FontMgr { public: diff --git a/core/fxge/include/cfx_substfont.h b/core/fxge/include/cfx_substfont.h new file mode 100644 index 0000000000..a712a7a7a7 --- /dev/null +++ b/core/fxge/include/cfx_substfont.h @@ -0,0 +1,34 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXGE_INCLUDE_CFX_SUBSTFONT_H_ +#define CORE_FXGE_INCLUDE_CFX_SUBSTFONT_H_ + +#include "core/fxcrt/include/fx_string.h" + +#define FXFONT_SUBST_MM 0x01 +#define FXFONT_SUBST_GLYPHPATH 0x04 +#define FXFONT_SUBST_CLEARTYPE 0x08 +#define FXFONT_SUBST_TRANSFORM 0x10 +#define FXFONT_SUBST_NONSYMBOL 0x20 +#define FXFONT_SUBST_EXACT 0x40 +#define FXFONT_SUBST_STANDARD 0x80 + +class CFX_SubstFont { + public: + CFX_SubstFont(); + + CFX_ByteString m_Family; + int m_Charset; + uint32_t m_SubstFlags; + int m_Weight; + int m_ItalicAngle; + bool m_bSubstCJK; + int m_WeightCJK; + bool m_bItalicCJK; +}; + +#endif // CORE_FXGE_INCLUDE_CFX_SUBSTFONT_H_ diff --git a/core/fxge/include/fx_font.h b/core/fxge/include/fx_font.h index 28c51b131c..cdde643770 100644 --- a/core/fxge/include/fx_font.h +++ b/core/fxge/include/fx_font.h @@ -7,11 +7,11 @@ #ifndef CORE_FXGE_INCLUDE_FX_FONT_H_ #define CORE_FXGE_INCLUDE_FX_FONT_H_ -#include #include #include #include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/cfx_substfont.h" #include "core/fxge/include/fx_dib.h" #include "core/fxge/include/fx_freetype.h" @@ -22,8 +22,6 @@ class CFX_FaceCache; class CFX_FontCache; class CFX_PathData; class CFX_SizeGlyphCache; -class CFX_SubstFont; -class CTTFontDesc; #ifdef _SKIA_SUPPORT_ class SkTypeface; @@ -174,63 +172,6 @@ class CFX_Font { FX_BOOL m_bVertical; }; -#define FXFONT_SUBST_MM 0x01 -#define FXFONT_SUBST_GLYPHPATH 0x04 -#define FXFONT_SUBST_CLEARTYPE 0x08 -#define FXFONT_SUBST_TRANSFORM 0x10 -#define FXFONT_SUBST_NONSYMBOL 0x20 -#define FXFONT_SUBST_EXACT 0x40 -#define FXFONT_SUBST_STANDARD 0x80 - -class CFX_SubstFont { - public: - CFX_SubstFont(); - - CFX_ByteString m_Family; - int m_Charset; - uint32_t m_SubstFlags; - int m_Weight; - int m_ItalicAngle; - bool m_bSubstCJK; - int m_WeightCJK; - bool m_bItalicCJK; -}; - -#define FX_FONT_FLAG_SERIF 0x01 -#define FX_FONT_FLAG_FIXEDPITCH 0x02 -#define FX_FONT_FLAG_ITALIC 0x04 -#define FX_FONT_FLAG_BOLD 0x08 -#define FX_FONT_FLAG_SYMBOLIC_SYMBOL 0x10 -#define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20 -#define FX_FONT_FLAG_MULTIPLEMASTER 0x40 - -class CTTFontDesc { - public: - CTTFontDesc() { - m_Type = 0; - m_pFontData = nullptr; - m_RefCount = 0; - } - ~CTTFontDesc(); - // ret < 0, releaseface not appropriate for this object. - // ret == 0, object released - // ret > 0, object still alive, other referrers. - int ReleaseFace(FXFT_Face face); - int m_Type; - union { - struct { - FX_BOOL m_bItalic; - FX_BOOL m_bBold; - FXFT_Face m_pFace; - } m_SingleFace; - struct { - FXFT_Face m_pFaces[16]; - } m_TTCFace; - }; - uint8_t* m_pFontData; - int m_RefCount; -}; - class CFX_FontFaceInfo { public: CFX_FontFaceInfo(CFX_ByteString filePath, -- cgit v1.2.3