Skip to content

Commit

Permalink
Revert "Revert "Update Unifont from 5.1 to 13.0.04 (#1980)""
Browse files Browse the repository at this point in the history
This reverts commit 50e3299.
  • Loading branch information
patrikjuvonen committed Jan 7, 2021
1 parent 9687fd3 commit 874b6c6
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Client/core/Graphics/CGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ bool CGraphics::LoadStandardDXFonts()
m_FontResourceNames.push_back("sabankgothic.ttf");
m_FontResourceNames.push_back("saheader.ttf");
m_FontResourceNames.push_back("sagothic.ttf");
m_FontResourceNames.push_back("unifont-5.1.20080907.ttf");
m_FontResourceNames.push_back("unifont-13.0.04.ttf");
}

for (uint i = 0; i < m_FontResourceNames.size(); i++)
Expand Down
2 changes: 1 addition & 1 deletion Client/gui/CGUI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using std::list;
#define CGUI_MTA_DEFAULT_REG_BOLD "Tahoma Bold (TrueType)"
#define CGUI_MTA_CLEAR_REG "Verdana (TrueType)"

#define CGUI_MTA_SUBSTITUTE_FONT "cgui/unifont-5.1.20080907.ttf" // GTA/MTA/<...>
#define CGUI_MTA_SUBSTITUTE_FONT "cgui/unifont-13.0.04.ttf" // GTA/MTA/<...>
#define CGUI_MTA_SANS_FONT "cgui/sans.ttf" // GTA/MTA/<...>
#define CGUI_SA_HEADER_FONT "cgui/saheader.ttf" // GTA/MTA/<...>
#define CGUI_SA_GOTHIC_FONT "cgui/sagothic.ttf" // GTA/MTA/<...>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ ADD_ENUM(FONT_PRICEDOWN, "pricedown")
ADD_ENUM(FONT_BANKGOTHIC, "bankgothic")
ADD_ENUM(FONT_DIPLOMA, "diploma")
ADD_ENUM(FONT_BECKETT, "beckett")
ADD_ENUM(FONT_UNIFONT, "unifont")
IMPLEMENT_ENUM_END_DEFAULTS("font-type", FONT_DEFAULT, "")

IMPLEMENT_ENUM_BEGIN(eFontQuality)
Expand Down
1 change: 1 addition & 0 deletions Shared/data/MTA San Andreas/MTA/cgui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unifont-*.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion Shared/data/data files installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Section "Data files" SEC01
File "${FILES_ROOT}\MTA San Andreas\mta\cgui\sagothic.ttf"
File "${FILES_ROOT}\MTA San Andreas\mta\cgui\saheader.ttf"
File "${FILES_ROOT}\MTA San Andreas\mta\cgui\sans.ttf"
File "${FILES_ROOT}\MTA San Andreas\mta\cgui\unifont-5.1.20080907.ttf"
File "${FILES_ROOT}\MTA San Andreas\mta\cgui\unifont-13.0.04.ttf"

SetOutPath "$INSTDIR\MTA\cgui\images"
File "${FILES_ROOT}\MTA San Andreas\mta\cgui\images\*.png"
Expand Down
2 changes: 1 addition & 1 deletion Shared/installer/nightly.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ SectionGroup /e "$(INST_SEC_CLIENT)" SECGCLIENT
File "${FILES_ROOT}\mta\cgui\sagothic.ttf"
File "${FILES_ROOT}\mta\cgui\saheader.ttf"
File "${FILES_ROOT}\mta\cgui\sans.ttf"
File "${FILES_ROOT}\mta\cgui\unifont-5.1.20080907.ttf"
File "${FILES_ROOT}\mta\cgui\unifont-13.0.04.ttf"

SetOutPath "$INSTDIR\MTA\cgui\images"
File "${FILES_ROOT}\mta\cgui\images\*.png"
Expand Down
1 change: 1 addition & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require "install_data"
require "install_resources"
require "install_cef"
require "install_discord"
require "install_unifont"

-- Set CI Build global
local ci = os.getenv("CI")
Expand Down
44 changes: 44 additions & 0 deletions utils/buildactions/install_unifont.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require 'utils'

premake.modules.install_unifont = {}

-- Config variables
local UNIFONT_BASEURL = "https://github.com/multitheftauto/unifont/releases/download/"
local UNIFONT_FILENAME = "unifont-13.0.04.ttf"
local UNIFONT_PATH = "Shared/data/MTA San Andreas/MTA/cgui"

-- Change these to update the version
local UNIFONT_TAG = "v13.0.04"
local UNIFONT_HASH = "a74c124f25c25ee588c3e8436781d93f181d049ea838ea8eb97e85cd9266c2b1"

newaction {
trigger = "install_unifont",
description = "Downloads and installs Unifont",

execute = function()
-- Check file hash
local archive_path = UNIFONT_PATH.."/"..UNIFONT_FILENAME
if os.isfile(archive_path) and os.sha256_file(archive_path) == UNIFONT_HASH then
print("Unifont is up to date.")
return
end

-- Download Unifont
print("Downloading Unifont...")
if not http.download_print_errors(UNIFONT_BASEURL..UNIFONT_TAG.."/"..UNIFONT_FILENAME, archive_path) then
return
end

-- Check downloaded file hash
if os.sha256_file(archive_path) ~= UNIFONT_HASH then
print("Unifont hash mismatch!")
-- Delete bad file
os.remove(archive_path)
return
end

print("Unifont updated.")
end
}

return premake.modules.install_unifont
3 changes: 3 additions & 0 deletions win-create-projects.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
rem Update CEF eventually
utils\premake5.exe install_cef

rem Update Unifont
utils\premake5.exe install_unifont

rem Generate solutions
utils\premake5.exe vs2019

Expand Down

0 comments on commit 874b6c6

Please sign in to comment.