Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cFont.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cFont_H
7 #define _INC_cFont_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cSurface.h"
13 
14 namespace GrayLib
15 {
17  class cSurfaceDC;
18 
20  {
24  virtual PIXELS_t get_FontHeight() const noexcept = 0;
25  virtual HRESULT DrawLetter(cSurfaceDC* pSurfDC, PIXELS_t x, PIXELS_t y, wchar_t ch) = 0;
26  };
27  typedef cRefPtr<cFontBase> cFontPtr; // Generic font.
28 
30  {
33  // _GTN(LOGFONT) cWinFontCfg font format. NOT back and fore color. That's from the DC.
34  public:
35  static const PIXELS_t k_Width = 16;
36  static const PIXELS_t k_Height = 16;
37 
39 
40  public:
41  cFont16F();
42  ~cFont16F();
43 
44  PIXELS_t get_FontHeight() const noexcept override
45  {
46  return k_Height;
47  }
48 
49  virtual HRESULT DrawLetter(cSurfaceDC* pSurfDC, PIXELS_t x, PIXELS_t y, wchar_t ch) override;
50  };
51 
52  class GRAYLIB_LINK cFontMgr // Singleton
53  {
61  public:
62  cFontPtr GetFontForSize(int iPoints, bool takeBest);
64  };
65 }
66 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cFont.h:30
PIXELS_t get_FontHeight() const noexcept override
Definition: cFont.h:44
cSurface m_Image
Source 16*16 matrix of 16*16 (default) pixel characters. 4 bytes per char as b/w image.
Definition: cFont.h:38
Definition: cFont.h:20
Definition: cFont.h:53
cFontPtr GetFont(const cWinFontCfg &cfg)
Definition: cSurfaceDC.h:50
Definition: cSurface.h:21
Definition: WinTypes.h:168
Definition: cRefPtr.h:22
Definition: cMesh.h:22
UNITTEST2_PREDEF(cQuadtree)
cRefPtr< cFontBase > cFontPtr
Definition: cFont.h:27
int PIXELS_t
Count of pixels in a dimension of some image/surface.
Definition: cSurfaceInfo.h:20