AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::TextLayout Class Referenceabstract

Abstract text layout interface. More...

#include <aeongui/TextLayout.hpp>

Inheritance diagram for AeonGUI::TextLayout:
[legend]

Public Member Functions

virtual ~TextLayout ()=0
 Virtual destructor.
virtual void SetText (const std::string &aText)=0
 Set the text content to lay out.
virtual void SetFontFamily (const std::string &aFamily)=0
 Set the font family.
virtual void SetFontSize (double aSize)=0
 Set the font size.
virtual void SetFontWeight (int aWeight)=0
 Set the font weight.
virtual void SetFontStyle (int aStyle)=0
 Set the font style.
virtual double GetTextWidth () const =0
 Get the logical width of the laid-out text.
virtual double GetTextHeight () const =0
 Get the logical height of the laid-out text.
virtual double GetBaseline () const =0
 Get the baseline offset from the top.
virtual double GetCharOffsetX (long aIndex) const =0

Detailed Description

Abstract text layout interface.

Abstracts PangoLayout to allow multiple text‐layout back-ends to be used interchangeably.

Member Function Documentation

◆ GetBaseline()

virtual double AeonGUI::TextLayout::GetBaseline ( ) const
pure virtual

Get the baseline offset from the top.

Returns
Baseline in CSS pixels.

Implemented in AeonGUI::PangoTextLayout.

◆ GetCharOffsetX()

virtual double AeonGUI::TextLayout::GetCharOffsetX ( long aIndex) const
pure virtual

Get the x-offset of the character at the given index.

Parameters
aIndexUTF-8 byte index.
Returns
x offset in CSS pixels.

Implemented in AeonGUI::PangoTextLayout.

◆ GetTextHeight()

virtual double AeonGUI::TextLayout::GetTextHeight ( ) const
pure virtual

Get the logical height of the laid-out text.

Returns
Height in CSS pixels.

Implemented in AeonGUI::PangoTextLayout.

◆ GetTextWidth()

virtual double AeonGUI::TextLayout::GetTextWidth ( ) const
pure virtual

Get the logical width of the laid-out text.

Returns
Width in CSS pixels.

Implemented in AeonGUI::PangoTextLayout.

◆ SetFontFamily()

virtual void AeonGUI::TextLayout::SetFontFamily ( const std::string & aFamily)
pure virtual

Set the font family.

Parameters
aFamilyFont family name (e.g. "sans-serif").

Implemented in AeonGUI::PangoTextLayout.

◆ SetFontSize()

virtual void AeonGUI::TextLayout::SetFontSize ( double aSize)
pure virtual

Set the font size.

Parameters
aSizeFont size in CSS pixels.

Implemented in AeonGUI::PangoTextLayout.

◆ SetFontStyle()

virtual void AeonGUI::TextLayout::SetFontStyle ( int aStyle)
pure virtual

Set the font style.

Parameters
aStyle0 = normal, 1 = italic, 2 = oblique.

Implemented in AeonGUI::PangoTextLayout.

◆ SetFontWeight()

virtual void AeonGUI::TextLayout::SetFontWeight ( int aWeight)
pure virtual

Set the font weight.

Parameters
aWeightCSS font weight (400 = normal, 700 = bold).

Implemented in AeonGUI::PangoTextLayout.

◆ SetText()

virtual void AeonGUI::TextLayout::SetText ( const std::string & aText)
pure virtual

Set the text content to lay out.

Parameters
aTextUTF-8 text string.

Implemented in AeonGUI::PangoTextLayout.


The documentation for this class was generated from the following files: