| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_INCLUDE_FXGE_FPF_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FPF_H_ |
| 8 #define CORE_INCLUDE_FXGE_FPF_H_ | 8 #define CORE_INCLUDE_FXGE_FPF_H_ |
| 9 | 9 |
| 10 #include "../fxcrt/fx_coordinates.h" | 10 #include "../fxcrt/fx_coordinates.h" |
| 11 | 11 |
| 12 class IFPF_DeviceModule; | 12 class IFPF_DeviceModule; |
| 13 class IFPF_FontMgr; | 13 class IFPF_FontMgr; |
| 14 class IFPF_Font; | 14 class IFPF_Font; |
| 15 class IFPF_DeviceModule | 15 class IFPF_DeviceModule { |
| 16 { | 16 public: |
| 17 public: | 17 virtual ~IFPF_DeviceModule() {} |
| 18 virtual ~IFPF_DeviceModule() { } | 18 virtual void Destroy() = 0; |
| 19 virtual void» » » » Destroy() = 0; | 19 virtual IFPF_FontMgr* GetFontMgr() = 0; |
| 20 virtual IFPF_FontMgr*» » GetFontMgr() = 0; | |
| 21 }; | 20 }; |
| 22 IFPF_DeviceModule*» FPF_GetDeviceModule(); | 21 IFPF_DeviceModule* FPF_GetDeviceModule(); |
| 23 #define FPF_MATCHFONT_REPLACEANSI» » 1 | 22 #define FPF_MATCHFONT_REPLACEANSI 1 |
| 24 typedef struct FPF_HFONT_ { | 23 typedef struct FPF_HFONT_ { void* pData; } * FPF_HFONT; |
| 25 void* pData; | 24 class IFPF_Font { |
| 26 }* FPF_HFONT; | 25 public: |
| 27 class IFPF_Font | 26 virtual void Release() = 0; |
| 28 { | 27 virtual IFPF_Font* Retain() = 0; |
| 29 public: | 28 virtual FPF_HFONT GetHandle() = 0; |
| 30 virtual void» » » Release() = 0; | 29 virtual CFX_ByteString GetFamilyName() = 0; |
| 31 virtual IFPF_Font*» » Retain() = 0; | 30 virtual CFX_WideString GetPsName() = 0; |
| 32 virtual FPF_HFONT» » GetHandle() = 0; | 31 virtual FX_DWORD GetFontStyle() const = 0; |
| 33 virtual CFX_ByteString» GetFamilyName() = 0; | 32 virtual uint8_t GetCharset() const = 0; |
| 34 virtual CFX_WideString» GetPsName() = 0; | |
| 35 virtual FX_DWORD» » GetFontStyle() const = 0; | |
| 36 virtual uint8_t» » » GetCharset() const = 0; | |
| 37 | 33 |
| 38 virtual int32_t» » GetGlyphIndex(FX_WCHAR wUnicode) = 0; | 34 virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode) = 0; |
| 39 virtual int32_t» » GetGlyphWidth(int32_t iGlyphIndex) = 0; | 35 virtual int32_t GetGlyphWidth(int32_t iGlyphIndex) = 0; |
| 40 | 36 |
| 41 virtual int32_t» » GetAscent() const = 0; | 37 virtual int32_t GetAscent() const = 0; |
| 42 virtual int32_t» » GetDescent() const = 0; | 38 virtual int32_t GetDescent() const = 0; |
| 43 | 39 |
| 44 virtual FX_BOOL» » » GetGlyphBBox(int32_t iGlyphIndex, FX_REC
T &rtBBox) = 0; | 40 virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT& rtBBox) = 0; |
| 45 virtual FX_BOOL» » » GetBBox(FX_RECT &rtBBox) = 0; | 41 virtual FX_BOOL GetBBox(FX_RECT& rtBBox) = 0; |
| 46 | 42 |
| 47 virtual int32_t» » GetHeight() const = 0; | 43 virtual int32_t GetHeight() const = 0; |
| 48 virtual int32_t» » GetItalicAngle() const = 0; | 44 virtual int32_t GetItalicAngle() const = 0; |
| 49 virtual FX_DWORD» » GetFontData(FX_DWORD dwTable, uint8_t* pBuffer,
FX_DWORD dwSize) = 0; | 45 virtual FX_DWORD GetFontData(FX_DWORD dwTable, |
| 46 uint8_t* pBuffer, |
| 47 FX_DWORD dwSize) = 0; |
| 50 | 48 |
| 51 protected: | 49 protected: |
| 52 ~IFPF_Font() { } | 50 ~IFPF_Font() {} |
| 53 }; | 51 }; |
| 54 class IFPF_FontMgr | 52 class IFPF_FontMgr { |
| 55 { | 53 public: |
| 56 public: | 54 virtual ~IFPF_FontMgr() {} |
| 57 virtual ~IFPF_FontMgr() { } | 55 virtual void LoadSystemFonts() = 0; |
| 58 virtual void» » » LoadSystemFonts() = 0; | 56 virtual void LoadPrivateFont(IFX_FileRead* pFontFile) = 0; |
| 59 virtual void» » » LoadPrivateFont(IFX_FileRead* pFontFile)
= 0; | 57 virtual void LoadPrivateFont(const CFX_ByteStringC& bsFileName) = 0; |
| 60 virtual void» » » LoadPrivateFont(const CFX_ByteStringC& b
sFileName) = 0; | 58 virtual void LoadPrivateFont(void* pBuffer, size_t szBuffer) = 0; |
| 61 virtual void» » » LoadPrivateFont(void* pBuffer, size_t sz
Buffer) = 0; | |
| 62 | 59 |
| 63 virtual IFPF_Font*» » CreateFont(const CFX_ByteStringC& bsFamilyname,
uint8_t charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; | 60 virtual IFPF_Font* CreateFont(const CFX_ByteStringC& bsFamilyname, |
| 61 uint8_t charset, |
| 62 FX_DWORD dwStyle, |
| 63 FX_DWORD dwMatch = 0) = 0; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 #endif // CORE_INCLUDE_FXGE_FPF_H_ | 66 #endif // CORE_INCLUDE_FXGE_FPF_H_ |
| OLD | NEW |