Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,46 @@
#include "WW3D2/render2dsentence.h"
#include "GameClient/GlobalLanguage.h"

namespace
{
// GeneralsX @bugfix GitHubCopilot 20/05/2026 Resolve a usable Unicode fallback font on macOS/Linux when localized font names are unavailable.
FontCharsClass *LoadUnicodeFallbackFont(Int size, Bool bold)
{
const char *preferred_name = nullptr;
if (TheGlobalLanguageData && TheGlobalLanguageData->m_unicodeFontName.isNotEmpty()) {
preferred_name = TheGlobalLanguageData->m_unicodeFontName.str();
}

if (preferred_name != nullptr) {
FontCharsClass *font = WW3DAssetManager::Get_Instance()->Get_FontChars(preferred_name, size, bold);
if (font != nullptr) {
return font;
}
}

static const char *kFallbackUnicodeFonts[] = {
"Arial Unicode MS",
"Arial Unicode",
"Arial",
"Helvetica Neue",
"Helvetica",
"Noto Sans",
"Noto Sans CJK SC",
"Noto Sans CJK JP",
"DejaVu Sans"
};

for (const char *font_name : kFallbackUnicodeFonts) {
FontCharsClass *font = WW3DAssetManager::Get_Instance()->Get_FontChars(font_name, size, bold);
if (font != nullptr) {
return font;
}
}

return nullptr;
}
}

// DEFINES ////////////////////////////////////////////////////////////////////

// PRIVATE TYPES //////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -95,8 +135,7 @@ Bool W3DFontLibrary::loadFontData( GameFont *font )
font->height = fontChar->Get_Char_Height();

// load Unicode of same point size
name = TheGlobalLanguageData ? TheGlobalLanguageData->m_unicodeFontName.str() : "Arial Unicode MS";
fontChar->AlternateUnicodeFont = WW3DAssetManager::Get_Instance()->Get_FontChars( name, size, bold );
fontChar->AlternateUnicodeFont = LoadUnicodeFallbackFont(size, bold);

return TRUE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,46 @@
#include "WW3D2/render2dsentence.h"
#include "GameClient/GlobalLanguage.h"

namespace
{
// GeneralsX @bugfix GitHubCopilot 20/05/2026 Resolve a usable Unicode fallback font on macOS/Linux when localized font names are unavailable.
FontCharsClass *LoadUnicodeFallbackFont(Int size, Bool bold)
{
const char *preferred_name = nullptr;
if (TheGlobalLanguageData && TheGlobalLanguageData->m_unicodeFontName.isNotEmpty()) {
preferred_name = TheGlobalLanguageData->m_unicodeFontName.str();
}

if (preferred_name != nullptr) {
FontCharsClass *font = WW3DAssetManager::Get_Instance()->Get_FontChars(preferred_name, size, bold);
if (font != nullptr) {
return font;
}
}

static const char *kFallbackUnicodeFonts[] = {
"Arial Unicode MS",
"Arial Unicode",
"Arial",
"Helvetica Neue",
"Helvetica",
"Noto Sans",
"Noto Sans CJK SC",
"Noto Sans CJK JP",
"DejaVu Sans"
};

for (const char *font_name : kFallbackUnicodeFonts) {
FontCharsClass *font = WW3DAssetManager::Get_Instance()->Get_FontChars(font_name, size, bold);
if (font != nullptr) {
return font;
}
}

return nullptr;
}
}

// DEFINES ////////////////////////////////////////////////////////////////////

// PRIVATE TYPES //////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -95,8 +135,7 @@ Bool W3DFontLibrary::loadFontData( GameFont *font )
font->height = fontChar->Get_Char_Height();

// load Unicode of same point size
name = TheGlobalLanguageData ? TheGlobalLanguageData->m_unicodeFontName.str() : "Arial Unicode MS";
fontChar->AlternateUnicodeFont = WW3DAssetManager::Get_Instance()->Get_FontChars( name, size, bold );
fontChar->AlternateUnicodeFont = LoadUnicodeFallbackFont(size, bold);

return TRUE;
}
Expand Down
19 changes: 19 additions & 0 deletions docs/DEV_BLOG/2026-05-DIARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

---

## 2026-05-20: Start fix for macOS Cyrillic labels missing (Issue #144)

Started implementation for Issue #144 after confirming reproduction details and
scope from the issue thread were sufficient to proceed without extra blockers.

What was done:
- created branch `fix/issue-144-macos-cyrillic-text`.
- implemented robust Unicode fallback font resolution in both game targets:
- `GeneralsMD/.../W3DGameFont.cpp`
- `Generals/.../W3DGameFont.cpp`
- replaced direct single-font lookup for `AlternateUnicodeFont` with a fallback
chain that first tries localized configured Unicode font, then common system
fonts available on macOS/Linux (Arial/Helvetica/Noto/DejaVu families).
- kept behavior isolated to font loading path only; no gameplay logic touched.

Validation:
- `[Platform] Build GeneralsXZH` completed successfully after the change.
- no diagnostics errors were reported in the edited font source files.

## 2026-05-18: CI migration to macOS + Flatpak with Linux replay in Flatpak

Migrated CI to keep only macOS and Linux Flatpak builds, and switched Linux
Expand Down
Loading