From 1ca7173cd85adcd58766fc89f95c3dc163efa17a Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 28 Sep 2017 11:32:17 -0400 Subject: Cleanup CFGAS_GEFont methods Remove unused params, cleanup return values. Change-Id: I9a1bc400e24cdcac982a578242ff0f9de8055775 Reviewed-on: https://pdfium-review.googlesource.com/15070 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima Reviewed-by: Ryan Harrison --- xfa/fgas/font/cfgas_gefont.h | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'xfa/fgas/font/cfgas_gefont.h') diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index 9d990094fa..a1d6b82cb6 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -9,6 +9,7 @@ #include #include +#include #include #include "core/fxcrt/fx_memory.h" @@ -39,25 +40,30 @@ class CFGAS_GEFont : public Retainable { std::unique_ptr pInternalFont, CFGAS_FontMgr* pFontMgr); - RetainPtr Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0); uint32_t GetFontStyles() const; - bool GetCharWidth(wchar_t wUnicode, int32_t& iWidth, bool bCharCode); - int32_t GetGlyphIndex(wchar_t wUnicode, bool bCharCode = false); + bool GetCharWidth(wchar_t wUnicode, int32_t& iWidth); + int32_t GetGlyphIndex(wchar_t wUnicode); int32_t GetAscent() const; int32_t GetDescent() const; - bool GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox, bool bCharCode = false); + + bool GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox); bool GetBBox(CFX_Rect* bbox); + RetainPtr GetSubstFont(int32_t iGlyphIndex); CFX_Font* GetDevFont() const { return m_pFont; } + void SetFontProvider(CFGAS_PDFFontMgr* pProvider) { m_pProvider.Reset(pProvider); } -#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ + +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ + RetainPtr Derive(uint32_t dwFontStyles, uint16_t wCodePage); +#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ void SetLogicalFontStyle(uint32_t dwLogFontStyle) { m_bUseLogFontStyle = true; m_dwLogFontStyle = dwLogFontStyle; } -#endif +#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ private: explicit CFGAS_GEFont(CFGAS_FontMgr* pFontMgr); @@ -75,18 +81,9 @@ class CFGAS_GEFont : public Retainable { bool LoadFontInternal(CFX_Font* pExternalFont); bool LoadFontInternal(std::unique_ptr pInternalFont); bool InitFont(); - bool GetCharBBoxInternal(wchar_t wUnicode, - CFX_Rect* bbox, - bool bRecursive, - bool bCharCode = false); - bool GetCharWidthInternal(wchar_t wUnicode, - int32_t& iWidth, - bool bRecursive, - bool bCharCode); - int32_t GetGlyphIndex(wchar_t wUnicode, - bool bRecursive, - RetainPtr* ppFont, - bool bCharCode = false); + std::pair> GetGlyphIndexAndFont( + wchar_t wUnicode, + bool bRecursive); WideString GetFamilyName() const; #if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ -- cgit v1.2.3