This commit is contained in:
2023-12-04 21:43:31 -06:00
parent 907b604fc9
commit f140b26172
8 changed files with 173 additions and 28 deletions

View File

@ -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
);

View File

@ -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.