Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::text::FreeTypeFont::GlyphMetrics Struct Reference

This struct represents the metrics for a single glyph. More...

#include "freetypefont.h"

Collaboration diagram for ion::text::FreeTypeFont::GlyphMetrics:

Public Member Functions

 GlyphMetrics ()
 The default constructor initializes everything to 0. More...
 
bool IsZeroSize () const
 Returns true if glyph x- or y-size is zero. More...
 

Public Attributes

math::Vector2f size
 Width and height of the glyph, in pixels. More...
 
math::Vector2f bitmap_offset
 Distance in X and Y from the baseline to the top left pixel of the glyph bitmap, in pixels. More...
 
math::Vector2f advance
 Number of pixels to advance in X and Y to draw the next glyph after this. More...
 

Detailed Description

This struct represents the metrics for a single glyph.

Todo:
(user): Consider using fractional units of a pixel for better sub-pixel positioning. (FreeType2 uses 1/64ths.)

Definition at line 40 of file freetypefont.h.

Constructor & Destructor Documentation

ion::text::FreeTypeFont::GlyphMetrics::GlyphMetrics ( )
inline

The default constructor initializes everything to 0.

Definition at line 42 of file freetypefont.h.

Member Function Documentation

bool ion::text::FreeTypeFont::GlyphMetrics::IsZeroSize ( ) const
inline

Returns true if glyph x- or y-size is zero.

Definition at line 46 of file freetypefont.h.

Member Data Documentation

math::Vector2f ion::text::FreeTypeFont::GlyphMetrics::advance

Number of pixels to advance in X and Y to draw the next glyph after this.

Definition at line 57 of file freetypefont.h.

math::Vector2f ion::text::FreeTypeFont::GlyphMetrics::bitmap_offset

Distance in X and Y from the baseline to the top left pixel of the glyph bitmap, in pixels.

This should be added to the current position when drawing the glyph. The Y distance is positive for an upward offset.

Definition at line 54 of file freetypefont.h.

Referenced by ion::text::ComputeTextSize().

math::Vector2f ion::text::FreeTypeFont::GlyphMetrics::size

Width and height of the glyph, in pixels.

Definition at line 49 of file freetypefont.h.

Referenced by ion::text::ComputeTextSize().


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