1 // Copyright 2016 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_ 8 #define CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_ 9 10 #include <stdint.h> 11 12 #include "core/fxcrt/bytestring.h" 13 #include "core/fxcrt/fx_codepage_forward.h" 14 #include "core/fxcrt/retain_ptr.h" 15 #include "core/fxcrt/span.h" 16 #include "core/fxcrt/unowned_ptr.h" 17 #include "core/fxge/cfx_face.h" 18 19 class CFPF_SkiaFontMgr; 20 class CFPF_SkiaPathFont; 21 22 class CFPF_SkiaFont { 23 public: 24 CFPF_SkiaFont(CFPF_SkiaFontMgr* pFontMgr, 25 const CFPF_SkiaPathFont* pFont, 26 FX_Charset uCharset); 27 ~CFPF_SkiaFont(); 28 IsValid()29 bool IsValid() const { return !!m_Face; } 30 31 ByteString GetFamilyName(); GetCharset()32 FX_Charset GetCharset() const { return m_uCharset; } 33 uint32_t GetFontData(uint32_t dwTable, pdfium::span<uint8_t> pBuffer); 34 35 private: 36 UnownedPtr<CFPF_SkiaFontMgr> const m_pFontMgr; 37 UnownedPtr<const CFPF_SkiaPathFont> const m_pFont; 38 RetainPtr<CFX_Face> const m_Face; 39 const FX_Charset m_uCharset; 40 }; 41 42 #endif // CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_ 43