ASPiK SDK
cairofont.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 #pragma once
6 
7 #include "../iplatformfont.h"
8 #include <memory>
9 
10 //------------------------------------------------------------------------
11 namespace VSTGUI {
12 namespace Cairo {
13 
14 //------------------------------------------------------------------------
15 class Font : public IPlatformFont, public IFontPainter
16 {
17 public:
18  Font (UTF8StringPtr name, const CCoord& size, const int32_t& style);
19  ~Font ();
20 
21  bool valid () const;
22 
23  double getAscent () const override;
24  double getDescent () const override;
25  double getLeading () const override;
26  double getCapHeight () const override;
27  const IFontPainter* getPainter () const override;
28 
29  void drawString (CDrawContext* context, IPlatformString* string, const CPoint& p,
30  bool antialias = true) const override;
31  CCoord getStringWidth (CDrawContext* context, IPlatformString* string,
32  bool antialias = true) const override;
33 
34 private:
35  struct Impl;
36  std::unique_ptr<Impl> impl;
37 };
38 
39 //------------------------------------------------------------------------
40 } // Cairo
41 } // VSTGUI
double getDescent() const override
returns the descent line offset of the baseline of this font. If not supported returns -1 ...
Definition: cairofont.cpp:299
double getCapHeight() const override
returns the height of the highest capital letter for this font. If not supported returns -1 ...
Definition: cairofont.cpp:312
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
double getAscent() const override
returns the ascent line offset of the baseline of this font. If not supported returns -1 ...
Definition: cairofont.cpp:293
double getLeading() const override
returns the space between lines for this font. If not supported returns -1
Definition: cairofont.cpp:305
Definition: customcontrols.cpp:8
platform font class
Definition: iplatformfont.h:32
font paint interface
Definition: iplatformfont.h:17
Definition: cairofont.cpp:218
Point structure.
Definition: cpoint.h:17
Definition: cairofont.h:15