
This is currently hardcoded to 640x480 English builds. What I've done is temporarily gutted the FreeType2 font renderer, and instead introduced a system where the font is read from a pre-rendered font atlas. This allows me to get 100% accurate font rendering to Windows XP... because I literally created these atlases with Windows XP. So not only does this eliminate the issue of FreeType producing misshapen glyphs, but it also works around the copyright issue regarding bundling the Courier New and MS Gothic fonts with CSE2. You see, font files can be copyrighted like any old software, however typefaces have a lot less protection - they're basically fair-game. IANAL, of course - look it up yourself. I don't really want to throw away the FreeType font system since I spent a ton of time working on it, it allows you to use other font files, and I'll probably wind up needing it for CSE2EX. I guess I'll just have to find some way to either have the two systems coexist, or make it so one or the other can be selected at compile-time.
13 lines
507 B
C
13 lines
507 B
C
#pragma once
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "Backends/Rendering.h"
|
|
|
|
typedef struct Font Font;
|
|
|
|
//Font* LoadFontFromData(const unsigned char *data, size_t data_size, size_t cell_width, size_t cell_height);
|
|
//Font* LoadFont(const char *font_filename, size_t cell_width, size_t cell_height);
|
|
Font* LoadBitmapFont(const char *bitmap_path, const char *metadata_path);
|
|
void DrawText(Font *font, RenderBackend_Surface *surface, int x, int y, unsigned long colour, const char *string);
|
|
void UnloadFont(Font *font);
|