Om
1.0.0
A universal framework for multimedia simulation
|
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... | |
AABB2f & | getGlyphBounds (Index glyphIndex) |
Return the bounding box for the glyph at the specified index in this layout. More... | |
const AABB2f & | getGlyphBounds (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... | |
AABB2f & | getLineBounds (Index lineIndex) |
Return the bounding box for the line at the specified index in this layout. More... | |
const AABB2f & | getLineBounds (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 AABB2f & | getBounds () 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... | |
FontMetrics & | getMetrics () |
Return an object containing global font metrics for this glyph layout. More... | |
const FontMetrics & | getMetrics () 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... | |
A class that stores the bounding boxes of glyphs that have the same text style.
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.
|
inline |
Return the number of glyphs in this layout.
Return the UTF-32 character code for the glyph at the specified index in this layout.
Return the character code index within the original string for the glyph at the given index in this layout.
Return the bounding box for the glyph at the specified index in this layout.
|
inline |
Return the bounding box for the glyph at the specified index in this layout.
|
inline |
Set the bounding box for the glyph at the specified index in this layout.
Return the index of the line that contains this glyph.
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.
|
inline |
Return the number of horizontal or vertical lines of glyphs there are in this glyph layout.
Return the bounding box for the line at the specified index in this layout.
Return the bounding box for the line at the specified index in this layout.
|
inline |
Set the bounding box for the line at the specified index in this layout.
Return the horizontal or vertical baseline coordinate for the line at the specified index in this layout.
|
inline |
Set the horizontal or vertical baseline coordinate for the line at the specified index in this layout.
|
inline |
Return the range of glyph indices that the line at the specified index contains.
|
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.
|
inline |
Return A 2D axis-aligned bounding box which completely encloses all glyphs in this layout.
|
inline |
Set a 2D axis-aligned bounding box which completely encloses all glyphs in this layout.
|
inline |
Return an object containing global font metrics for this glyph layout.
|
inline |
Return an object containing global font metrics for this glyph layout.
|
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.