Untitled Game engine no.5
1.0
|
5 #ifndef ENGINE_PROJ_GLYPH_H
6 #define ENGINE_PROJ_GLYPH_H
9 #include "Components.hpp"
10 #include "MeshRenderer.hpp"
11 #include "Texture.hpp"
12 #include "GLTexture.hpp"
14 #include FT_FREETYPE_H
26 uint cwidth, uint cheight, int32_t leftShift, int32_t topShift, uint32_t adv):
74 explicit Font(
const char * path);
99 #endif //ENGINE_PROJ_GLYPH_H
Scene Component for passing drawing data to the renderer. Stores vertex data and references to the te...
Definition: MeshRenderer.hpp:15
static uint GLYPH_COUNT
Number of required glyphs.
Definition: Font.hpp:66
Data structure for storing font texture data. Doubles as a library for loading fonts into memory.
Definition: Font.hpp:63
Ref< TextureMap > map
Mapping reference.
Definition: Texture.hpp:97
static FT_Library FT
link to the Freetype font library
Definition: Font.hpp:68
Glyph(const Ref< Texture > &texture, const Ref< TextureMap > &map, uint cwidth, uint cheight, int32_t leftShift, int32_t topShift, uint32_t adv)
create a glyph from a texture and character data
Definition: Font.hpp:25
std::shared_ptr< T > Ref
Has stuff for making references a lot more easily shared smart pointer.
Definition: Base.hpp:21
void renderText(const std::string &text, Ref< MeshRenderer > &meshRenderer, Allignment alignment=CENTER, float z=0)
Renders texture data from a string and applies it to a MeshRenderer.
Definition: Font.cpp:86
Wrapper for a texture reference and a texture mapping.
Definition: Texture.hpp:92
static void FinalizeFonts()
Delete any font loader data, not font texture data.
Definition: Font.cpp:28
Allignment
enumeration representing alignment of text in a string of text.
Definition: Components.hpp:358
std::vector< Ref< Glyph > > glyphs
lookup table from a ascii character code to graphical data
Definition: Font.hpp:77
int top
distance from the texture to the top of the line
Definition: Font.hpp:31
Font(const char *path)
Load a font object from a system path.
Definition: Font.cpp:32
static void InitFont()
Initialize global font data.
Definition: Font.cpp:24
Definition: Animation.hpp:14
uint32_t advance
total size of the character from the edge of the last character to beginning of the next character
Definition: Font.hpp:33
int left
distance from the texture to the end of the last character
Definition: Font.hpp:27
bool singleTex
is there one texture for all of the characters?
Definition: Font.hpp:79