Castor3D 0.16.0
Multiplatform 3D engine
|
#include <Font.hpp>
Classes | |
class | BinaryLoader |
Font loader. More... | |
struct | SFontImpl |
Structure used to load glyphs on demand. More... | |
Public Member Functions | |
CU_DeclareVector (Glyph, Glyph) | |
CU_API | Font (String const &name, uint32_t height) |
Constructor. | |
CU_API | Font (String const &name, uint32_t height, Path const &path) |
Constructor. | |
virtual CU_API | ~Font () noexcept=default |
Destructor. | |
CU_API void | loadGlyph (char32_t c) |
Loads wanted glyph. | |
CU_API TextMetrics | getTextMetrics (std::u32string const &v, uint32_t maxWidth, bool splitLines) const |
Retrieves the metrics of given text. | |
bool | hasGlyphAt (char32_t c) const |
Tells if the font already has load ed the wanted glyph. | |
Glyph const & | getGlyphAt (char32_t c) const |
Retrieves the glyph of wanted chaaracter. | |
Glyph & | getGlyphAt (char32_t c) |
Retrieves the glyph of wanted chaaracter. | |
Glyph const & | operator[] (char32_t c) const |
Retrieves the glyph of wanted chaaracter. | |
Glyph & | operator[] (char32_t c) |
Retrieves the glyph of wanted chaaracter. | |
uint32_t | getHeight () const noexcept |
Retrieves the height of the font. | |
uint32_t | getMaxHeight () const noexcept |
Retrieves the max height of the glyphs. | |
Point2i | getMaxRange () const noexcept |
Retrieves the max height of the glyphs. | |
uint32_t | getMaxWidth () const noexcept |
Retrieves the max width of the glyphs. | |
void | setGlyphLoader (castor::RawUniquePtr< SFontImpl > loader) noexcept |
sets the glyph loader | |
bool | hasGlyphLoader () const noexcept |
Tells if the font has a glyph loader. | |
SFontImpl & | getGlyphLoader () const noexcept |
Retrieves the glyph loader. | |
auto | begin () noexcept |
Retrieves an iterator on the first glyph. | |
auto | begin () const noexcept |
Retrieves an iterator on the first glyph. | |
auto | end () noexcept |
Retrieves an iterator on the glyph array end. | |
auto | end () const noexcept |
Retrieves an iterator on the glyph array end. | |
void | setFaceName (String name) noexcept |
sets The font face name | |
String const & | getFaceName () const noexcept |
Retrieves The font face name. | |
Path const & | getFilePath () const noexcept |
Retrieves The font file path. | |
void | initialise () const noexcept |
void | cleanup () const noexcept |
bool | isSerialisable () const noexcept |
void | setSerialisable (bool v) noexcept |
Public Member Functions inherited from castor::NamedBaseT< T > | |
NamedBaseT (T name) noexcept | |
Constructor. | |
T const & | getName () const noexcept |
Retrieves the name. | |
void | rename (T name) noexcept |
Additional Inherited Members | |
Protected Attributes inherited from castor::NamedBaseT< T > | |
T | m_name |
Constructor.
[in] | name | The font name |
[in] | height | The font char height |
Constructor.
[in] | path | The font file path |
[in] | name | The font name |
[in] | height | The font char height |
|
virtualdefaultnoexcept |
Destructor.
|
inlinenoexcept |
Retrieves an iterator on the first glyph.
|
inlinenoexcept |
Retrieves an iterator on the first glyph.
|
inlinenoexcept |
|
inlinenoexcept |
Retrieves an iterator on the glyph array end.
|
inlinenoexcept |
Retrieves an iterator on the glyph array end.
|
inlinenoexcept |
Retrieves The font face name.
|
inlinenoexcept |
Retrieves The font file path.
|
inline |
Retrieves the glyph of wanted chaaracter.
[in] | c | The wanted character |
|
inline |
Retrieves the glyph of wanted chaaracter.
[in] | c | The wanted character |
|
inlinenoexcept |
Retrieves the glyph loader.
|
inlinenoexcept |
Retrieves the height of the font.
|
inlinenoexcept |
Retrieves the max height of the glyphs.
|
inlinenoexcept |
Retrieves the max height of the glyphs.
|
inlinenoexcept |
Retrieves the max width of the glyphs.
CU_API TextMetrics castor::Font::getTextMetrics | ( | std::u32string const & | v, |
uint32_t | maxWidth, | ||
bool | splitLines ) const |
Retrieves the metrics of given text.
[in] | v | The text. |
[in] | maxWidth | The maximum width if splitLines is true . |
[in] | splitLines | true to split lines according to maxWidth . |
|
inline |
Tells if the font already has load ed the wanted glyph.
[in] | c | The character. |
Referenced by operator[](), and operator[]().
|
inlinenoexcept |
Tells if the font has a glyph loader.
|
inlinenoexcept |
|
inlinenoexcept |
CU_API void castor::Font::loadGlyph | ( | char32_t | c | ) |
Loads wanted glyph.
[in] | c | The character. |
|
inline |
Retrieves the glyph of wanted chaaracter.
[in] | c | The wanted character |
References CU_Ensure, and hasGlyphAt().
|
inline |
Retrieves the glyph of wanted chaaracter.
[in] | c | The wanted character |
References CU_Ensure, and hasGlyphAt().
|
inlinenoexcept |
sets The font face name
[in] | name | The value |
|
inlinenoexcept |
sets the glyph loader
[in] | loader | The value |
|
inlinenoexcept |