aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Font/TTF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/Font/TTF.cpp')
-rw-r--r--src/libjin/Graphics/Font/TTF.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libjin/Graphics/Font/TTF.cpp b/src/libjin/Graphics/Font/TTF.cpp
index 98e57dd..5c77e7f 100644
--- a/src/libjin/Graphics/Font/TTF.cpp
+++ b/src/libjin/Graphics/Font/TTF.cpp
@@ -55,6 +55,20 @@ namespace graphics
free(raw.data);
}
+ TTF* TTFData::createTTF(unsigned ttfsize)
+ {
+ TTF* ttf;
+ try
+ {
+ ttf = new TTF(this, ttfsize);
+ }
+ catch (...)
+ {
+ return nullptr;
+ }
+ return ttf;
+ }
+
/*
* (0, 0)
* +--------------+ ascent
@@ -417,6 +431,7 @@ namespace graphics
const Color* bitmap = ttf->getCodepointBitmap(character, &w, &h, &xoff, &yoff);
int adw, lsb;
{
+ /* bake glyph */
ttf->getHMetrics(character, &adw, &lsb);
ttf->popTTFsize();
if (cursor.x + adw > textureWidth )