FastUIDraw
|
A GlyphMetrics provides information on the metrics of a glyph, all the values are in units of the font glyph. The function units_per_EM() provides the conversion factor to pixel coordinates via where PixelSize is the pixel size in which one is to render the text. More...
#include <glyph_metrics.hpp>
Public Member Functions | |
GlyphMetrics (void) | |
vec2 | advance (void) const |
const reference_counted_ptr< const FontBase > & | font (void) const |
uint32_t | glyph_code (void) const |
vec2 | horizontal_layout_offset (void) const |
vec2 | size (void) const |
float | units_per_EM (void) const |
bool | valid (void) const |
vec2 | vertical_layout_offset (void) const |
Friends | |
class | Glyph |
class | GlyphCache |
A GlyphMetrics provides information on the metrics of a glyph, all the values are in units of the font glyph. The function units_per_EM() provides the conversion factor to pixel coordinates via where PixelSize is the pixel size in which one is to render the text.
Definition at line 47 of file glyph_metrics.hpp.
|
inline |
Ctor.
Definition at line 53 of file glyph_metrics.hpp.
vec2 fastuidraw::GlyphMetrics::advance | ( | void | ) | const |
How much (in font coordinates) to advance the pen after drawing the glyph. The x-coordinate holds the advance when performing layout horizontally and the y-coordinate when performing layout vertically.
const reference_counted_ptr<const FontBase>& fastuidraw::GlyphMetrics::font | ( | void | ) | const |
Font of the glyph
uint32_t fastuidraw::GlyphMetrics::glyph_code | ( | void | ) | const |
The index of the glyph into the -font- of the glyph
vec2 fastuidraw::GlyphMetrics::horizontal_layout_offset | ( | void | ) | const |
The offset (in font coordinates) from the pen at which to display the glyph when performing horizontal text layout.
vec2 fastuidraw::GlyphMetrics::size | ( | void | ) | const |
Size (in font coordinates) at which to draw the glyph.
float fastuidraw::GlyphMetrics::units_per_EM | ( | void | ) | const |
The number of font units per EM for the glyph. The conversion from font coordinates to pixel coordiantes is given by:
|
inline |
Returns true if the Glyph refers to actual glyph data
Definition at line 62 of file glyph_metrics.hpp.
vec2 fastuidraw::GlyphMetrics::vertical_layout_offset | ( | void | ) | const |
The offset (in font coordinates) from the pen at which to display the glyph when performing horizontal text layout.