Skip to content

Commit

Permalink
Switch default to 'Segoe UI' (Win sys font) from Arial
Browse files Browse the repository at this point in the history
Switch to the Segoe UI windows system font instead of Arial for the GUI's. This will solve the problem of overlapping GUI elements and in most instances text being cut off (labels etc.)

Segoe UI is supported/provided on/with Windows Vista up to Windows 11 and especially designed for use in GUI's

This commit does not tackle the security issues with the "getEnvironment" command.
  • Loading branch information
Eikelenboom committed Oct 29, 2024
1 parent 5864026 commit 03fb3de
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions Templates/BaseGame/game/tools/gui/profiles.ed.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ $Gui::localFontsPath = getEnvironment("LOCALAPPDATA") @ "/Microsoft/Windows/Font
$Gui::winFontsPath = getEnvironment("SystemRoot") @ "/Fonts/";

// Default editor font settings
$Gui::fontTypeRegular = "Arial";
$Gui::fontTypeLight = "Arial Light";
$Gui::fontTypeMedium = "Arial Medium";
$Gui::fontTypeBold = "Arial Bold";
$Gui::fontTypeItalic = "Arial Italic";
// Segoe is standard provided with Windows Vista to 11
$Gui::fontTypeRegular = "Segoe UI";
$Gui::fontTypeLight = "Segoe UI Semilight";
$Gui::fontTypeMedium = "Segoe UI Regular";
$Gui::fontTypeBold = "Segoe UI Bold";
$Gui::fontTypeItalic = "Segoe UI Italic";

// Default codefont settings
$Gui::fontTypeMono = "Lucida Console"; // Standard provided with Windows 7 to 11
Expand All @@ -53,6 +54,7 @@ $GUI::fontSize[24] = 24;
$GUI::fontSize[36] = 36;

// Override with Open Sans (if available)
// Open Sans is an Open Source UI font with Apache License
if ($Gui::editorFont $= "Open Sans")
{
if(isFile($Gui::localFontsPath @ "OpenSans-Regular.ttf") || isFile($Gui::winFontsPath @ "OpenSans-Regular.ttf"))
Expand All @@ -71,16 +73,16 @@ if ($Gui::editorFont $= "Open Sans")
}
}

// Override with Sego UI (if available)
if ($Gui::editorFont $= "Segoe UI")
// Override with Arial (if available)
if ($Gui::editorFont $= "Arial")
{
if(isFile($Gui::localFontsPath @ "segoeui.ttf") || isFile($Gui::winFontsPath @ "segoeui.ttf"))
if(isFile($Gui::localFontsPath @ "Arial.ttf") || isFile($Gui::winFontsPath @ "Arial.ttf"))
{
$Gui::fontTypeRegular = "Segoe UI";
$Gui::fontTypeLight = "Segoe UI Semilight";
$Gui::fontTypeMedium = "Segoe UI Regular";
$Gui::fontTypeBold = "Segoe UI Bold";
$Gui::fontTypeItalic = "Segoe UI Italic";
$Gui::fontTypeRegular = "Arial";
$Gui::fontTypeLight = "Arial";
$Gui::fontTypeMedium = "Arial";
$Gui::fontTypeBold = "Arial Bold";
$Gui::fontTypeItalic = "Arial Italic";
$GUI::fontSize[12] = 12;
$GUI::fontSize[14] = 14;
$GUI::fontSize[16] = 16;
Expand All @@ -100,7 +102,7 @@ if ($Gui::codeFont $= "Cascadia Code")
}
}

// Override with Cascadia Code (if available)
// Override with Consolas Code (if available)
if ($Gui::codeFont $= "Consolas")
{
if(isFile($Gui::localFontsPath @ "consola.ttf") || isFile($Gui::winFontsPath @ "consola.ttf"))
Expand All @@ -110,6 +112,7 @@ if ($Gui::codeFont $= "Consolas")
}
}


if( !isObject( ToolsGuiDefaultProfile ) )
new GuiControlProfile (ToolsGuiDefaultProfile)
{
Expand Down

0 comments on commit 03fb3de

Please sign in to comment.