Add support for Unicode rendering (#47)

This uses utfcpp combined with a custom font, in the form of a PNG and text file. By default, the game acts exactly as it did before; custom fonts can be provided by third parties.
This commit is contained in:
leo60228
2020-01-31 13:25:37 -05:00
committed by GitHub
parent 98ac1fdb53
commit 6a17625727
10 changed files with 505 additions and 87 deletions

View File

@@ -3,6 +3,7 @@
#include "GraphicsResources.h"
#include <vector>
#include <map>
@@ -28,6 +29,9 @@ public:
GraphicsResources grphx;
int bfontlen(char32_t ch);
int font_idx(char32_t ch);
void Makebfont();
void drawhuetile(int x, int y, int t, int c);
@@ -212,7 +216,6 @@ public:
std::vector <SDL_Surface*> bfontmask;
std::vector <SDL_Surface*> flipbfont;
std::vector <SDL_Surface*> flipbfontmask;
std::vector <int> bfontlen;
bool flipmode;
bool setflipmode;
@@ -280,6 +283,8 @@ public:
bool translucentroomname;
bool showmousecursor;
std::map<int, int> font_positions;
};
extern Graphics graphics;