From dd17a14f060c39f50ca24522b202ffef5436dd43 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 27 Sep 2017 15:34:54 -0400 Subject: Move CFX_Font definition to cfx_font.h This CL moves the CFX_Font definition out of fx_font.h and into cfx_font.h to match the cfx_font.cpp implementation. Change-Id: Icc2fc7463fa4b9d0bec925e80b60a638136a83a1 Reviewed-on: https://pdfium-review.googlesource.com/14951 Commit-Queue: dsinclair Reviewed-by: Ryan Harrison --- core/fxge/fx_font.h | 98 ----------------------------------------------------- 1 file changed, 98 deletions(-) (limited to 'core/fxge/fx_font.h') diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h index 598402a7f5..634429e2f6 100644 --- a/core/fxge/fx_font.h +++ b/core/fxge/fx_font.h @@ -78,104 +78,6 @@ class ScopedFontTransform { FT_Face m_Face; }; -class CFX_Font { - public: - CFX_Font(); - ~CFX_Font(); - - void LoadSubst(const ByteString& face_name, - bool bTrueType, - uint32_t flags, - int weight, - int italic_angle, - int CharsetCP, - bool bVertical); - - bool LoadEmbedded(const uint8_t* data, uint32_t size); - FXFT_Face GetFace() const { return m_Face; } - CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } - -#ifdef PDF_ENABLE_XFA - bool LoadFile(const RetainPtr& pFile, int nFaceIndex); - - bool LoadClone(const CFX_Font* pFont); - void SetFace(FXFT_Face face); - void SetSubstFont(std::unique_ptr subst) { - m_pSubstFont = std::move(subst); - } -#endif // PDF_ENABLE_XFA - - const CFX_GlyphBitmap* LoadGlyphBitmap(uint32_t glyph_index, - bool bFontStyle, - const CFX_Matrix* pMatrix, - int dest_width, - int anti_alias, - int& text_flags) const; - const CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width) const; - -#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ - CFX_TypeFace* GetDeviceCache() const; -#endif - - int GetGlyphWidth(uint32_t glyph_index); - int GetAscent() const; - int GetDescent() const; - bool GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); - bool IsItalic() const; - bool IsBold() const; - bool IsFixedWidth() const; - bool IsVertical() const { return m_bVertical; } - ByteString GetPsName() const; - ByteString GetFamilyName() const; - ByteString GetFaceName() const; - bool IsTTFont() const; - bool GetBBox(FX_RECT& bbox); - bool IsEmbedded() const { return m_bEmbedded; } - uint8_t* GetSubData() const { return m_pGsubData; } - void SetSubData(uint8_t* data) { m_pGsubData = data; } -#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ - void* GetPlatformFont() const { return m_pPlatformFont; } - void SetPlatformFont(void* font) { m_pPlatformFont = font; } -#endif - uint8_t* GetFontData() const { return m_pFontData; } - uint32_t GetSize() const { return m_dwSize; } - void AdjustMMParams(int glyph_index, int width, int weight) const; - - static const size_t kAngleSkewArraySize = 30; - static const char s_AngleSkew[kAngleSkewArraySize]; - static const size_t kWeightPowArraySize = 100; - static const uint8_t s_WeightPow[kWeightPowArraySize]; - static const uint8_t s_WeightPow_11[kWeightPowArraySize]; - static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize]; - -#ifdef PDF_ENABLE_XFA - protected: - bool m_bShallowCopy; - FXFT_StreamRec* m_pOwnedStream; -#endif // PDF_ENABLE_XFA - - private: - friend class CFX_FaceCache; - CFX_PathData* LoadGlyphPathImpl(uint32_t glyph_index, int dest_width) const; - CFX_FaceCache* GetFaceCache() const; - void ReleasePlatformResource(); - void DeleteFace(); - void ClearFaceCache(); - - FXFT_Face m_Face; - mutable UnownedPtr m_FaceCache; - std::unique_ptr m_pSubstFont; - std::vector m_pFontDataAllocation; - uint8_t* m_pFontData; - uint8_t* m_pGsubData; - uint32_t m_dwSize; -#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ - void* m_pPlatformFont; -#endif - bool m_bEmbedded; - bool m_bVertical; -}; - class CFX_FontFaceInfo { public: CFX_FontFaceInfo(ByteString filePath, -- cgit v1.2.3