summaryrefslogtreecommitdiff
path: root/xfa/fgas/font/cfgas_gefont.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-28 11:32:17 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-28 15:45:58 +0000
commit1ca7173cd85adcd58766fc89f95c3dc163efa17a (patch)
treeeffbc52dd5ec7327a2c945ad39cfd3c44f07c8c1 /xfa/fgas/font/cfgas_gefont.h
parent9c392c82abee05ac2fd42e69984e2de8e48b797a (diff)
downloadpdfium-1ca7173cd85adcd58766fc89f95c3dc163efa17a.tar.xz
Cleanup CFGAS_GEFont methods
Remove unused params, cleanup return values. Change-Id: I9a1bc400e24cdcac982a578242ff0f9de8055775 Reviewed-on: https://pdfium-review.googlesource.com/15070 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fgas/font/cfgas_gefont.h')
-rw-r--r--xfa/fgas/font/cfgas_gefont.h33
1 files changed, 15 insertions, 18 deletions
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 <map>
#include <memory>
+#include <utility>
#include <vector>
#include "core/fxcrt/fx_memory.h"
@@ -39,25 +40,30 @@ class CFGAS_GEFont : public Retainable {
std::unique_ptr<CFX_Font> pInternalFont,
CFGAS_FontMgr* pFontMgr);
- RetainPtr<CFGAS_GEFont> 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<CFGAS_GEFont> 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<CFGAS_GEFont> 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<CFX_Font> 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<CFGAS_GEFont>* ppFont,
- bool bCharCode = false);
+ std::pair<int32_t, RetainPtr<CFGAS_GEFont>> GetGlyphIndexAndFont(
+ wchar_t wUnicode,
+ bool bRecursive);
WideString GetFamilyName() const;
#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_