mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 09:24:24 +02:00
Fixed font string on Windows
This commit is contained in:
@@ -338,8 +338,6 @@ namespace Game {
|
||||
result = originalBasePath + uniqueFilePath;
|
||||
}
|
||||
|
||||
printf("\nPath: %s\n", result.c_str());
|
||||
|
||||
if (SystemFlags::VERBOSE_MODE_ENABLED)
|
||||
printf("result [%s]\n", result.c_str());
|
||||
|
||||
|
@@ -121,27 +121,27 @@ namespace Game {
|
||||
strToBool(lang.getString("FONT_RIGHTTOLEFT_MIXED_SUPPORT"));
|
||||
}
|
||||
|
||||
if (lang.hasString("ZETAGLEST_FONT")) {
|
||||
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
|
||||
if (lang.hasString("GAME_FONT")) {
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
|
||||
#if defined(WIN32)
|
||||
string newEnvValue =
|
||||
"ZETAGLEST_FONT=" + lang.getString("ZETAGLEST_FONT");
|
||||
"GAME_FONT=" + lang.getString("GAME_FONT");
|
||||
_putenv(newEnvValue.c_str());
|
||||
#else
|
||||
setenv("ZETAGLEST_FONT",
|
||||
lang.getString("ZETAGLEST_FONT").c_str(), 0);
|
||||
setenv("GAME_FONT",
|
||||
lang.getString("GAME_FONT").c_str(), 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (lang.hasString("ZETAGLEST_FONT_FAMILY")) {
|
||||
if (lang.hasString("GAME_FONT_FAMILY")) {
|
||||
#if defined(WIN32)
|
||||
string newEnvValue =
|
||||
"ZETAGLEST_FONT_FAMILY=" +
|
||||
lang.getString("ZETAGLEST_FONT_FAMILY");
|
||||
"GAME_FONT_FAMILY=" +
|
||||
lang.getString("GAME_FONT_FAMILY");
|
||||
_putenv(newEnvValue.c_str());
|
||||
#else
|
||||
setenv("ZETAGLEST_FONT_FAMILY",
|
||||
lang.getString("ZETAGLEST_FONT_FAMILY").c_str(), 0);
|
||||
setenv("GAME_FONT_FAMILY",
|
||||
lang.getString("GAME_FONT_FAMILY").c_str(), 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -195,10 +195,10 @@ namespace Game {
|
||||
strToBool(lang.getString("FONT_RIGHTTOLEFT_WINDOWS"));
|
||||
}
|
||||
|
||||
if (lang.hasString("ZETAGLEST_FONT_WINDOWS")) {
|
||||
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
|
||||
if (lang.hasString("GAME_FONT_WINDOWS")) {
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
|
||||
string newEnvValue =
|
||||
"ZETAGLEST_FONT=" + lang.getString("ZETAGLEST_FONT_WINDOWS");
|
||||
"GAME_FONT=" + lang.getString("GAME_FONT_WINDOWS");
|
||||
_putenv(newEnvValue.c_str());
|
||||
}
|
||||
|
||||
|
@@ -7137,10 +7137,10 @@ namespace Game {
|
||||
|
||||
#if defined(WIN32)
|
||||
string
|
||||
newEnvValue = "ZETAGLEST_FONT=" + newfont;
|
||||
newEnvValue = "GAME_FONT=" + newfont;
|
||||
_putenv(newEnvValue.c_str());
|
||||
#else
|
||||
setenv("ZETAGLEST_FONT", newfont.c_str(), 1);
|
||||
setenv("GAME_FONT", newfont.c_str(), 1);
|
||||
#endif
|
||||
} else {
|
||||
printf
|
||||
|
@@ -73,9 +73,9 @@ namespace Game {
|
||||
|
||||
string strInternalInfo = "";
|
||||
strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported());
|
||||
if (getenv("ZETAGLEST_FONT") != NULL) {
|
||||
char *tryFont = getenv("ZETAGLEST_FONT");
|
||||
strInternalInfo += "\nZETAGLEST_FONT: " + string(tryFont);
|
||||
if (getenv("GAME_FONT") != NULL) {
|
||||
char *tryFont = getenv("GAME_FONT");
|
||||
strInternalInfo += "\nGAME_FONT: " + string(tryFont);
|
||||
}
|
||||
strInternalInfo +=
|
||||
"\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts);
|
||||
@@ -127,9 +127,9 @@ namespace Game {
|
||||
|
||||
string strInternalInfo = "";
|
||||
strInternalInfo += "VBOSupported: " + boolToStr(getVBOSupported());
|
||||
if (getenv("ZETAGLEST_FONT") != NULL) {
|
||||
char *tryFont = getenv("ZETAGLEST_FONT");
|
||||
strInternalInfo += "\nZETAGLEST_FONT: " + string(tryFont);
|
||||
if (getenv("GAME_FONT") != NULL) {
|
||||
char *tryFont = getenv("GAME_FONT");
|
||||
strInternalInfo += "\nGAME_FONT: " + string(tryFont);
|
||||
}
|
||||
strInternalInfo +=
|
||||
"\nforceLegacyFonts: " + boolToStr(Font::forceLegacyFonts);
|
||||
|
@@ -92,13 +92,13 @@ namespace Shared {
|
||||
Font::langHeightText = "yW";
|
||||
|
||||
#if defined(WIN32)
|
||||
string newEnvValue = "ZETAGLEST_FONT=";
|
||||
string newEnvValue = "GAME_FONT=";
|
||||
_putenv(newEnvValue.c_str());
|
||||
newEnvValue = "ZETAGLEST_FONT_FAMILY=";
|
||||
newEnvValue = "GAME_FONT_FAMILY=";
|
||||
_putenv(newEnvValue.c_str());
|
||||
#else
|
||||
unsetenv("ZETAGLEST_FONT");
|
||||
unsetenv("ZETAGLEST_FONT_FAMILY");
|
||||
unsetenv("GAME_FONT");
|
||||
unsetenv("GAME_FONT_FAMILY");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -609,8 +609,8 @@ namespace Shared {
|
||||
}
|
||||
|
||||
// Get user-specified font path
|
||||
string zetaglest_font = safeCharPtrCopy(getenv("ZETAGLEST_FONT"), 8095);
|
||||
string zetaglest_font_family = safeCharPtrCopy(getenv("ZETAGLEST_FONT_FAMILY"), 8095);
|
||||
string zetaglest_font = safeCharPtrCopy(getenv("GAME_FONT"), 8095);
|
||||
string zetaglest_font_family = safeCharPtrCopy(getenv("GAME_FONT_FAMILY"), 8095);
|
||||
if (zetaglest_font != "" || zetaglest_font_family != "") {
|
||||
if (zetaglest_font != "") {
|
||||
tryFont = zetaglest_font;
|
||||
|
@@ -47,17 +47,17 @@ namespace Shared {
|
||||
TextFTGL::TextFTGL(FontTextHandlerType type) : Text(type) {
|
||||
|
||||
//throw game_runtime_error("FTGL!");
|
||||
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",0);
|
||||
//setenv("ZETAGLEST_FONT","/usr/share/fonts/truetype/arphic/uming.ttc",0); // Chinese
|
||||
//setenv("ZETAGLEST_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("ZETAGLEST_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("ZETAGLEST_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("ZETAGLEST_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("ZETAGLEST_FONT","/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf",0); // Czech?
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",0);
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/arphic/uming.ttc",0); // Chinese
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/arphic/ukai.ttc",0); // Chinese
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-sil-doulos/DoulosSILR.ttf",0); // Russian / Cyrillic
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-sil-charis/CharisSILR.ttf",0); // Russian / Cyrillic
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf",0); // Russian / Cyrillic
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/takao/TakaoPGothic.ttf",0); // Japanese
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-sil-scheherazade/ScheherazadeRegOT.ttf",0); // Arabic
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/linux-libertine/LinLibertine_Re.ttf",0); // Hebrew
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/unifont/unifont.ttf",0); // Czech?
|
||||
//setenv("GAME_FONT","/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf",0); // Czech?
|
||||
|
||||
|
||||
fontFile = findFont();
|
||||
|
@@ -387,8 +387,8 @@ namespace Shared {
|
||||
}
|
||||
|
||||
// Allows platforms to specify which sound device to use
|
||||
// using the environment variable: ZETAGLEST_SOUND_DEVICE
|
||||
char *deviceName = getenv("ZETAGLEST_SOUND_DEVICE");
|
||||
// using the environment variable: GAME_SOUND_DEVICE
|
||||
char *deviceName = getenv("GAME_SOUND_DEVICE");
|
||||
device = alcOpenDevice(deviceName);
|
||||
|
||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) {
|
||||
|
Reference in New Issue
Block a user