mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
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:
@@ -1,4 +1,5 @@
|
||||
#include "Textbox.h"
|
||||
#include <utf8/unchecked.h>
|
||||
|
||||
textboxclass::textboxclass()
|
||||
{
|
||||
@@ -133,7 +134,8 @@ void textboxclass::resize()
|
||||
max = 0;
|
||||
for (int iter = 0; iter < numlines; iter++)
|
||||
{
|
||||
if (line[iter].length() > (unsigned int)max) max = line[iter].length();
|
||||
unsigned int len = utf8::unchecked::distance(line[iter].begin(), line[iter].end());
|
||||
if (len > (unsigned int)max) max = len;
|
||||
}
|
||||
|
||||
lw = max;
|
||||
|
||||
Reference in New Issue
Block a user