ASPiK SDK
iplatformfont.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 __iplatformfont__
6 #define __iplatformfont__
7 
8 #include "../vstguifwd.h"
9 #include <list>
10 
11 namespace VSTGUI {
12 
13 //-----------------------------------------------------------------------------
14 // IFontPainter Declaration
16 //-----------------------------------------------------------------------------
18 {
19 public:
20  virtual ~IFontPainter () noexcept = default;
21 
22  virtual void drawString (CDrawContext* context, IPlatformString* string, const CPoint& p, bool antialias = true) const = 0;
23  virtual CCoord getStringWidth (CDrawContext* context, IPlatformString* string, bool antialias = true) const = 0;
24 };
25 
26 //-----------------------------------------------------------------------------
27 // IPlatformFont declaration
31 //-----------------------------------------------------------------------------
33 {
34 public:
35  static SharedPointer<IPlatformFont> create (const UTF8String& name, const CCoord& size, const int32_t& style);
36  static bool getAllPlatformFontFamilies (std::list<std::string>& fontFamilyNames);
37 
38  virtual double getAscent () const = 0;
39  virtual double getDescent () const = 0;
40  virtual double getLeading () const = 0;
41  virtual double getCapHeight () const = 0;
42 
43  virtual const IFontPainter* getPainter () const = 0;
44 };
45 
46 }
47 
48 #endif // __iplatformfont__
virtual double getCapHeight() const =0
returns the height of the highest capital letter for this font. If not supported returns -1 ...
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
virtual double getLeading() const =0
returns the space between lines for this font. If not supported returns -1
virtual double getDescent() const =0
returns the descent line offset of the baseline of this font. If not supported returns -1 ...
Definition: customcontrols.cpp:8
platform font class
Definition: iplatformfont.h:32
virtual double getAscent() const =0
returns the ascent line offset of the baseline of this font. If not supported returns -1 ...
Definition: vstguibase.h:247
font paint interface
Definition: iplatformfont.h:17
holds an UTF8 encoded string and a platform representation of it
Definition: cstring.h:56
Point structure.
Definition: cpoint.h:17