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