TTF
This commit is contained in:
@ -9,14 +9,9 @@
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
TrueTypeTexture::TrueTypeTexture(
|
||||
FT_Face face,
|
||||
uint32_t fontSize,
|
||||
uint8_t style
|
||||
) :
|
||||
TrueTypeTexture::TrueTypeTexture(FT_Face face, uint32_t fontSize) :
|
||||
face(face),
|
||||
fontSize(fontSize),
|
||||
style(style)
|
||||
fontSize(fontSize)
|
||||
{
|
||||
assertTrue(fontSize < 256, "Font size cannot be greater than 256");
|
||||
|
||||
@ -29,8 +24,8 @@ TrueTypeTexture::TrueTypeTexture(
|
||||
|
||||
// Set the texture size
|
||||
texture->setSize(
|
||||
4096,
|
||||
4096,
|
||||
fontSize * 26,
|
||||
fontSize * 26,
|
||||
TextureFormat::R,
|
||||
TextureDataFormat::UNSIGNED_BYTE
|
||||
);
|
||||
|
@ -15,20 +15,15 @@ namespace Dawn {
|
||||
FT_Face face;
|
||||
std::shared_ptr<Texture> texture;
|
||||
uint32_t fontSize;
|
||||
uint8_t style;
|
||||
std::unordered_map<wchar_t, struct TrueTypeCharacter> characterData;
|
||||
|
||||
/**
|
||||
* Construct a new New True Type Face Texture object
|
||||
*
|
||||
* @param face The freetype face object.
|
||||
* @param style Style that this font has, used for locking.
|
||||
* @param fontSize The font size to render at.
|
||||
*/
|
||||
TrueTypeTexture(
|
||||
FT_Face face,
|
||||
uint32_t fontSize,
|
||||
uint8_t style
|
||||
);
|
||||
TrueTypeTexture(FT_Face face, uint32_t fontSize);
|
||||
|
||||
/**
|
||||
* Returns the character data for the given character.
|
||||
|
Reference in New Issue
Block a user