Unravel Engine C++ Reference
Loading...
Searching...
No Matches
gfx::text_metrics Class Reference

#include <text_metrics.h>

Public Member Functions

 text_metrics (font_manager *manager)
 
auto append_text (font_handle handle, const char *str, const char *end=nullptr) -> void
 Append an ASCII/utf-8 string to the metrics helper.
 
auto append_text (font_handle handle, const wchar_t *str, const wchar_t *end=nullptr) -> void
 Append a wide char string to the metrics helper.
 
auto get_width () const -> float
 Return the width of the measured text.
 
auto get_height () const -> float
 Return the height of the measured text.
 
auto clear_text () -> void
 Clear the width and height of the measured text.
 

Detailed Description

Definition at line 13 of file text_metrics.h.

Constructor & Destructor Documentation

◆ text_metrics()

gfx::text_metrics::text_metrics ( font_manager * manager)

Definition at line 11 of file text_metrics.cpp.

Member Function Documentation

◆ append_text() [1/2]

void gfx::text_metrics::append_text ( font_handle handle,
const char * str,
const char * end = nullptr ) -> void

Append an ASCII/utf-8 string to the metrics helper.

Definition at line 20 of file text_metrics.cpp.

◆ append_text() [2/2]

auto gfx::text_metrics::append_text ( font_handle handle,
const wchar_t * str,
const wchar_t * end = nullptr ) -> void

Append a wide char string to the metrics helper.

◆ clear_text()

void gfx::text_metrics::clear_text ( ) -> void

Clear the width and height of the measured text.

Definition at line 16 of file text_metrics.cpp.

◆ get_height()

auto gfx::text_metrics::get_height ( ) const -> float
inline

Return the height of the measured text.

Definition at line 31 of file text_metrics.h.

◆ get_width()

auto gfx::text_metrics::get_width ( ) const -> float
inline

Return the width of the measured text.

Definition at line 25 of file text_metrics.h.


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