Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::text::Layout Class Reference

A Layout instance specifies how glyphs are arranged to form text. More...

#include "layout.h"

Classes

struct  Glyph
 A Glyph represents one character glyph in the layout. More...
 
struct  Quad
 A Quad represents a 3D quadrilateral onto which a character glyph in the layout will be drawn. More...
 

Public Member Functions

 Layout ()
 
 ~Layout ()
 
bool AddGlyph (const Glyph &glyph)
 Adds a Glyph to the layout. More...
 
size_t GetGlyphCount () const
 Returns the number of glyphs added to the layout. More...
 
void Reserve (size_t s)
 Reserves space for at least s glyphs. More...
 
const GlyphGetGlyph (size_t i) const
 Returns the indexed glyph. More...
 
bool ReplaceGlyph (size_t i, const Glyph &new_glyph)
 Modifies the indexed glyph. More...
 
void GetGlyphSet (GlyphSet *glyphs) const
 Populates glyphs with the glyph indexes appearing in this Layout. More...
 
float GetLineAdvanceHeight () const
 Returns the vertical distance between successive baselines in multiline text, scaled to the same units as the glyph's Quads. More...
 
void SetLineAdvanceHeight (float line_advance)
 Sets the vertical distance between successive baselines. More...
 

Detailed Description

A Layout instance specifies how glyphs are arranged to form text.

Each glyph is represented by four 3D points forming a quadrilateral covered by the glyph and the index of the glyph's character within the font.

Definition at line 127 of file layout.h.

Constructor & Destructor Documentation

ion::text::Layout::Layout ( )
inline

Definition at line 183 of file layout.h.

ion::text::Layout::~Layout ( )
inline

Definition at line 184 of file layout.h.

Member Function Documentation

bool ion::text::Layout::AddGlyph ( const Glyph glyph)

Adds a Glyph to the layout.

Does nothing but return false if the index is invalid.

Definition at line 23 of file layout.cc.

References ion::text::Layout::Glyph::glyph_index.

const Layout::Glyph & ion::text::Layout::GetGlyph ( size_t  i) const

Returns the indexed glyph.

Returns an invalid reference if the index does not refer to a previously-added glyph.

Definition at line 35 of file layout.cc.

Referenced by ion::text::operator<<(), and ion::text::Builder::StoreGlyphVertices().

size_t ion::text::Layout::GetGlyphCount ( ) const

Returns the number of glyphs added to the layout.

Definition at line 31 of file layout.cc.

Referenced by ion::text::Builder::Build(), ion::text::BasicBuilder::BuildVertexData(), ion::text::OutlineBuilder::BuildVertexData(), and ion::text::operator<<().

void ion::text::Layout::GetGlyphSet ( GlyphSet glyphs) const

Populates glyphs with the glyph indexes appearing in this Layout.

Definition at line 47 of file layout.cc.

float ion::text::Layout::GetLineAdvanceHeight ( ) const

Returns the vertical distance between successive baselines in multiline text, scaled to the same units as the glyph's Quads.

Definition at line 52 of file layout.cc.

bool ion::text::Layout::ReplaceGlyph ( size_t  i,
const Glyph new_glyph 
)

Modifies the indexed glyph.

Does nothing but return false if the index does not refer to a previously-added glyph or the glyph's index is invalid.

Definition at line 39 of file layout.cc.

References ion::text::Layout::Glyph::glyph_index.

void ion::text::Layout::Reserve ( size_t  s)

Reserves space for at least s glyphs.

Definition at line 33 of file layout.cc.

void ion::text::Layout::SetLineAdvanceHeight ( float  line_advance)

Sets the vertical distance between successive baselines.

Definition at line 56 of file layout.cc.

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


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