![]() |
Castor3D 0.17.0
Multiplatform 3D engine
|
#include <Font.hpp>
Classes | |
class | BinaryLoader |
Font loader. More... | |
struct | GlyphLoader |
Structure used to load glyphs on demand. More... | |
struct | SdfInfo |
Public Types | |
using | GlyphKerning = Map< char32_t, float > |
using | GlyphKerningMap = Map< char32_t, GlyphKerning > |
Public Member Functions | |
CU_DeclareVector (Glyph, Glyph) | |
CU_API | Font (String const &name, uint32_t height) |
Non SDF font constructor. | |
CU_API | Font (String const &name, uint32_t height, Path const &path) |
Non SDF font constructor. | |
CU_API | Font (String const &name) |
SDF font constructor. | |
CU_API | Font (String const &name, Path const &path) |
SDF font 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, uint32_t height) const |
Retrieves the metrics of given text. | |
CU_API TextMetrics | getTextMetrics (std::u32string const &v, uint32_t maxWidth, bool splitLines) const |
Retrieves the metrics of given text. | |
CU_API float | getKerning (char32_t lhs, char32_t rhs, uint32_t height) const |
Retrieves the kerning between two characters. | |
CU_API float | getKerning (char32_t lhs, char32_t rhs) const |
Retrieves the kerning between two characters. | |
bool | hasGlyphAt (char32_t c) const |
Glyph const & | getGlyphAt (char32_t c) const |
Glyph & | getGlyphAt (char32_t c) |
Array access. | |
Glyph const & | operator[] (char32_t c) const |
Glyph & | operator[] (char32_t c) |
Iteration. | |
auto | begin () noexcept |
auto | begin () const noexcept |
auto | end () noexcept |
auto | end () const noexcept |
Getters. | |
uint32_t | getHeight () const noexcept |
uint32_t | getMaxGlyphHeight () const noexcept |
uint32_t | getMaxGlyphWidth () const noexcept |
Point2f | getMaxBearing () const noexcept |
uint32_t | getMaxImageWidth () const noexcept |
uint32_t | getMaxImageHeight () const noexcept |
bool | hasGlyphLoader () const noexcept |
GlyphLoader & | getGlyphLoader () const noexcept |
String const & | getFaceName () const noexcept |
Path const & | getFilePath () const noexcept |
bool | isSerialisable () const noexcept |
bool | isSDF () const noexcept |
float | getPixelRange () const noexcept |
float | getVerticalAdvance () const noexcept |
![]() | |
NamedBaseT (T name) noexcept | |
Constructor. | |
T const & | getName () const noexcept |
Retrieves the name. | |
void | rename (T name) noexcept |
Friends | |
class | BinaryLoader |
Mutators. | |
void | setGlyphLoader (castor::RawUniquePtr< GlyphLoader > loader) noexcept |
void | setFaceName (String name) noexcept |
void | setSerialisable (bool v) noexcept |
Additional Inherited Members | |
![]() | |
T | m_name |
using castor::Font::GlyphKerning = Map< char32_t, float > |
using castor::Font::GlyphKerningMap = Map< char32_t, GlyphKerning > |
Non SDF font constructor.
[in] | name | The font name. |
[in] | height | The font char height. |
Non SDF font constructor.
[in] | path | The font file path. |
[in] | name | The font name. |
[in] | height | The font char height. |
SDF font constructor.
[in] | name | The font name. |
SDF font constructor.
[in] | path | The font file path. |
[in] | name | The font name. |
|
virtualdefaultnoexcept |
Destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
[in] | c | The wanted character. |
|
inline |
[in] | c | The wanted character. |
|
inlinenoexcept |
|
inlinenoexcept |
CU_API float castor::Font::getKerning | ( | char32_t | lhs, |
char32_t | rhs ) const |
Retrieves the kerning between two characters.
[in] | lhs,rhs | The characters. |
CU_API float castor::Font::getKerning | ( | char32_t | lhs, |
char32_t | rhs, | ||
uint32_t | height ) const |
Retrieves the kerning between two characters.
[in] | lhs,rhs | The characters. |
[in] | height | The font height considered for computing. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
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 . |
CU_API TextMetrics castor::Font::getTextMetrics | ( | std::u32string const & | v, |
uint32_t | maxWidth, | ||
bool | splitLines, | ||
uint32_t | height ) 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 . |
[in] | height | The font height considered for computing. |
|
inlinenoexcept |
|
inline |
[in] | c | The character. |
true
if the font already has loaded the wanted glyph. Referenced by operator[](), and operator[]().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
CU_API void castor::Font::loadGlyph | ( | char32_t | c | ) |
Loads wanted glyph.
[in] | c | The character. |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |