hibiscus/renderer/rsdl/source/resources/font.d

22 lines
445 B
D

module hibis_rsdl.resources.font;
import hibis.resources.resource;
import sdl_ttf;
import std.string : toStringz;
import std.stdio;
import std.format : format;
class Font : Resource {
this(string path, uint size) {
const char* nPath = cast(const(char)*)toStringz(path);
loadedFont = TTF_OpenFont(nPath, size);
writeln(format("Loaded font at '%s'", path));
}
~this() {
TTF_CloseFont(loadedFont);
}
public TTF_Font* loadedFont;
}