Compare commits
9 Commits
feat/font_
...
dev/14
| Author | SHA1 | Date | |
|---|---|---|---|
| a3fa504bee | |||
| d962361e36 | |||
|
|
9bb6266be0 | ||
|
|
65dc054414 | ||
|
|
1b398f13d5 | ||
|
|
3a047a01e8 | ||
| 501c88c6bf | |||
| 33a33d6a34 | |||
| 40b429bc3b |
2
.ottdrev
2
.ottdrev
@@ -1 +1 @@
|
|||||||
14.0 20240413 0 b3c704a6306027de4aad575c8e394a2d8a1878f9 1 1 2024
|
14.1 20240503 0 b3c704a6306027de4aad575c8e394a2d8a1878f9 1 1 2024
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ void IConsoleSwitch()
|
|||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
{
|
{
|
||||||
char buf[1024] = "";
|
char buf[1024] = "";
|
||||||
char *pos = &buf;
|
char *pos = &buf[0];
|
||||||
|
|
||||||
for (IConsoleLine &line : _iconsole_buffer) {
|
for (IConsoleLine &line : _iconsole_buffer) {
|
||||||
if (!line.buffer.empty()) {
|
if (!line.buffer.empty()) {
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ FontCacheSettings _fcsettings;
|
|||||||
* @param fs The size of the font.
|
* @param fs The size of the font.
|
||||||
*/
|
*/
|
||||||
FontCache::FontCache(FontSize fs) : parent(FontCache::Get(fs)), fs(fs), height(_default_font_height[fs]),
|
FontCache::FontCache(FontSize fs) : parent(FontCache::Get(fs)), fs(fs), height(_default_font_height[fs]),
|
||||||
ascender(_default_font_ascender[fs]), descender(_default_font_ascender[fs] - _default_font_height[fs]),
|
ascender(_default_font_ascender[fs]), descender(_default_font_ascender[fs] - _default_font_height[fs])
|
||||||
units_per_em(1)
|
|
||||||
{
|
{
|
||||||
assert(this->parent == nullptr || this->fs == this->parent->fs);
|
assert(this->parent == nullptr || this->fs == this->parent->fs);
|
||||||
FontCache::caches[this->fs] = this;
|
FontCache::caches[this->fs] = this;
|
||||||
@@ -99,6 +98,7 @@ bool GetFontAAState(FontSize size, bool check_blitter)
|
|||||||
return _fcsettings.global_aa || GetFontCacheSubSetting(size)->aa;
|
return _fcsettings.global_aa || GetFontCacheSubSetting(size)->aa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SetFont(FontSize fontsize, const std::string &font, uint size, bool aa)
|
void SetFont(FontSize fontsize, const std::string &font, uint size, bool aa)
|
||||||
{
|
{
|
||||||
FontCacheSubSetting *setting = GetFontCacheSubSetting(fontsize);
|
FontCacheSubSetting *setting = GetFontCacheSubSetting(fontsize);
|
||||||
@@ -142,52 +142,66 @@ void SetFont(FontSize fontsize, const std::string &font, uint size, bool aa)
|
|||||||
if (_save_config) SaveToConfig();
|
if (_save_config) SaveToConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResizeFont(FontSize fontsize, uint size)
|
||||||
|
{
|
||||||
|
FontCacheSubSetting *setting = GetFontCacheSubSetting(fontsize);
|
||||||
|
SetFont(fontsize, setting->font, size, setting->aa);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WITH_FREETYPE
|
#ifdef WITH_FREETYPE
|
||||||
extern void LoadFreeTypeFont(FontSize fs);
|
extern void LoadFreeTypeFont(FontSize fs);
|
||||||
extern void LoadFreeTypeFont(FontSize fs, const std::string &file_name, uint size);
|
|
||||||
extern void UninitFreeType();
|
extern void UninitFreeType();
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
extern void LoadWin32Font(FontSize fs);
|
extern void LoadWin32Font(FontSize fs);
|
||||||
extern void LoadWin32Font(FontSize fs, const std::string &file_name, uint size);
|
|
||||||
#elif defined(WITH_COCOA)
|
#elif defined(WITH_COCOA)
|
||||||
extern void LoadCoreTextFont(FontSize fs);
|
extern void LoadCoreTextFont(FontSize fs);
|
||||||
extern void LoadCoreTextFont(FontSize fs, const std::string &file_name, uint size);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void TryLoadDefaultTrueTypeFont([[maybe_unused]] FontSize fs)
|
|
||||||
{
|
|
||||||
#if defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA)
|
|
||||||
std::string font_name{};
|
|
||||||
switch (fs) {
|
|
||||||
case FS_NORMAL:
|
|
||||||
font_name = "OpenTTD-Sans.ttf";
|
|
||||||
break;
|
|
||||||
case FS_SMALL:
|
|
||||||
font_name = "OpenTTD-Small.ttf";
|
|
||||||
break;
|
|
||||||
case FS_LARGE:
|
|
||||||
font_name = "OpenTTD-Serif.ttf";
|
|
||||||
break;
|
|
||||||
case FS_MONO:
|
|
||||||
font_name = "OpenTTD-Mono.ttf";
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
#if defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA)
|
||||||
|
/**
|
||||||
|
* Get name of default font file for a given font size.
|
||||||
|
* @param fs Font size.
|
||||||
|
* @return Name of default font file.
|
||||||
|
*/
|
||||||
|
static std::string GetDefaultTruetypeFont(FontSize fs)
|
||||||
|
{
|
||||||
|
switch (fs) {
|
||||||
|
case FS_NORMAL: return "OpenTTD-Sans.ttf";
|
||||||
|
case FS_SMALL: return "OpenTTD-Small.ttf";
|
||||||
|
case FS_LARGE: return "OpenTTD-Serif.ttf";
|
||||||
|
case FS_MONO: return "OpenTTD-Mono.ttf";
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* Find font file. */
|
|
||||||
std::string full_font = FioFindFullPath(BASESET_DIR, font_name);
|
|
||||||
if (!full_font.empty()) {
|
|
||||||
int size = FontCache::GetDefaultFontHeight(fs);
|
|
||||||
#ifdef WITH_FREETYPE
|
|
||||||
LoadFreeTypeFont(fs, full_font, size);
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
LoadWin32Font(fs, full_font, size);
|
|
||||||
#elif defined(WITH_COCOA)
|
|
||||||
LoadCoreTextFont(fs, full_font, size);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif /* defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA) */
|
#endif /* defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get path of default font file for a given font size.
|
||||||
|
* @param fs Font size.
|
||||||
|
* @return Full path of default font file.
|
||||||
|
*/
|
||||||
|
static std::string GetDefaultTruetypeFontFile([[maybe_unused]] FontSize fs)
|
||||||
|
{
|
||||||
|
#if defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA)
|
||||||
|
/* Find font file. */
|
||||||
|
return FioFindFullPath(BASESET_DIR, GetDefaultTruetypeFont(fs));
|
||||||
|
#else
|
||||||
|
return {};
|
||||||
|
#endif /* defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA) */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font to use for a given font size.
|
||||||
|
* @param fs Font size.
|
||||||
|
* @return If configured, the font name to use, or the path of the default TrueType font if sprites are not preferred.
|
||||||
|
*/
|
||||||
|
std::string GetFontCacheFontName(FontSize fs)
|
||||||
|
{
|
||||||
|
const FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
||||||
|
if (!settings->font.empty()) return settings->font;
|
||||||
|
if (_fcsettings.prefer_sprite) return {};
|
||||||
|
return GetDefaultTruetypeFontFile(fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,17 +218,13 @@ void InitFontCache(bool monospace)
|
|||||||
FontCache *fc = FontCache::Get(fs);
|
FontCache *fc = FontCache::Get(fs);
|
||||||
if (fc->HasParent()) delete fc;
|
if (fc->HasParent()) delete fc;
|
||||||
|
|
||||||
if (!_fcsettings.prefer_sprite && GetFontCacheSubSetting(fs)->font.empty()) {
|
|
||||||
TryLoadDefaultTrueTypeFont(fs);
|
|
||||||
} else {
|
|
||||||
#ifdef WITH_FREETYPE
|
#ifdef WITH_FREETYPE
|
||||||
LoadFreeTypeFont(fs);
|
LoadFreeTypeFont(fs);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
LoadWin32Font(fs);
|
LoadWin32Font(fs);
|
||||||
#elif defined(WITH_COCOA)
|
#elif defined(WITH_COCOA)
|
||||||
LoadCoreTextFont(fs);
|
LoadCoreTextFont(fs);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ protected:
|
|||||||
int height; ///< The height of the font.
|
int height; ///< The height of the font.
|
||||||
int ascender; ///< The ascender value of the font.
|
int ascender; ///< The ascender value of the font.
|
||||||
int descender; ///< The descender value of the font.
|
int descender; ///< The descender value of the font.
|
||||||
int units_per_em; ///< The units per EM value of the font.
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FontCache(FontSize fs);
|
FontCache(FontSize fs);
|
||||||
@@ -60,12 +59,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
inline int GetDescender() const{ return this->descender; }
|
inline int GetDescender() const{ return this->descender; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the units per EM value of the font.
|
|
||||||
* @return The units per EM value of the font.
|
|
||||||
*/
|
|
||||||
inline int GetUnitsPerEM() const { return this->units_per_em; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the nominal font size of the font.
|
* Get the nominal font size of the font.
|
||||||
* @return The nominal font size.
|
* @return The nominal font size.
|
||||||
@@ -113,14 +106,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual GlyphID MapCharToGlyph(char32_t key, bool fallback = true) = 0;
|
virtual GlyphID MapCharToGlyph(char32_t key, bool fallback = true) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Read a font table from the font.
|
|
||||||
* @param tag The of the table to load.
|
|
||||||
* @param length The length of the read data.
|
|
||||||
* @return The loaded table data.
|
|
||||||
*/
|
|
||||||
virtual const void *GetFontTable(uint32_t tag, size_t &length) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the native OS font handle, if there is one.
|
* Get the native OS font handle, if there is one.
|
||||||
* @return Opaque OS font handle.
|
* @return Opaque OS font handle.
|
||||||
@@ -240,8 +225,10 @@ inline FontCacheSubSetting *GetFontCacheSubSetting(FontSize fs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetFontCacheFontName(FontSize fs);
|
||||||
void InitFontCache(bool monospace);
|
void InitFontCache(bool monospace);
|
||||||
void UninitFontCache();
|
void UninitFontCache();
|
||||||
|
void ResizeFont(FontSize font_size, uint32_t size);
|
||||||
bool HasAntialiasedFonts();
|
bool HasAntialiasedFonts();
|
||||||
|
|
||||||
bool GetFontAAState(FontSize size, bool check_blitter = true);
|
bool GetFontAAState(FontSize size, bool check_blitter = true);
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ class FreeTypeFontCache : public TrueTypeFontCache {
|
|||||||
private:
|
private:
|
||||||
FT_Face face; ///< The font face associated with this font.
|
FT_Face face; ///< The font face associated with this font.
|
||||||
|
|
||||||
void SetFontSize(FontSize fs, FT_Face face, int pixels);
|
void SetFontSize(int pixels);
|
||||||
const void *InternalGetFontTable(uint32_t tag, size_t &length) override;
|
|
||||||
const Sprite *InternalGetGlyph(GlyphID key, bool aa) override;
|
const Sprite *InternalGetGlyph(GlyphID key, bool aa) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -60,10 +59,10 @@ FreeTypeFontCache::FreeTypeFontCache(FontSize fs, FT_Face face, int pixels) : Tr
|
|||||||
{
|
{
|
||||||
assert(face != nullptr);
|
assert(face != nullptr);
|
||||||
|
|
||||||
this->SetFontSize(fs, face, pixels);
|
this->SetFontSize(pixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeTypeFontCache::SetFontSize(FontSize, FT_Face, int pixels)
|
void FreeTypeFontCache::SetFontSize(int pixels)
|
||||||
{
|
{
|
||||||
if (pixels == 0) {
|
if (pixels == 0) {
|
||||||
/* Try to determine a good height based on the minimal height recommended by the font. */
|
/* Try to determine a good height based on the minimal height recommended by the font. */
|
||||||
@@ -105,7 +104,6 @@ void FreeTypeFontCache::SetFontSize(FontSize, FT_Face, int pixels)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err == FT_Err_Ok) {
|
if (err == FT_Err_Ok) {
|
||||||
this->units_per_em = this->face->units_per_EM;
|
|
||||||
this->ascender = this->face->size->metrics.ascender >> 6;
|
this->ascender = this->face->size->metrics.ascender >> 6;
|
||||||
this->descender = this->face->size->metrics.descender >> 6;
|
this->descender = this->face->size->metrics.descender >> 6;
|
||||||
this->height = this->ascender - this->descender;
|
this->height = this->ascender - this->descender;
|
||||||
@@ -162,7 +160,8 @@ void LoadFreeTypeFont(FontSize fs)
|
|||||||
{
|
{
|
||||||
FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
||||||
|
|
||||||
if (settings->font.empty()) return;
|
std::string font = GetFontCacheFontName(fs);
|
||||||
|
if (font.empty()) return;
|
||||||
|
|
||||||
if (_library == nullptr) {
|
if (_library == nullptr) {
|
||||||
if (FT_Init_FreeType(&_library) != FT_Err_Ok) {
|
if (FT_Init_FreeType(&_library) != FT_Err_Ok) {
|
||||||
@@ -173,7 +172,7 @@ void LoadFreeTypeFont(FontSize fs)
|
|||||||
Debug(fontcache, 2, "Initialized");
|
Debug(fontcache, 2, "Initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *font_name = settings->font.c_str();
|
const char *font_name = font.c_str();
|
||||||
FT_Face face = nullptr;
|
FT_Face face = nullptr;
|
||||||
|
|
||||||
/* If font is an absolute path to a ttf, try loading that first. */
|
/* If font is an absolute path to a ttf, try loading that first. */
|
||||||
@@ -202,34 +201,6 @@ void LoadFreeTypeFont(FontSize fs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a TrueType font from a file.
|
|
||||||
* @param fs The font size to load.
|
|
||||||
* @param file_name Path to the font file.
|
|
||||||
* @param size Requested font size.
|
|
||||||
*/
|
|
||||||
void LoadFreeTypeFont(FontSize fs, const std::string &file_name, uint size)
|
|
||||||
{
|
|
||||||
if (_library == nullptr) {
|
|
||||||
if (FT_Init_FreeType(&_library) != FT_Err_Ok) {
|
|
||||||
ShowInfo("Unable to initialize FreeType, using sprite fonts instead");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug(fontcache, 2, "Initialized");
|
|
||||||
}
|
|
||||||
|
|
||||||
FT_Face face = nullptr;
|
|
||||||
int32_t index = 0;
|
|
||||||
FT_Error error = FT_New_Face(_library, file_name.c_str(), index, &face);
|
|
||||||
if (error == FT_Err_Ok) {
|
|
||||||
LoadFont(fs, face, file_name.c_str(), size);
|
|
||||||
} else {
|
|
||||||
FT_Done_Face(face);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free everything that was allocated for this font cache.
|
* Free everything that was allocated for this font cache.
|
||||||
*/
|
*/
|
||||||
@@ -246,7 +217,7 @@ FreeTypeFontCache::~FreeTypeFontCache()
|
|||||||
void FreeTypeFontCache::ClearFontCache()
|
void FreeTypeFontCache::ClearFontCache()
|
||||||
{
|
{
|
||||||
/* Font scaling might have changed, determine font size anew if it was automatically selected. */
|
/* Font scaling might have changed, determine font size anew if it was automatically selected. */
|
||||||
if (this->face != nullptr) this->SetFontSize(this->fs, this->face, this->req_size);
|
if (this->face != nullptr) this->SetFontSize(this->req_size);
|
||||||
|
|
||||||
this->TrueTypeFontCache::ClearFontCache();
|
this->TrueTypeFontCache::ClearFontCache();
|
||||||
}
|
}
|
||||||
@@ -325,22 +296,6 @@ GlyphID FreeTypeFontCache::MapCharToGlyph(char32_t key, bool allow_fallback)
|
|||||||
return glyph;
|
return glyph;
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *FreeTypeFontCache::InternalGetFontTable(uint32_t tag, size_t &length)
|
|
||||||
{
|
|
||||||
FT_ULong len = 0;
|
|
||||||
FT_Byte *result = nullptr;
|
|
||||||
|
|
||||||
FT_Load_Sfnt_Table(this->face, tag, 0, nullptr, &len);
|
|
||||||
|
|
||||||
if (len > 0) {
|
|
||||||
result = MallocT<FT_Byte>(len);
|
|
||||||
FT_Load_Sfnt_Table(this->face, tag, 0, result, &len);
|
|
||||||
}
|
|
||||||
|
|
||||||
length = len;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free everything allocated w.r.t. freetype.
|
* Free everything allocated w.r.t. freetype.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public:
|
|||||||
uint GetGlyphWidth(GlyphID key) override;
|
uint GetGlyphWidth(GlyphID key) override;
|
||||||
bool GetDrawGlyphShadow() override;
|
bool GetDrawGlyphShadow() override;
|
||||||
GlyphID MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback = true) override { assert(IsPrintable(key)); return SPRITE_GLYPH | key; }
|
GlyphID MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback = true) override { assert(IsPrintable(key)); return SPRITE_GLYPH | key; }
|
||||||
const void *GetFontTable(uint32_t, size_t &length) override { length = 0; return nullptr; }
|
|
||||||
std::string GetFontName() override { return "sprite"; }
|
std::string GetFontName() override { return "sprite"; }
|
||||||
bool IsBuiltInFont() override { return true; }
|
bool IsBuiltInFont() override { return true; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ TrueTypeFontCache::~TrueTypeFontCache()
|
|||||||
{
|
{
|
||||||
/* Virtual functions get called statically in destructors, so make it explicit to remove any confusion. */
|
/* Virtual functions get called statically in destructors, so make it explicit to remove any confusion. */
|
||||||
this->TrueTypeFontCache::ClearFontCache();
|
this->TrueTypeFontCache::ClearFontCache();
|
||||||
|
|
||||||
for (auto &iter : this->font_tables) {
|
|
||||||
free(iter.second.second);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,17 +160,3 @@ const Sprite *TrueTypeFontCache::GetGlyph(GlyphID key)
|
|||||||
|
|
||||||
return this->InternalGetGlyph(key, GetFontAAState(this->fs));
|
return this->InternalGetGlyph(key, GetFontAAState(this->fs));
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *TrueTypeFontCache::GetFontTable(uint32_t tag, size_t &length)
|
|
||||||
{
|
|
||||||
const auto iter = this->font_tables.find(tag);
|
|
||||||
if (iter != this->font_tables.end()) {
|
|
||||||
length = iter->second.first;
|
|
||||||
return iter->second.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
const void *result = this->InternalGetFontTable(tag, length);
|
|
||||||
|
|
||||||
this->font_tables[tag] = std::pair<size_t, const void *>(length, result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ protected:
|
|||||||
int req_size; ///< Requested font size.
|
int req_size; ///< Requested font size.
|
||||||
int used_size; ///< Used font size.
|
int used_size; ///< Used font size.
|
||||||
|
|
||||||
using FontTable = std::map<uint32_t, std::pair<size_t, const void *>>; ///< Table with font table cache
|
|
||||||
FontTable font_tables; ///< Cached font tables.
|
|
||||||
|
|
||||||
/** Container for information about a glyph. */
|
/** Container for information about a glyph. */
|
||||||
struct GlyphEntry {
|
struct GlyphEntry {
|
||||||
Sprite *sprite; ///< The loaded sprite.
|
Sprite *sprite; ///< The loaded sprite.
|
||||||
@@ -55,7 +52,6 @@ protected:
|
|||||||
GlyphEntry *GetGlyphPtr(GlyphID key);
|
GlyphEntry *GetGlyphPtr(GlyphID key);
|
||||||
void SetGlyphPtr(GlyphID key, const GlyphEntry *glyph, bool duplicate = false);
|
void SetGlyphPtr(GlyphID key, const GlyphEntry *glyph, bool duplicate = false);
|
||||||
|
|
||||||
virtual const void *InternalGetFontTable(uint32_t tag, size_t &length) = 0;
|
|
||||||
virtual const Sprite *InternalGetGlyph(GlyphID key, bool aa) = 0;
|
virtual const Sprite *InternalGetGlyph(GlyphID key, bool aa) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -65,7 +61,6 @@ public:
|
|||||||
void SetUnicodeGlyph(char32_t key, SpriteID sprite) override { this->parent->SetUnicodeGlyph(key, sprite); }
|
void SetUnicodeGlyph(char32_t key, SpriteID sprite) override { this->parent->SetUnicodeGlyph(key, sprite); }
|
||||||
void InitializeUnicodeGlyphMap() override { this->parent->InitializeUnicodeGlyphMap(); }
|
void InitializeUnicodeGlyphMap() override { this->parent->InitializeUnicodeGlyphMap(); }
|
||||||
const Sprite *GetGlyph(GlyphID key) override;
|
const Sprite *GetGlyph(GlyphID key) override;
|
||||||
const void *GetFontTable(uint32_t tag, size_t &length) override;
|
|
||||||
void ClearFontCache() override;
|
void ClearFontCache() override;
|
||||||
uint GetGlyphWidth(GlyphID key) override;
|
uint GetGlyphWidth(GlyphID key) override;
|
||||||
bool GetDrawGlyphShadow() override;
|
bool GetDrawGlyphShadow() override;
|
||||||
|
|||||||
@@ -947,6 +947,8 @@ STR_GAME_OPTIONS_TAB_GENERAL :General
|
|||||||
STR_GAME_OPTIONS_TAB_GENERAL_TT :{BLACK}Choose general settings
|
STR_GAME_OPTIONS_TAB_GENERAL_TT :{BLACK}Choose general settings
|
||||||
STR_GAME_OPTIONS_TAB_INTERFACE :Interface
|
STR_GAME_OPTIONS_TAB_INTERFACE :Interface
|
||||||
STR_GAME_OPTIONS_TAB_INTERFACE_TT :{BLACK}Choose interface settings
|
STR_GAME_OPTIONS_TAB_INTERFACE_TT :{BLACK}Choose interface settings
|
||||||
|
STR_GAME_OPTIONS_TAB_FONTS :Fonts
|
||||||
|
STR_GAME_OPTIONS_TAB_FONTS_TT :{BLACK}Choose font settings
|
||||||
STR_GAME_OPTIONS_TAB_GRAPHICS :Graphics
|
STR_GAME_OPTIONS_TAB_GRAPHICS :Graphics
|
||||||
STR_GAME_OPTIONS_TAB_GRAPHICS_TT :{BLACK}Choose graphics settings
|
STR_GAME_OPTIONS_TAB_GRAPHICS_TT :{BLACK}Choose graphics settings
|
||||||
STR_GAME_OPTIONS_TAB_SOUND :Sound
|
STR_GAME_OPTIONS_TAB_SOUND :Sound
|
||||||
@@ -1073,6 +1075,11 @@ STR_GAME_OPTIONS_PARTICIPATE_SURVEY_LINK_TOOLTIP :{BLACK}This ope
|
|||||||
STR_GAME_OPTIONS_PARTICIPATE_SURVEY_PREVIEW :{BLACK}Preview survey result
|
STR_GAME_OPTIONS_PARTICIPATE_SURVEY_PREVIEW :{BLACK}Preview survey result
|
||||||
STR_GAME_OPTIONS_PARTICIPATE_SURVEY_PREVIEW_TOOLTIP :{BLACK}Show the survey result of the current running game
|
STR_GAME_OPTIONS_PARTICIPATE_SURVEY_PREVIEW_TOOLTIP :{BLACK}Show the survey result of the current running game
|
||||||
|
|
||||||
|
STR_GAME_OPTIONS_FONT_MONO :{BLACK}Mono font
|
||||||
|
STR_GAME_OPTIONS_FONT_SMALL :{BLACK}Small font
|
||||||
|
STR_GAME_OPTIONS_FONT_NORMAL :{BLACK}Normal font
|
||||||
|
STR_GAME_OPTIONS_FONT_LARGE :{BLACK}Large font
|
||||||
|
|
||||||
STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics
|
STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics
|
||||||
|
|
||||||
STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Display refresh rate
|
STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Display refresh rate
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ void CoreTextFontCache::SetFontSize(int pixels)
|
|||||||
/* Query the font metrics we needed. We generally round all values up to
|
/* Query the font metrics we needed. We generally round all values up to
|
||||||
* make sure we don't inadvertently cut off a row or column of pixels,
|
* make sure we don't inadvertently cut off a row or column of pixels,
|
||||||
* except when determining glyph to glyph advances. */
|
* except when determining glyph to glyph advances. */
|
||||||
this->units_per_em = CTFontGetUnitsPerEm(this->font.get());
|
|
||||||
this->ascender = (int)std::ceil(CTFontGetAscent(this->font.get()));
|
this->ascender = (int)std::ceil(CTFontGetAscent(this->font.get()));
|
||||||
this->descender = -(int)std::ceil(CTFontGetDescent(this->font.get()));
|
this->descender = -(int)std::ceil(CTFontGetDescent(this->font.get()));
|
||||||
this->height = this->ascender - this->descender;
|
this->height = this->ascender - this->descender;
|
||||||
@@ -205,18 +204,6 @@ GlyphID CoreTextFontCache::MapCharToGlyph(char32_t key, bool allow_fallback)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *CoreTextFontCache::InternalGetFontTable(uint32_t tag, size_t &length)
|
|
||||||
{
|
|
||||||
CFAutoRelease<CFDataRef> data(CTFontCopyTable(this->font.get(), (CTFontTableTag)tag, kCTFontTableOptionNoOptions));
|
|
||||||
if (!data) return nullptr;
|
|
||||||
|
|
||||||
length = CFDataGetLength(data.get());
|
|
||||||
auto buf = MallocT<UInt8>(length);
|
|
||||||
|
|
||||||
CFDataGetBytes(data.get(), CFRangeMake(0, (CFIndex)length), buf);
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
|
const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
|
||||||
{
|
{
|
||||||
/* Get glyph size. */
|
/* Get glyph size. */
|
||||||
@@ -341,7 +328,8 @@ void LoadCoreTextFont(FontSize fs)
|
|||||||
{
|
{
|
||||||
FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
||||||
|
|
||||||
if (settings->font.empty()) return;
|
std::string font = GetFontCacheFontName(fs);
|
||||||
|
if (font.empty()) return;
|
||||||
|
|
||||||
CFAutoRelease<CTFontDescriptorRef> font_ref;
|
CFAutoRelease<CTFontDescriptorRef> font_ref;
|
||||||
|
|
||||||
@@ -352,12 +340,12 @@ void LoadCoreTextFont(FontSize fs)
|
|||||||
|
|
||||||
if (!font_ref && MacOSVersionIsAtLeast(10, 6, 0)) {
|
if (!font_ref && MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||||
/* Might be a font file name, try load it. */
|
/* Might be a font file name, try load it. */
|
||||||
font_ref.reset(LoadFontFromFile(settings->font));
|
font_ref.reset(LoadFontFromFile(font));
|
||||||
if (!font_ref) ShowInfo("Unable to load file '{}' for {} font, using default OS font selection instead", settings->font, FontSizeToName(fs));
|
if (!font_ref) ShowInfo("Unable to load file '{}' for {} font, using default OS font selection instead", font, FontSizeToName(fs));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!font_ref) {
|
if (!font_ref) {
|
||||||
CFAutoRelease<CFStringRef> name(CFStringCreateWithCString(kCFAllocatorDefault, settings->font.c_str(), kCFStringEncodingUTF8));
|
CFAutoRelease<CFStringRef> name(CFStringCreateWithCString(kCFAllocatorDefault, font.c_str(), kCFStringEncodingUTF8));
|
||||||
|
|
||||||
/* Simply creating the font using CTFontCreateWithNameAndSize will *always* return
|
/* Simply creating the font using CTFontCreateWithNameAndSize will *always* return
|
||||||
* something, no matter the name. As such, we can't use it to check for existence.
|
* something, no matter the name. As such, we can't use it to check for existence.
|
||||||
@@ -375,23 +363,9 @@ void LoadCoreTextFont(FontSize fs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!font_ref) {
|
if (!font_ref) {
|
||||||
ShowInfo("Unable to use '{}' for {} font, using sprite font instead", settings->font, FontSizeToName(fs));
|
ShowInfo("Unable to use '{}' for {} font, using sprite font instead", font, FontSizeToName(fs));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
new CoreTextFontCache(fs, std::move(font_ref), settings->size);
|
new CoreTextFontCache(fs, std::move(font_ref), settings->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a TrueType font from a file.
|
|
||||||
* @param fs The font size to load.
|
|
||||||
* @param file_name Path to the font file.
|
|
||||||
* @param size Requested font size.
|
|
||||||
*/
|
|
||||||
void LoadCoreTextFont(FontSize fs, const std::string &file_name, uint size)
|
|
||||||
{
|
|
||||||
CFAutoRelease<CTFontDescriptorRef> font_ref{LoadFontFromFile(file_name)};
|
|
||||||
if (font_ref) {
|
|
||||||
new CoreTextFontCache(fs, std::move(font_ref), size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class CoreTextFontCache : public TrueTypeFontCache {
|
|||||||
|
|
||||||
void SetFontSize(int pixels);
|
void SetFontSize(int pixels);
|
||||||
const Sprite *InternalGetGlyph(GlyphID key, bool use_aa) override;
|
const Sprite *InternalGetGlyph(GlyphID key, bool use_aa) override;
|
||||||
const void *InternalGetFontTable(uint32_t tag, size_t &length) override;
|
|
||||||
public:
|
public:
|
||||||
CoreTextFontCache(FontSize fs, CFAutoRelease<CTFontDescriptorRef> &&font, int pixels);
|
CoreTextFontCache(FontSize fs, CFAutoRelease<CTFontDescriptorRef> &&font, int pixels);
|
||||||
~CoreTextFontCache() {}
|
~CoreTextFontCache() {}
|
||||||
@@ -36,6 +35,5 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void LoadCoreTextFont(FontSize fs);
|
void LoadCoreTextFont(FontSize fs);
|
||||||
void LoadCoreTextFont(FontSize fs, const std::string &file_name, uint size);
|
|
||||||
|
|
||||||
#endif /* FONT_OSX_H */
|
#endif /* FONT_OSX_H */
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ void Win32FontCache::SetFontSize(int pixels)
|
|||||||
POUTLINETEXTMETRIC otm = (POUTLINETEXTMETRIC)new BYTE[otmSize];
|
POUTLINETEXTMETRIC otm = (POUTLINETEXTMETRIC)new BYTE[otmSize];
|
||||||
GetOutlineTextMetrics(this->dc, otmSize, otm);
|
GetOutlineTextMetrics(this->dc, otmSize, otm);
|
||||||
|
|
||||||
this->units_per_em = otm->otmEMSquare;
|
|
||||||
this->ascender = otm->otmTextMetrics.tmAscent;
|
this->ascender = otm->otmTextMetrics.tmAscent;
|
||||||
this->descender = otm->otmTextMetrics.tmDescent;
|
this->descender = otm->otmTextMetrics.tmDescent;
|
||||||
this->height = this->ascender + this->descender;
|
this->height = this->ascender + this->descender;
|
||||||
@@ -299,20 +298,6 @@ void Win32FontCache::ClearFontCache()
|
|||||||
return allow_fallback && key >= SCC_SPRITE_START && key <= SCC_SPRITE_END ? this->parent->MapCharToGlyph(key) : 0;
|
return allow_fallback && key >= SCC_SPRITE_START && key <= SCC_SPRITE_END ? this->parent->MapCharToGlyph(key) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */ const void *Win32FontCache::InternalGetFontTable(uint32_t tag, size_t &length)
|
|
||||||
{
|
|
||||||
DWORD len = GetFontData(this->dc, tag, 0, nullptr, 0);
|
|
||||||
|
|
||||||
void *result = nullptr;
|
|
||||||
if (len != GDI_ERROR && len > 0) {
|
|
||||||
result = MallocT<BYTE>(len);
|
|
||||||
GetFontData(this->dc, tag, 0, result, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
length = len;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool TryLoadFontFromFile(const std::string &font_name, LOGFONT &logfont)
|
static bool TryLoadFontFromFile(const std::string &font_name, LOGFONT &logfont)
|
||||||
{
|
{
|
||||||
@@ -384,9 +369,10 @@ void LoadWin32Font(FontSize fs)
|
|||||||
{
|
{
|
||||||
FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
|
||||||
|
|
||||||
if (settings->font.empty()) return;
|
std::string font = GetFontCacheFontName(fs);
|
||||||
|
if (font.empty()) return;
|
||||||
|
|
||||||
const char *font_name = settings->font.c_str();
|
const char *font_name = font.c_str();
|
||||||
LOGFONT logfont;
|
LOGFONT logfont;
|
||||||
MemSetT(&logfont, 0);
|
MemSetT(&logfont, 0);
|
||||||
logfont.lfPitchAndFamily = fs == FS_MONO ? FIXED_PITCH : VARIABLE_PITCH;
|
logfont.lfPitchAndFamily = fs == FS_MONO ? FIXED_PITCH : VARIABLE_PITCH;
|
||||||
@@ -398,8 +384,8 @@ void LoadWin32Font(FontSize fs)
|
|||||||
logfont = *(const LOGFONT *)settings->os_handle;
|
logfont = *(const LOGFONT *)settings->os_handle;
|
||||||
} else if (strchr(font_name, '.') != nullptr) {
|
} else if (strchr(font_name, '.') != nullptr) {
|
||||||
/* Might be a font file name, try load it. */
|
/* Might be a font file name, try load it. */
|
||||||
if (!TryLoadFontFromFile(settings->font, logfont)) {
|
if (!TryLoadFontFromFile(font, logfont)) {
|
||||||
ShowInfo("Unable to load file '{}' for {} font, using default windows font selection instead", font_name, FontSizeToName(fs));
|
ShowInfo("Unable to load file '{}' for {} font, using default windows font selection instead", font, FontSizeToName(fs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,23 +396,3 @@ void LoadWin32Font(FontSize fs)
|
|||||||
|
|
||||||
LoadWin32Font(fs, logfont, settings->size, font_name);
|
LoadWin32Font(fs, logfont, settings->size, font_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a TrueType font from a file.
|
|
||||||
* @param fs The font size to load.
|
|
||||||
* @param file_name Path to the font file.
|
|
||||||
* @param size Requested font size.
|
|
||||||
*/
|
|
||||||
void LoadWin32Font(FontSize fs, const std::string &file_name, uint size)
|
|
||||||
{
|
|
||||||
LOGFONT logfont;
|
|
||||||
MemSetT(&logfont, 0);
|
|
||||||
logfont.lfPitchAndFamily = fs == FS_MONO ? FIXED_PITCH : VARIABLE_PITCH;
|
|
||||||
logfont.lfCharSet = DEFAULT_CHARSET;
|
|
||||||
logfont.lfOutPrecision = OUT_OUTLINE_PRECIS;
|
|
||||||
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
||||||
|
|
||||||
if (TryLoadFontFromFile(file_name, logfont)) {
|
|
||||||
LoadWin32Font(fs, logfont, size, file_name.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ private:
|
|||||||
void SetFontSize(int pixels);
|
void SetFontSize(int pixels);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const void *InternalGetFontTable(uint32_t tag, size_t &length) override;
|
|
||||||
const Sprite *InternalGetGlyph(GlyphID key, bool aa) override;
|
const Sprite *InternalGetGlyph(GlyphID key, bool aa) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -41,6 +40,5 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void LoadWin32Font(FontSize fs);
|
void LoadWin32Font(FontSize fs);
|
||||||
void LoadWin32Font(FontSize fs, const std::string &file_name, uint size);
|
|
||||||
|
|
||||||
#endif /* FONT_WIN32_H */
|
#endif /* FONT_WIN32_H */
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "currency.h"
|
#include "currency.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "settings_gui.h"
|
#include "settings_gui.h"
|
||||||
|
#include "string_type.h"
|
||||||
#include "textbuf_gui.h"
|
#include "textbuf_gui.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "network/network.h"
|
#include "network/network.h"
|
||||||
@@ -95,8 +96,6 @@ static uint GetCurrentResolutionIndex()
|
|||||||
|
|
||||||
static void ShowCustCurrency();
|
static void ShowCustCurrency();
|
||||||
|
|
||||||
static void ReconstructUserInterface();
|
|
||||||
|
|
||||||
/** Window for displaying the textfile of a BaseSet. */
|
/** Window for displaying the textfile of a BaseSet. */
|
||||||
template <class TBaseSet>
|
template <class TBaseSet>
|
||||||
struct BaseSetTextfileWindow : public TextfileWindow {
|
struct BaseSetTextfileWindow : public TextfileWindow {
|
||||||
@@ -360,10 +359,12 @@ std::unique_ptr<NWidgetBase> MakeNWidgetSocialPlugins()
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct GameOptionsWindow : Window {
|
struct GameOptionsWindow : Window {
|
||||||
|
int query_widget;
|
||||||
GameSettings *opt;
|
GameSettings *opt;
|
||||||
bool reload;
|
bool reload;
|
||||||
int gui_scale;
|
int gui_scale;
|
||||||
int button_ratio;
|
int button_ratio;
|
||||||
|
uint32_t font_sizes[FS_END];
|
||||||
static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
|
static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
|
||||||
|
|
||||||
GameOptionsWindow(WindowDesc *desc) : Window(desc)
|
GameOptionsWindow(WindowDesc *desc) : Window(desc)
|
||||||
@@ -372,6 +373,10 @@ struct GameOptionsWindow : Window {
|
|||||||
this->reload = false;
|
this->reload = false;
|
||||||
this->gui_scale = _gui_scale;
|
this->gui_scale = _gui_scale;
|
||||||
this->button_ratio = _button_ratio;
|
this->button_ratio = _button_ratio;
|
||||||
|
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++){
|
||||||
|
FontCacheSubSetting *fc = GetFontCacheSubSetting(fs);
|
||||||
|
font_sizes[fs] = fc->size;
|
||||||
|
}
|
||||||
|
|
||||||
AddCustomRefreshRates();
|
AddCustomRefreshRates();
|
||||||
|
|
||||||
@@ -523,7 +528,15 @@ struct GameOptionsWindow : Window {
|
|||||||
SetDParam(0, _autosave_dropdown[index - 1]);
|
SetDParam(0, _autosave_dropdown[index - 1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break;
|
case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break;
|
||||||
|
case WID_GO_NORMAL_FONT_VALUE:
|
||||||
|
case WID_GO_SMALL_FONT_VALUE:
|
||||||
|
case WID_GO_LARGE_FONT_VALUE:
|
||||||
|
case WID_GO_MONO_FONT_VALUE: {
|
||||||
|
SetDParam(0, this->font_sizes[static_cast<FontSize>(Clamp(widget - WID_GO_NORMAL_FONT_VALUE, FS_BEGIN, FS_END))]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->GetListLabel()); break;
|
case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->GetListLabel()); break;
|
||||||
case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->GetListLabel()); break;
|
case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->GetListLabel()); break;
|
||||||
case WID_GO_BASE_MUSIC_DROPDOWN: SetDParamStr(0, BaseMusic::GetUsedSet()->GetListLabel()); break;
|
case WID_GO_BASE_MUSIC_DROPDOWN: SetDParamStr(0, BaseMusic::GetUsedSet()->GetListLabel()); break;
|
||||||
@@ -596,7 +609,7 @@ struct GameOptionsWindow : Window {
|
|||||||
|
|
||||||
void SetTab(WidgetID widget)
|
void SetTab(WidgetID widget)
|
||||||
{
|
{
|
||||||
this->SetWidgetsLoweredState(false, WID_GO_TAB_GENERAL, WID_GO_TAB_INTERFACE, WID_GO_TAB_GRAPHICS, WID_GO_TAB_SOUND, WID_GO_TAB_SOCIAL);
|
this->SetWidgetsLoweredState(false, WID_GO_TAB_GENERAL, WID_GO_TAB_INTERFACE, WID_GO_TAB_FONTS, WID_GO_TAB_GRAPHICS, WID_GO_TAB_SOUND, WID_GO_TAB_SOCIAL);
|
||||||
this->LowerWidget(widget);
|
this->LowerWidget(widget);
|
||||||
GameOptionsWindow::active_tab = widget;
|
GameOptionsWindow::active_tab = widget;
|
||||||
|
|
||||||
@@ -604,9 +617,10 @@ struct GameOptionsWindow : Window {
|
|||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_GO_TAB_GENERAL: pane = 0; break;
|
case WID_GO_TAB_GENERAL: pane = 0; break;
|
||||||
case WID_GO_TAB_INTERFACE: pane = 1; break;
|
case WID_GO_TAB_INTERFACE: pane = 1; break;
|
||||||
case WID_GO_TAB_GRAPHICS: pane = 2; break;
|
case WID_GO_TAB_FONTS: pane = 2; break;
|
||||||
case WID_GO_TAB_SOUND: pane = 3; break;
|
case WID_GO_TAB_GRAPHICS: pane = 3; break;
|
||||||
case WID_GO_TAB_SOCIAL: pane = 4; break;
|
case WID_GO_TAB_SOUND: pane = 4; break;
|
||||||
|
case WID_GO_TAB_SOCIAL: pane = 5; break;
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -700,6 +714,7 @@ struct GameOptionsWindow : Window {
|
|||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_GO_TAB_GENERAL:
|
case WID_GO_TAB_GENERAL:
|
||||||
case WID_GO_TAB_INTERFACE:
|
case WID_GO_TAB_INTERFACE:
|
||||||
|
case WID_GO_TAB_FONTS:
|
||||||
case WID_GO_TAB_GRAPHICS:
|
case WID_GO_TAB_GRAPHICS:
|
||||||
case WID_GO_TAB_SOUND:
|
case WID_GO_TAB_SOUND:
|
||||||
case WID_GO_TAB_SOCIAL:
|
case WID_GO_TAB_SOCIAL:
|
||||||
@@ -800,6 +815,37 @@ struct GameOptionsWindow : Window {
|
|||||||
ClearFontCache();
|
ClearFontCache();
|
||||||
break;
|
break;
|
||||||
#endif /* HAS_TRUETYPE_FONT */
|
#endif /* HAS_TRUETYPE_FONT */
|
||||||
|
case WID_GO_NORMAL_FONT_L:
|
||||||
|
case WID_GO_NORMAL_FONT_R:
|
||||||
|
case WID_GO_SMALL_FONT_L:
|
||||||
|
case WID_GO_SMALL_FONT_R:
|
||||||
|
case WID_GO_LARGE_FONT_L:
|
||||||
|
case WID_GO_LARGE_FONT_R:
|
||||||
|
case WID_GO_MONO_FONT_L:
|
||||||
|
case WID_GO_MONO_FONT_R: {
|
||||||
|
int index = widget - WID_GO_NORMAL_FONT_L;
|
||||||
|
FontSize fs = static_cast<FontSize>(Clamp((widget - WID_GO_NORMAL_FONT_L) / 2, FS_BEGIN, FS_END));
|
||||||
|
|
||||||
|
if (index % 2 == 0) {
|
||||||
|
this->font_sizes[fs] = Clamp(this->font_sizes[fs] - 1, 0, 200);
|
||||||
|
} else {
|
||||||
|
this->font_sizes[fs] = Clamp(this->font_sizes[fs] + 1, 0, 200);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WID_GO_NORMAL_FONT_VALUE:
|
||||||
|
case WID_GO_SMALL_FONT_VALUE:
|
||||||
|
case WID_GO_LARGE_FONT_VALUE:
|
||||||
|
case WID_GO_MONO_FONT_VALUE: {
|
||||||
|
int index = Clamp(widget - WID_GO_NORMAL_FONT_VALUE, FS_BEGIN, FS_END);
|
||||||
|
this->query_widget = widget;
|
||||||
|
FontSize fs = static_cast<FontSize>(index);
|
||||||
|
SetDParam(0, this->font_sizes[fs]);
|
||||||
|
ShowQueryString(STR_JUST_INT, STR_GAME_OPTIONS_FONT_NORMAL + index, 3, this, CS_NUMERAL, QSF_NONE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case WID_GO_MOUSE_CURSOR:
|
case WID_GO_MOUSE_CURSOR:
|
||||||
if (_settings_client.gui.draw_mouse_cursor) {
|
if (_settings_client.gui.draw_mouse_cursor) {
|
||||||
UndrawMouseCursor();
|
UndrawMouseCursor();
|
||||||
@@ -917,13 +963,44 @@ struct GameOptionsWindow : Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnQueryTextFinished(char *str) override
|
||||||
|
{
|
||||||
|
if (str == nullptr) return;
|
||||||
|
|
||||||
|
int index = Clamp(this->query_widget - WID_GO_NORMAL_FONT_VALUE, FS_BEGIN, FS_END);
|
||||||
|
this->font_sizes[index] = Clamp(atoi(str), 0, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool anySizeSettingChanged()
|
||||||
|
{
|
||||||
|
if (this->gui_scale != _gui_scale || this->button_ratio != _button_ratio) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++){
|
||||||
|
FontCacheSubSetting *fc = GetFontCacheSubSetting(fs);
|
||||||
|
if (this->font_sizes[fs] != fc->size)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
void OnMouseLoop() override
|
void OnMouseLoop() override
|
||||||
{
|
{
|
||||||
if (_left_button_down || (this->gui_scale == _gui_scale && this->button_ratio == _button_ratio)) return;
|
if (_left_button_down || !anySizeSettingChanged()) return;
|
||||||
|
|
||||||
_gui_scale_cfg = this->gui_scale;
|
_gui_scale_cfg = this->gui_scale;
|
||||||
_button_ratio_cfg = this->button_ratio;
|
_button_ratio_cfg = this->button_ratio;
|
||||||
|
|
||||||
|
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++){
|
||||||
|
FontCacheSubSetting *fc = GetFontCacheSubSetting(fs);
|
||||||
|
if (this->font_sizes[fs] != fc->size) {
|
||||||
|
ResizeFont(fs, this->font_sizes[fs]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (AdjustGUIZoom(false)) {
|
if (AdjustGUIZoom(false)) {
|
||||||
ReInitAllWindows(true);
|
ReInitAllWindows(true);
|
||||||
this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false);
|
this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false);
|
||||||
@@ -1055,6 +1132,7 @@ static constexpr NWidgetPart _nested_game_options_widgets[] = {
|
|||||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(WidgetDimensions::unscaled.sparse),
|
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(WidgetDimensions::unscaled.sparse),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_GENERAL), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_GENERAL, STR_GAME_OPTIONS_TAB_GENERAL_TT), SetFill(1, 0),
|
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_GENERAL), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_GENERAL, STR_GAME_OPTIONS_TAB_GENERAL_TT), SetFill(1, 0),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_INTERFACE), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_INTERFACE, STR_GAME_OPTIONS_TAB_INTERFACE_TT), SetFill(1, 0),
|
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_INTERFACE), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_INTERFACE, STR_GAME_OPTIONS_TAB_INTERFACE_TT), SetFill(1, 0),
|
||||||
|
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_FONTS), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_FONTS, STR_GAME_OPTIONS_TAB_FONTS_TT), SetFill(1, 0),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_GRAPHICS), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_GRAPHICS, STR_GAME_OPTIONS_TAB_GRAPHICS_TT), SetFill(1, 0),
|
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_GRAPHICS), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_GRAPHICS, STR_GAME_OPTIONS_TAB_GRAPHICS_TT), SetFill(1, 0),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_SOUND), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_SOUND, STR_GAME_OPTIONS_TAB_SOUND_TT), SetFill(1, 0),
|
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_SOUND), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_SOUND, STR_GAME_OPTIONS_TAB_SOUND_TT), SetFill(1, 0),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_SOCIAL), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_SOCIAL, STR_GAME_OPTIONS_TAB_SOCIAL_TT), SetFill(1, 0),
|
NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GO_TAB_SOCIAL), SetMinimalTextLines(2, 0), SetDataTip(STR_GAME_OPTIONS_TAB_SOCIAL, STR_GAME_OPTIONS_TAB_SOCIAL_TT), SetFill(1, 0),
|
||||||
@@ -1106,6 +1184,18 @@ static constexpr NWidgetPart _nested_game_options_widgets[] = {
|
|||||||
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_BEVELS, STR_NULL),
|
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_BEVELS, STR_NULL),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_GUI_SCALE_BEVEL_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP),
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_GUI_SCALE_BEVEL_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
|
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_CONFIG_SETTING_MOUSE_CURSOR, STR_NULL),
|
||||||
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_MOUSE_CURSOR), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_CONFIG_SETTING_MOUSE_CURSOR_HELPTEXT),
|
||||||
|
EndContainer(),
|
||||||
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
|
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_CONFIG_SETTING_WINDOWS_TITLEBARS, STR_NULL),
|
||||||
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_WINDOWS_TITLEBARS), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_CONFIG_SETTING_WINDOWS_TITLEBARS_HELPTEXT),
|
||||||
|
EndContainer(),
|
||||||
|
EndContainer(),
|
||||||
|
|
||||||
|
/* Fonts tab */
|
||||||
|
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.sparse), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0),
|
||||||
#ifdef HAS_TRUETYPE_FONT
|
#ifdef HAS_TRUETYPE_FONT
|
||||||
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_GUI_FONT_SPRITE, STR_NULL),
|
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_GUI_FONT_SPRITE, STR_NULL),
|
||||||
@@ -1117,12 +1207,28 @@ static constexpr NWidgetPart _nested_game_options_widgets[] = {
|
|||||||
EndContainer(),
|
EndContainer(),
|
||||||
#endif /* HAS_TRUETYPE_FONT */
|
#endif /* HAS_TRUETYPE_FONT */
|
||||||
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_CONFIG_SETTING_MOUSE_CURSOR, STR_NULL),
|
NWidget(WWT_TEXT, COLOUR_GREY), SetTextStyle(TC_BLACK, FS_NORMAL), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_FONT_NORMAL, STR_NULL),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_MOUSE_CURSOR), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_CONFIG_SETTING_MOUSE_CURSOR_HELPTEXT),
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_NORMAL_FONT_L), SetDataTip(AWV_DECREASE, STR_NULL),
|
||||||
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_GO_NORMAL_FONT_VALUE), SetDataTip(STR_JUST_INT, STR_NULL), SetTextStyle(TC_WHITE),
|
||||||
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_NORMAL_FONT_R), SetDataTip(AWV_INCREASE, STR_NULL),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_CONFIG_SETTING_WINDOWS_TITLEBARS, STR_NULL),
|
NWidget(WWT_TEXT, COLOUR_GREY), SetTextStyle(TC_BLACK, FS_SMALL), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_FONT_SMALL, STR_NULL),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_WINDOWS_TITLEBARS), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_CONFIG_SETTING_WINDOWS_TITLEBARS_HELPTEXT),
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_SMALL_FONT_L), SetDataTip(AWV_DECREASE, STR_NULL),
|
||||||
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_GO_SMALL_FONT_VALUE), SetDataTip(STR_JUST_INT, STR_NULL), SetTextStyle(TC_WHITE),
|
||||||
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_SMALL_FONT_R), SetDataTip(AWV_INCREASE, STR_NULL),
|
||||||
|
EndContainer(),
|
||||||
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
|
NWidget(WWT_TEXT, COLOUR_GREY), SetTextStyle(TC_BLACK, FS_LARGE), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_FONT_LARGE, STR_NULL),
|
||||||
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_LARGE_FONT_L), SetDataTip(AWV_DECREASE, STR_NULL),
|
||||||
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_GO_LARGE_FONT_VALUE), SetDataTip(STR_JUST_INT, STR_NULL), SetTextStyle(TC_WHITE),
|
||||||
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_LARGE_FONT_R), SetDataTip(AWV_INCREASE, STR_NULL),
|
||||||
|
EndContainer(),
|
||||||
|
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
|
||||||
|
NWidget(WWT_TEXT, COLOUR_GREY), SetTextStyle(TC_BLACK, FS_MONO), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_FONT_MONO, STR_NULL),
|
||||||
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_MONO_FONT_L), SetDataTip(AWV_DECREASE, STR_NULL),
|
||||||
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_GO_MONO_FONT_VALUE), SetDataTip(STR_JUST_INT, STR_NULL), SetTextStyle(TC_WHITE),
|
||||||
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_GO_MONO_FONT_R), SetDataTip(AWV_INCREASE, STR_NULL),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public:
|
|||||||
uint GetGlyphWidth(GlyphID) override { return this->height / 2; }
|
uint GetGlyphWidth(GlyphID) override { return this->height / 2; }
|
||||||
bool GetDrawGlyphShadow() override { return false; }
|
bool GetDrawGlyphShadow() override { return false; }
|
||||||
GlyphID MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback = true) override { return key; }
|
GlyphID MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback = true) override { return key; }
|
||||||
const void *GetFontTable(uint32_t, size_t &length) override { length = 0; return nullptr; }
|
|
||||||
std::string GetFontName() override { return "mock"; }
|
std::string GetFontName() override { return "mock"; }
|
||||||
bool IsBuiltInFont() override { return true; }
|
bool IsBuiltInFont() override { return true; }
|
||||||
|
|
||||||
|
|||||||
@@ -525,9 +525,7 @@ bool VideoDriver_SDL::PollEvent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_cursor.UpdateCursorPosition(x, y)) {
|
if (_cursor.UpdateCursorPosition(x, y)) {
|
||||||
#ifndef __ANDROID__ // No mouse warping on Android, mouse strictly follows finger
|
|
||||||
SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y);
|
SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
HandleMouseEvents();
|
HandleMouseEvents();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ public:
|
|||||||
virtual ~DropDownListItem() = default;
|
virtual ~DropDownListItem() = default;
|
||||||
|
|
||||||
virtual bool Selectable() const { return true; }
|
virtual bool Selectable() const { return true; }
|
||||||
virtual uint Height() const { return 0; }
|
virtual uint Height() const { return GetMinButtonSize(); }
|
||||||
virtual uint Width() const { return 0; }
|
virtual uint Width() const { return GetMinButtonSize(); }
|
||||||
|
|
||||||
virtual void Draw(const Rect &full, const Rect &, bool, Colours bg_colour) const
|
virtual void Draw(const Rect &full, const Rect &, bool, Colours bg_colour) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
enum GameOptionsWidgets : WidgetID {
|
enum GameOptionsWidgets : WidgetID {
|
||||||
WID_GO_TAB_GENERAL, ///< General tab.
|
WID_GO_TAB_GENERAL, ///< General tab.
|
||||||
WID_GO_TAB_INTERFACE, ///< Interface tab.
|
WID_GO_TAB_INTERFACE, ///< Interface tab.
|
||||||
|
WID_GO_TAB_FONTS, ///< Fonts tab.
|
||||||
WID_GO_TAB_GRAPHICS, ///< Graphics tab.
|
WID_GO_TAB_GRAPHICS, ///< Graphics tab.
|
||||||
WID_GO_TAB_SOUND, ///< Sound tab.
|
WID_GO_TAB_SOUND, ///< Sound tab.
|
||||||
WID_GO_TAB_SOCIAL, ///< Social tab.
|
WID_GO_TAB_SOCIAL, ///< Social tab.
|
||||||
@@ -36,6 +37,18 @@ enum GameOptionsWidgets : WidgetID {
|
|||||||
WID_GO_GUI_SCALE_BEVEL_BUTTON, ///< Toggle for chunky bevels.
|
WID_GO_GUI_SCALE_BEVEL_BUTTON, ///< Toggle for chunky bevels.
|
||||||
WID_GO_GUI_FONT_SPRITE, ///< Toggle whether to prefer the sprite font over TTF fonts.
|
WID_GO_GUI_FONT_SPRITE, ///< Toggle whether to prefer the sprite font over TTF fonts.
|
||||||
WID_GO_GUI_FONT_AA, ///< Toggle whether to anti-alias fonts.
|
WID_GO_GUI_FONT_AA, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_NORMAL_FONT_VALUE, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_SMALL_FONT_VALUE, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_LARGE_FONT_VALUE, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_MONO_FONT_VALUE, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_NORMAL_FONT_L, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_NORMAL_FONT_R, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_SMALL_FONT_L, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_SMALL_FONT_R, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_LARGE_FONT_L, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_LARGE_FONT_R, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_MONO_FONT_L, ///< Toggle whether to anti-alias fonts.
|
||||||
|
WID_GO_MONO_FONT_R, ///< Toggle whether to anti-alias fonts.
|
||||||
WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF.
|
WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF.
|
||||||
WID_GO_BASE_GRF_PARAMETERS, ///< Base GRF parameters.
|
WID_GO_BASE_GRF_PARAMETERS, ///< Base GRF parameters.
|
||||||
WID_GO_BASE_GRF_OPEN_URL, ///< Open base GRF URL.
|
WID_GO_BASE_GRF_OPEN_URL, ///< Open base GRF URL.
|
||||||
|
|||||||
Reference in New Issue
Block a user