Fixed font string on Windows

This commit is contained in:
mathusummut
2018-11-05 22:30:35 +01:00
parent 6f319e8bf2
commit 7dc1bc3476
7 changed files with 40 additions and 42 deletions

View File

@@ -338,8 +338,6 @@ namespace Game {
result = originalBasePath + uniqueFilePath; result = originalBasePath + uniqueFilePath;
} }
printf("\nPath: %s\n", result.c_str());
if (SystemFlags::VERBOSE_MODE_ENABLED) if (SystemFlags::VERBOSE_MODE_ENABLED)
printf("result [%s]\n", result.c_str()); printf("result [%s]\n", result.c_str());

View File

@@ -121,27 +121,27 @@ namespace Game {
strToBool(lang.getString("FONT_RIGHTTOLEFT_MIXED_SUPPORT")); strToBool(lang.getString("FONT_RIGHTTOLEFT_MIXED_SUPPORT"));
} }
if (lang.hasString("ZETAGLEST_FONT")) { if (lang.hasString("GAME_FONT")) {
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese //setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
#if defined(WIN32) #if defined(WIN32)
string newEnvValue = string newEnvValue =
"ZETAGLEST_FONT=" + lang.getString("ZETAGLEST_FONT"); "GAME_FONT=" + lang.getString("GAME_FONT");
_putenv(newEnvValue.c_str()); _putenv(newEnvValue.c_str());
#else #else
setenv("ZETAGLEST_FONT", setenv("GAME_FONT",
lang.getString("ZETAGLEST_FONT").c_str(), 0); lang.getString("GAME_FONT").c_str(), 0);
#endif #endif
} }
if (lang.hasString("ZETAGLEST_FONT_FAMILY")) { if (lang.hasString("GAME_FONT_FAMILY")) {
#if defined(WIN32) #if defined(WIN32)
string newEnvValue = string newEnvValue =
"ZETAGLEST_FONT_FAMILY=" + "GAME_FONT_FAMILY=" +
lang.getString("ZETAGLEST_FONT_FAMILY"); lang.getString("GAME_FONT_FAMILY");
_putenv(newEnvValue.c_str()); _putenv(newEnvValue.c_str());
#else #else
setenv("ZETAGLEST_FONT_FAMILY", setenv("GAME_FONT_FAMILY",
lang.getString("ZETAGLEST_FONT_FAMILY").c_str(), 0); lang.getString("GAME_FONT_FAMILY").c_str(), 0);
#endif #endif
} }
@@ -195,10 +195,10 @@ namespace Game {
strToBool(lang.getString("FONT_RIGHTTOLEFT_WINDOWS")); strToBool(lang.getString("FONT_RIGHTTOLEFT_WINDOWS"));
} }
if (lang.hasString("ZETAGLEST_FONT_WINDOWS")) { if (lang.hasString("GAME_FONT_WINDOWS")) {
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese //setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
string newEnvValue = string newEnvValue =
"ZETAGLEST_FONT=" + lang.getString("ZETAGLEST_FONT_WINDOWS"); "GAME_FONT=" + lang.getString("GAME_FONT_WINDOWS");
_putenv(newEnvValue.c_str()); _putenv(newEnvValue.c_str());
} }

View File

@@ -7137,10 +7137,10 @@ namespace Game {
#if defined(WIN32) #if defined(WIN32)
string string
newEnvValue = "ZETAGLEST_FONT=" + newfont; newEnvValue = "GAME_FONT=" + newfont;
_putenv(newEnvValue.c_str()); _putenv(newEnvValue.c_str());
#else #else
setenv("ZETAGLEST_FONT", newfont.c_str(), 1); setenv("GAME_FONT", newfont.c_str(), 1);
#endif #endif
} else { } else {
printf printf

View File

@@ -73,9 +73,9 @@ namespace Game {
string strInternalInfo = ""; string strInternalInfo = "";
strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported()); strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported());
if (getenv("ZETAGLEST_FONT") != NULL) { if (getenv("GAME_FONT") != NULL) {
char *tryFont = getenv("ZETAGLEST_FONT"); char *tryFont = getenv("GAME_FONT");
strInternalInfo += "\nZETAGLEST_FONT: " + string(tryFont); strInternalInfo += "\nGAME_FONT: " + string(tryFont);
} }
strInternalInfo += strInternalInfo +=
"\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts); "\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts);
@@ -127,9 +127,9 @@ namespace Game {
string strInternalInfo = ""; string strInternalInfo = "";
strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported()); strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported());
if (getenv("ZETAGLEST_FONT") != NULL) { if (getenv("GAME_FONT") != NULL) {
char *tryFont = getenv("ZETAGLEST_FONT"); char *tryFont = getenv("GAME_FONT");
strInternalInfo += "\nZETAGLEST_FONT: " + string(tryFont); strInternalInfo += "\nGAME_FONT: " + string(tryFont);
} }
strInternalInfo += strInternalInfo +=
"\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts); "\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts);

View File

@@ -92,13 +92,13 @@ namespace Shared {
Font::langHeightText = "yW"; Font::langHeightText = "yW";
#if defined(WIN32) #if defined(WIN32)
string newEnvValue = "ZETAGLEST_FONT="; string newEnvValue = "GAME_FONT=";
_putenv(newEnvValue.c_str()); _putenv(newEnvValue.c_str());
newEnvValue = "ZETAGLEST_FONT_FAMILY="; newEnvValue = "GAME_FONT_FAMILY=";
_putenv(newEnvValue.c_str()); _putenv(newEnvValue.c_str());
#else #else
unsetenv("ZETAGLEST_FONT"); unsetenv("GAME_FONT");
unsetenv("ZETAGLEST_FONT_FAMILY"); unsetenv("GAME_FONT_FAMILY");
#endif #endif
} }
@@ -609,8 +609,8 @@ namespace Shared {
} }
// Get user-specified font path // Get user-specified font path
string zetaglest_font = safeCharPtrCopy(getenv("ZETAGLEST_FONT"), 8095); string zetaglest_font = safeCharPtrCopy(getenv("GAME_FONT"), 8095);
string zetaglest_font_family = safeCharPtrCopy(getenv("ZETAGLEST_FONT_FAMILY"), 8095); string zetaglest_font_family = safeCharPtrCopy(getenv("GAME_FONT_FAMILY"), 8095);
if (zetaglest_font != "" || zetaglest_font_family != "") { if (zetaglest_font != "" || zetaglest_font_family != "") {
if (zetaglest_font != "") { if (zetaglest_font != "") {
tryFont = zetaglest_font; tryFont = zetaglest_font;

View File

@@ -47,17 +47,17 @@ namespace Shared {
TextFTGL::TextFTGL(FontTextHandlerType type) : Text(type) { TextFTGL::TextFTGL(FontTextHandlerType type) : Text(type) {
//throw game_runtime_error("FTGL!"); //throw game_runtime_error("FTGL!");
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",0); //setenv("GAME_FONT","/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",0);
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/arphic/uming.ttc",0); // Chinese //setenv("GAME_FONT","/usr/share/fonts/truetype/arphic/uming.ttc",0); // Chinese
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/arphic/ukai.ttc",0); // Chinese //setenv("GAME_FONT","/usr/share/fonts/truetype/arphic/ukai.ttc",0); // Chinese
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-sil-doulos/DoulosSILR.ttf",0); // Russian / Cyrillic //setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-sil-doulos/DoulosSILR.ttf",0); // Russian / Cyrillic
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-sil-charis/CharisSILR.ttf",0); // Russian / Cyrillic //setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-sil-charis/CharisSILR.ttf",0); // Russian / Cyrillic
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf",0); // Russian / Cyrillic //setenv("GAME_FONT","/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf",0); // Russian / Cyrillic
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/takao/TakaoPGothic.ttf",0); // Japanese //setenv("GAME_FONT","/usr/share/fonts/truetype/takao/TakaoPGothic.ttf",0); // Japanese
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-sil-scheherazade/ScheherazadeRegOT.ttf",0); // Arabic //setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-sil-scheherazade/ScheherazadeRegOT.ttf",0); // Arabic
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/linux-libertine/LinLibertine_Re.ttf",0); // Hebrew //setenv("GAME_FONT","/usr/share/fonts/truetype/linux-libertine/LinLibertine_Re.ttf",0); // Hebrew
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/unifont/unifont.ttf",0); // Czech? //setenv("GAME_FONT","/usr/share/fonts/truetype/unifont/unifont.ttf",0); // Czech?
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf",0); // Czech? //setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf",0); // Czech?
fontFile = findFont(); fontFile = findFont();

View File

@@ -387,8 +387,8 @@ namespace Shared {
} }
// Allows platforms to specify which sound device to use // Allows platforms to specify which sound device to use
// using the environment variable: ZETAGLEST_SOUND_DEVICE // using the environment variable: GAME_SOUND_DEVICE
char *deviceName = getenv("ZETAGLEST_SOUND_DEVICE"); char *deviceName = getenv("GAME_SOUND_DEVICE");
device = alcOpenDevice(deviceName); device = alcOpenDevice(deviceName);
if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) { if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) {