Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | List of all members
om::graphics::gui::fonts::GlyphLayout Class Reference

A class that stores the bounding boxes of glyphs that have the same text style. More...

#include <omGraphicsGUIGlyphLayout.h>

Public Member Functions

 GlyphLayout ()
 Create a default glyph layout with no glyphs and an invalid text style. More...
 
 ~GlyphLayout ()
 Destroy this glyph layout, releasing all internal resources. More...
 
Size getGlyphCount () const
 Return the number of glyphs in this layout. More...
 
UTF32Char getGlyphCharacter (Index glyphIndex) const
 Return the UTF-32 character code for the glyph at the specified index in this layout. More...
 
Index getGlyphLocation (Index glyphIndex) const
 Return the character code index within the original string for the glyph at the given index in this layout. More...
 
AABB2fgetGlyphBounds (Index glyphIndex)
 Return the bounding box for the glyph at the specified index in this layout. More...
 
const AABB2fgetGlyphBounds (Index glyphIndex) const
 Return the bounding box for the glyph at the specified index in this layout. More...
 
void setGlyphBounds (Index glyphIndex, const AABB2f &newBounds)
 Set the bounding box for the glyph at the specified index in this layout. More...
 
Index getGlyphLine (Index glyphIndex) const
 Return the index of the line that contains this glyph. More...
 
void setGlyphLine (Index glyphIndex, Index newLine)
 Set the index of the line that contains this glyph. More...
 
void addGlyph (UTF32Char characater, Index location, Index lineIndex, const AABB2f &bounds)
 Add a new glyph to this glyph layout with the specified character code, location, and bounding box. More...
 
void removeLastGlyphs (Size numToRemove)
 Remove the specified number of glyphs from the end of this layout. More...
 
void clear ()
 Remove all glyphs and lines from this layout, resetting the layout to the intial state. More...
 
Size getLineCount () const
 Return the number of horizontal or vertical lines of glyphs there are in this glyph layout. More...
 
AABB2fgetLineBounds (Index lineIndex)
 Return the bounding box for the line at the specified index in this layout. More...
 
const AABB2fgetLineBounds (Index lineIndex) const
 Return the bounding box for the line at the specified index in this layout. More...
 
void setLineBounds (Index lineIndex, const AABB2f &newBounds)
 Set the bounding box for the line at the specified index in this layout. More...
 
Float getLineBase (Index lineIndex) const
 Return the horizontal or vertical baseline coordinate for the line at the specified index in this layout. More...
 
void setLineBase (Index lineIndex, Float newBaseline)
 Set the horizontal or vertical baseline coordinate for the line at the specified index in this layout. More...
 
const AABB1D< Index > & getLineRange (Index lineIndex) const
 Return the range of glyph indices that the line at the specified index contains. More...
 
void setLineRange (Index lineIndex, const AABB1D< Index > &newGlyphRange)
 Set the range of glyph indices that the line at the specified index contains. More...
 
void addLine (const AABB1D< Index > &newGlyphRange, const AABB2f &newBounds, Float newBaseline)
 Add a new line to this glyph layout with the specified range of glyphs, bounding box, and baseline. More...
 
const AABB2fgetBounds () const
 Return A 2D axis-aligned bounding box which completely encloses all glyphs in this layout. More...
 
void setBounds (const AABB2f &newBounds)
 Set a 2D axis-aligned bounding box which completely encloses all glyphs in this layout. More...
 
FontMetricsgetMetrics ()
 Return an object containing global font metrics for this glyph layout. More...
 
const FontMetricsgetMetrics () const
 Return an object containing global font metrics for this glyph layout. More...
 
void setMetrics (const FontMetrics &newMetrics)
 Set an object containing global font metrics for this glyph layout. More...
 
Bool pickGlyph (const Vector2f &point, Index &glyphIndex) const
 Determine the index of the glyph that is closest to the specified point. More...
 
Bool pickGlyphInLine (Index lineIndex, Float position, Index &glyphIndex) const
 Determine the index of the glyph that is closest to the specified position along the line with the given index. More...
 

Detailed Description

A class that stores the bounding boxes of glyphs that have the same text style.

Constructor & Destructor Documentation

om::graphics::gui::fonts::GlyphLayout::GlyphLayout ( )

Create a default glyph layout with no glyphs and an invalid text style.

om::graphics::gui::fonts::GlyphLayout::~GlyphLayout ( )

Destroy this glyph layout, releasing all internal resources.

Member Function Documentation

Size om::graphics::gui::fonts::GlyphLayout::getGlyphCount ( ) const
inline

Return the number of glyphs in this layout.

UTF32Char om::graphics::gui::fonts::GlyphLayout::getGlyphCharacter ( Index  glyphIndex) const
inline

Return the UTF-32 character code for the glyph at the specified index in this layout.

Index om::graphics::gui::fonts::GlyphLayout::getGlyphLocation ( Index  glyphIndex) const
inline

Return the character code index within the original string for the glyph at the given index in this layout.

AABB2f& om::graphics::gui::fonts::GlyphLayout::getGlyphBounds ( Index  glyphIndex)
inline

Return the bounding box for the glyph at the specified index in this layout.

const AABB2f& om::graphics::gui::fonts::GlyphLayout::getGlyphBounds ( Index  glyphIndex) const
inline

Return the bounding box for the glyph at the specified index in this layout.

void om::graphics::gui::fonts::GlyphLayout::setGlyphBounds ( Index  glyphIndex,
const AABB2f newBounds 
)
inline

Set the bounding box for the glyph at the specified index in this layout.

Index om::graphics::gui::fonts::GlyphLayout::getGlyphLine ( Index  glyphIndex) const
inline

Return the index of the line that contains this glyph.

void om::graphics::gui::fonts::GlyphLayout::setGlyphLine ( Index  glyphIndex,
Index  newLine 
)
inline

Set the index of the line that contains this glyph.

void om::graphics::gui::fonts::GlyphLayout::addGlyph ( UTF32Char  characater,
Index  location,
Index  lineIndex,
const AABB2f bounds 
)

Add a new glyph to this glyph layout with the specified character code, location, and bounding box.

void om::graphics::gui::fonts::GlyphLayout::removeLastGlyphs ( Size  numToRemove)

Remove the specified number of glyphs from the end of this layout.

void om::graphics::gui::fonts::GlyphLayout::clear ( )

Remove all glyphs and lines from this layout, resetting the layout to the intial state.

Size om::graphics::gui::fonts::GlyphLayout::getLineCount ( ) const
inline

Return the number of horizontal or vertical lines of glyphs there are in this glyph layout.

AABB2f& om::graphics::gui::fonts::GlyphLayout::getLineBounds ( Index  lineIndex)
inline

Return the bounding box for the line at the specified index in this layout.

const AABB2f& om::graphics::gui::fonts::GlyphLayout::getLineBounds ( Index  lineIndex) const
inline

Return the bounding box for the line at the specified index in this layout.

void om::graphics::gui::fonts::GlyphLayout::setLineBounds ( Index  lineIndex,
const AABB2f newBounds 
)
inline

Set the bounding box for the line at the specified index in this layout.

Float om::graphics::gui::fonts::GlyphLayout::getLineBase ( Index  lineIndex) const
inline

Return the horizontal or vertical baseline coordinate for the line at the specified index in this layout.

void om::graphics::gui::fonts::GlyphLayout::setLineBase ( Index  lineIndex,
Float  newBaseline 
)
inline

Set the horizontal or vertical baseline coordinate for the line at the specified index in this layout.

const AABB1D<Index>& om::graphics::gui::fonts::GlyphLayout::getLineRange ( Index  lineIndex) const
inline

Return the range of glyph indices that the line at the specified index contains.

void om::graphics::gui::fonts::GlyphLayout::setLineRange ( Index  lineIndex,
const AABB1D< Index > &  newGlyphRange 
)
inline

Set the range of glyph indices that the line at the specified index contains.

void om::graphics::gui::fonts::GlyphLayout::addLine ( const AABB1D< Index > &  newGlyphRange,
const AABB2f newBounds,
Float  newBaseline 
)

Add a new line to this glyph layout with the specified range of glyphs, bounding box, and baseline.

const AABB2f& om::graphics::gui::fonts::GlyphLayout::getBounds ( ) const
inline

Return A 2D axis-aligned bounding box which completely encloses all glyphs in this layout.

void om::graphics::gui::fonts::GlyphLayout::setBounds ( const AABB2f newBounds)
inline

Set a 2D axis-aligned bounding box which completely encloses all glyphs in this layout.

FontMetrics& om::graphics::gui::fonts::GlyphLayout::getMetrics ( )
inline

Return an object containing global font metrics for this glyph layout.

const FontMetrics& om::graphics::gui::fonts::GlyphLayout::getMetrics ( ) const
inline

Return an object containing global font metrics for this glyph layout.

void om::graphics::gui::fonts::GlyphLayout::setMetrics ( const FontMetrics newMetrics)
inline

Set an object containing global font metrics for this glyph layout.

Bool om::graphics::gui::fonts::GlyphLayout::pickGlyph ( const Vector2f point,
Index glyphIndex 
) const

Determine the index of the glyph that is closest to the specified point.

The method finds the closest glyph to the point and puts the index of that glyph in the output parameter and returns TRUE. If there is no glyph containing that point, FALSE is returned.

Bool om::graphics::gui::fonts::GlyphLayout::pickGlyphInLine ( Index  lineIndex,
Float  position,
Index glyphIndex 
) const

Determine the index of the glyph that is closest to the specified position along the line with the given index.

The method finds the closest glyph to the position and puts the index of that glyph in the output parameter and returns TRUE. If there is no glyph containing that point, FALSE is returned.


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