diff --git a/configure.py b/configure.py index ee9b9679..11d3dcfd 100755 --- a/configure.py +++ b/configure.py @@ -553,7 +553,7 @@ LIBS = [ "Kyoto/Text/CWordBreakTables", "Kyoto/Text/CWordInstruction", "Kyoto/Text/CBlockInstruction", - "Kyoto/Text/CFont", + ["Kyoto/Text/CFont", True], ["Kyoto/Graphics/CLight", True], "Kyoto/Graphics/CCubeModel", ["Kyoto/Graphics/CGX", True], diff --git a/include/Kyoto/Text/CFont.hpp b/include/Kyoto/Text/CFont.hpp index 4e204dc3..6a996bee 100644 --- a/include/Kyoto/Text/CFont.hpp +++ b/include/Kyoto/Text/CFont.hpp @@ -1,13 +1,16 @@ #ifndef _CFONT #define _CFONT +#include "Kyoto/Graphics/CColor.hpp" + class CFont { public: CFont(float scale); ~CFont(); int CharWidth(char) const; + void DrawString(const char* str, long x, long y, const CColor& col) const; private: - float mFontSize; + int mFontSize; float mScale; }; diff --git a/src/Kyoto/Text/CFont.cpp b/src/Kyoto/Text/CFont.cpp new file mode 100644 index 00000000..305c43ac --- /dev/null +++ b/src/Kyoto/Text/CFont.cpp @@ -0,0 +1,10 @@ +#include "Kyoto/Text/CFont.hpp" +#include "Kyoto/Alloc/CMemory.hpp" + +CFont::CFont(float scale) : mFontSize(scale * 16.f), mScale(scale) {} + +CFont::~CFont() {} + +int CFont::CharWidth(char c) const { return mScale * 15.f; } + +void CFont::DrawString(const char* str, long x, long y, const CColor& col) const {}