ASPiK SDK
cfontwin32.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __cfontwin32__
6 #define __cfontwin32__
7 
8 #include "../iplatformfont.h"
9 
10 #if WINDOWS
11 
12 #include "win32support.h"
13 
14 namespace VSTGUI {
15 
16 //-----------------------------------------------------------------------------
17 class GdiPlusFont : public IPlatformFont, public IFontPainter
18 {
19 public:
20  GdiPlusFont (const UTF8String& name, const CCoord& size, const int32_t& style);
21 
22  Gdiplus::Font* getFont () const { return font; }
23 
24  static bool getAllPlatformFontFamilies (std::list<std::string>& fontFamilyNames);
25 protected:
26  ~GdiPlusFont () noexcept;
27 
28  double getAscent () const override;
29  double getDescent () const override;
30  double getLeading () const override;
31  double getCapHeight () const override;
32 
33  const IFontPainter* getPainter () const override { return this; }
34 
35  void drawString (CDrawContext* context, IPlatformString* string, const CPoint& p, bool antialias = true) const override;
36  CCoord getStringWidth (CDrawContext* context, IPlatformString* string, bool antialias = true) const override;
37 
38  Gdiplus::Font* font;
39  INT gdiStyle;
40 };
41 
42 } // namespace
43 
44 #endif // WINDOWS
45 
46 #endif
Definition: customcontrols.cpp:8