FastUIDraw
Public Member Functions | Friends | List of all members
fastuidraw::GlyphMetrics Class Reference

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 $PixelCoordinates = FontCoordinates * PixelSize / units_per_EM()$ 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
 

Detailed Description

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 $PixelCoordinates = FontCoordinates * PixelSize / units_per_EM()$ where PixelSize is the pixel size in which one is to render the text.

Definition at line 47 of file glyph_metrics.hpp.

Constructor & Destructor Documentation

◆ GlyphMetrics()

fastuidraw::GlyphMetrics::GlyphMetrics ( void  )
inline

Ctor.

Definition at line 53 of file glyph_metrics.hpp.

Member Function Documentation

◆ advance()

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.

◆ font()

const reference_counted_ptr<const FontBase>& fastuidraw::GlyphMetrics::font ( void  ) const

Font of the glyph

◆ glyph_code()

uint32_t fastuidraw::GlyphMetrics::glyph_code ( void  ) const

The index of the glyph into the -font- of the glyph

◆ horizontal_layout_offset()

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.

◆ size()

vec2 fastuidraw::GlyphMetrics::size ( void  ) const

Size (in font coordinates) at which to draw the glyph.

◆ units_per_EM()

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: $PixelCoordinates = FontCoordinates * PixelSize / units_per_EM$

◆ valid()

bool fastuidraw::GlyphMetrics::valid ( void  ) const
inline

Returns true if the Glyph refers to actual glyph data

Definition at line 62 of file glyph_metrics.hpp.

◆ vertical_layout_offset()

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.


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