Match and link CFont

This commit is contained in:
Phillip Stephens 2022-12-22 17:18:13 -08:00
parent 008b7f848d
commit 914ca994a0
3 changed files with 15 additions and 2 deletions

View File

@ -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],

View File

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

10
src/Kyoto/Text/CFont.cpp Normal file
View File

@ -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 {}