Logo
Font.h
1#pragma once
2
3#include "Types.h"
4#include "gfx/Font.h"
5
6namespace XXSharpKmyGfx
7{
8 ref class Texture;
9
10 private ref class Font
11 {
12 public:
13 kmyGfx::Font * obj = nullptr;
14
15 Font();
16 Font(System::String ^path, int height, float scale, int boldWeight);
17 void Release();
18 XXSharpKmyMath::Vector2 measureString(cli::array<byte> ^text);
19
20 static Font^ newSystemFont(cli::array<byte> ^faceName, u32 height, bool bold);
21 static Font^ newSystemFont(cli::array<byte> ^faceName, u32 height, float scale, int boldWeight);
22 static Font^ newSystemFontGdi(cli::array<byte> ^faceName, u32 height, float scale);
23
24 Texture^ getTexture();
25 void setLeadingOffset(float pos, float line);
26 bool isAvailable() { return obj; }
27
28 private:
29 kmyIO::StreamBase *m_stream;
30 u32 m_fileSize;
31 u8* m_buffer;
32 };
33}