| 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 _FX_PALTFORM_DEVICE_H_ | 7 #ifndef _FX_PALTFORM_DEVICE_H_ |
| 8 #define _FX_PALTFORM_DEVICE_H_ | 8 #define _FX_PALTFORM_DEVICE_H_ |
| 9 class IFPF_DeviceModule; | 9 class IFPF_DeviceModule; |
| 10 class IFPF_FontMgr; | 10 class IFPF_FontMgr; |
| 11 class IFPF_Font; | 11 class IFPF_Font; |
| 12 class IFPF_DeviceModule | 12 class IFPF_DeviceModule |
| 13 { | 13 { |
| 14 public: | 14 public: |
| 15 virtual ~IFPF_DeviceModule() { } |
| 15 virtual void Destroy() = 0; | 16 virtual void Destroy() = 0; |
| 16 virtual IFPF_FontMgr* GetFontMgr() = 0; | 17 virtual IFPF_FontMgr* GetFontMgr() = 0; |
| 17 }; | 18 }; |
| 18 IFPF_DeviceModule* FPF_GetDeviceModule(); | 19 IFPF_DeviceModule* FPF_GetDeviceModule(); |
| 19 #define FPF_MATCHFONT_REPLACEANSI 1 | 20 #define FPF_MATCHFONT_REPLACEANSI 1 |
| 20 FX_DEFINEHANDLE(FPF_HFONT); | 21 FX_DEFINEHANDLE(FPF_HFONT); |
| 21 class IFPF_Font | 22 class IFPF_Font |
| 22 { | 23 { |
| 23 public: | 24 public: |
| 24 virtual void Release() = 0; | 25 virtual void Release() = 0; |
| 25 virtual IFPF_Font* Retain() = 0; | 26 virtual IFPF_Font* Retain() = 0; |
| 26 virtual FPF_HFONT GetHandle() = 0; | 27 virtual FPF_HFONT GetHandle() = 0; |
| 27 virtual CFX_ByteString GetFamilyName() = 0; | 28 virtual CFX_ByteString GetFamilyName() = 0; |
| 28 virtual CFX_WideString GetPsName() = 0; | 29 virtual CFX_WideString GetPsName() = 0; |
| 29 virtual FX_DWORD GetFontStyle() const = 0; | 30 virtual FX_DWORD GetFontStyle() const = 0; |
| 30 virtual FX_BYTE GetCharset() const = 0; | 31 virtual FX_BYTE GetCharset() const = 0; |
| 31 | 32 |
| 32 virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode) = 0; | 33 virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode) = 0; |
| 33 virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex) = 0; | 34 virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex) = 0; |
| 34 | 35 |
| 35 virtual FX_INT32 GetAscent() const = 0; | 36 virtual FX_INT32 GetAscent() const = 0; |
| 36 virtual FX_INT32 GetDescent() const = 0; | 37 virtual FX_INT32 GetDescent() const = 0; |
| 37 | 38 |
| 38 virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RE
CT &rtBBox) = 0; | 39 virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RE
CT &rtBBox) = 0; |
| 39 virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0; | 40 virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0; |
| 40 | 41 |
| 41 virtual FX_INT32 GetHeight() const = 0; | 42 virtual FX_INT32 GetHeight() const = 0; |
| 42 virtual FX_INT32 GetItalicAngle() const = 0; | 43 virtual FX_INT32 GetItalicAngle() const = 0; |
| 43 virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer,
FX_DWORD dwSize) = 0; | 44 virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer,
FX_DWORD dwSize) = 0; |
| 45 |
| 46 protected: |
| 47 ~IFPF_Font() { } |
| 44 }; | 48 }; |
| 45 class IFPF_FontMgr | 49 class IFPF_FontMgr |
| 46 { | 50 { |
| 47 public: | 51 public: |
| 52 virtual ~IFPF_FontMgr() { } |
| 48 virtual void LoadSystemFonts() = 0; | 53 virtual void LoadSystemFonts() = 0; |
| 49 virtual void LoadPrivateFont(IFX_FileRead* pFontFile)
= 0; | 54 virtual void LoadPrivateFont(IFX_FileRead* pFontFile)
= 0; |
| 50 virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0; | 55 virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0; |
| 51 virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_
t szBuffer) = 0; | 56 virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_
t szBuffer) = 0; |
| 52 | 57 |
| 53 virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE charset
, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; | 58 virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE charset
, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; |
| 54 }; | 59 }; |
| 55 #endif | 60 #endif |
| OLD | NEW |