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

Compute text crop area for text using a single font. More...

#include <text_metrics.h>

Public Member Functions

 text_line_metrics (const font_info &info)
 
auto get_line_height () const -> float
 Return the height of a line of text using the given font.
 
auto get_line_count (const bx::StringView &str) const -> uint32_t
 Return the number of text line in the given text.
 
void get_sub_text (const bx::StringView &str, uint32_t first_line, uint32_t last_line, const char *&begin, const char *&end)
 Return the first and last character visible in the [first_line, last_line] range.
 

Detailed Description

Compute text crop area for text using a single font.

Definition at line 49 of file text_metrics.h.

Constructor & Destructor Documentation

◆ text_line_metrics()

gfx::text_line_metrics::text_line_metrics ( const font_info & info)

Definition at line 81 of file text_metrics.cpp.

Member Function Documentation

◆ get_line_count()

auto gfx::text_line_metrics::get_line_count ( const bx::StringView & str) const -> uint32_t

Return the number of text line in the given text.

Definition at line 86 of file text_metrics.cpp.

◆ get_line_height()

auto gfx::text_line_metrics::get_line_height ( ) const -> float
inline

Return the height of a line of text using the given font.

Definition at line 55 of file text_metrics.h.

◆ get_sub_text()

void gfx::text_line_metrics::get_sub_text ( const bx::StringView & str,
uint32_t first_line,
uint32_t last_line,
const char *& begin,
const char *& end )

Return the first and last character visible in the [first_line, last_line] range.

Definition at line 106 of file text_metrics.cpp.


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