libGumball 0.0.1
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_font.h File Reference

Go to the source code of this file.

Macros

Type System

Type UUID and cast operators

#define GUM_FONT_TYPE
#define GUM_FONT(self)
#define GUM_FONT_CLASS(klass)
#define GUM_FONT_CLASSOF(self)
#define GUM_TEXT_ALIGNMENT_TYPE

Enumerations

enum  GUM_TextAlignment

Functions

GBL_EXPORT GUM_Vector2 GUM_Font_measureText (GUM_Font *pFont, GblStringRef *pText, uint8_t fontSize) GBL_NOEXCEPT

Detailed Description

GUM_Font data structure and hierarchy graph

GUM_Font is the backend-agnostic font type used in libGumball

Todo
  • Replace text alignments with flags for TOP, RIGHT, BOTTOM, LEFT, CENTER
Author
2025 Agustín Bellagamba

Macro Definition Documentation

◆ GUM_FONT_TYPE

#define GUM_FONT_TYPE

Returns the GUM_Font Type UUID.

◆ GUM_FONT

#define GUM_FONT ( self)

Casts an instance of a compatible element to a GUM_Font.

◆ GUM_FONT_CLASS

#define GUM_FONT_CLASS ( klass)

Casts an class of a compatible element to a GUM_Font.

◆ GUM_FONT_CLASSOF

#define GUM_FONT_CLASSOF ( self)

Casts an instance of a compatible element to a GUM_Font.

◆ GUM_TEXT_ALIGNMENT_TYPE

#define GUM_TEXT_ALIGNMENT_TYPE

Returns the GUM_TextAlignment Type UUID.

Enumeration Type Documentation

◆ GUM_TextAlignment

Enumerator
GUM_TEXT_ALIGN_CENTER 

Align the text to the center of the widget.

GUM_TEXT_ALIGN_TOP 

Align the text to the top of the widget.

GUM_TEXT_ALIGN_RIGHT 

Align the text to the right of the widget.

GUM_TEXT_ALIGN_BOTTOM 

Align the text to the bottom of the widget.

GUM_TEXT_ALIGN_LEFT 

Align the text to the left of the widget.

55 {
56 GUM_TEXT_ALIGN_CENTER, //!< Align the text to the center of the widget
57 GUM_TEXT_ALIGN_TOP, //!< Align the text to the top of the widget
58 GUM_TEXT_ALIGN_RIGHT, //!< Align the text to the right of the widget
59 GUM_TEXT_ALIGN_BOTTOM, //!< Align the text to the bottom of the widget
60 GUM_TEXT_ALIGN_LEFT //!< Align the text to the left of the widget
GUM_TextAlignment
Definition gumball_font.h:55
@ GUM_TEXT_ALIGN_CENTER
Align the text to the center of the widget.
Definition gumball_font.h:56
@ GUM_TEXT_ALIGN_TOP
Align the text to the top of the widget.
Definition gumball_font.h:57
@ GUM_TEXT_ALIGN_BOTTOM
Align the text to the bottom of the widget.
Definition gumball_font.h:59
@ GUM_TEXT_ALIGN_RIGHT
Align the text to the right of the widget.
Definition gumball_font.h:58
@ GUM_TEXT_ALIGN_LEFT
Align the text to the left of the widget.
Definition gumball_font.h:60

Function Documentation

◆ GUM_Font_measureText()

GBL_EXPORT GUM_Vector2 GUM_Font_measureText ( GUM_Font * pFont,
GblStringRef * pText,
uint8_t fontSize )

Returns the size of the passed text, given the font and font size.