|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
#include <Font.hpp>


Public Member Functions | |
| Font (IGraphicsDevice device, string path, uint size, string supportedCharacters) | |
| Font (IGraphicsDevice device, string path, uint size=14) | |
| Font (IntPtr handle) | |
| Glyph? | GetCharGliph (char chr) |
| Rectangle? | GetSourceRectangle (char chr) |
| Font (IGraphicsDevice *device, const std::filesystem::path &path, unsigned size, const char *supportedCharacters=nullptr) | |
| Constructs a Font type, with specified size and supported characters. | |
| Font (IGraphicsDevice *device, const std::filesystem::path &path) | |
| Loads a TTF font. | |
| Font (const Font &)=delete | |
| Font (Font &&font) noexcept | |
| Move constructor. Transfers the ownership of the given Font instance to this instance. | |
| Font & | operator= (const Font &)=delete |
| Font & | operator= (Font &&other) noexcept |
| Move assignment operator. | |
| unsigned | Size () const noexcept |
| Returns the size the font was created with. | |
| const std::string | SupportedCharacters () const noexcept |
| Returns a copy of the supported characters. | |
| ITexture2D * | GetTexture () const noexcept |
| Returns the texture containing all glyphs. | |
| std::optional< Glyph > | GetCharGlyph (char chr) const noexcept |
| Gets the glyph of a specific character. | |
| std::optional< Math::Rectangle > | GetCharSourceRectangle (char chr) const noexcept |
| Gets the source rectangle of a specified character. | |
| ~Font () | |
| Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| virtual void | Dispose () |
Properties | |
| uint | Size [get] |
| string | SupportedCharacters [get] |
| ITexture2D | Texture [get] |
| Properties inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | Handle [get] |
Additional Inherited Members | |
| Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy) | |
| NatPtrWrapper (Action< IntPtr > fnDestroy) | |
| void | Reset (IntPtr newObj) |
| void | Dispose (bool disposing) |
| Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | _handle |
| bool | _disposed |
Represents a Font.
Fonts are being loaded using FreeType. When loading fonts, a single texture is created containing all supported characters. The texture is trivially packed (in a left-right, up-down order).
|
inline |
|
inline |
|
inline |
| Font::Font | ( | IGraphicsDevice * | device, |
| const std::filesystem::path & | path, | ||
| unsigned | size, | ||
| const char * | supportedCharacters = nullptr ) |
| Font::Font | ( | IGraphicsDevice * | device, |
| const std::filesystem::path & | path ) |
Loads a TTF font.
| device | Graphics Device |
| path | TTF font file path |
|
delete |
|
noexcept |
| Font::~Font | ( | ) |
|
inline |
|
noexcept |
Gets the glyph of a specific character.
| chr | Character. |
|
noexcept |
Gets the source rectangle of a specified character.
| chr | Character. |
|
inline |
|
noexcept |
Returns the texture containing all glyphs.
|
noexcept |
Returns the size the font was created with.
|
noexcept |
Returns a copy of the supported characters.
|
get |
|
get |
|
get |