From fdc38f3867a3727edf097ec0241efc0b59d75395 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Jul 2022 15:38:16 -0700 Subject: Fix missing fonts under Linux (#437) * Replace Arial and Lucidia fonts with Lato and Fira Code respectively, this fixes Linux users needing to install proprietary fonts to use the in-game console. * Clean up gitattributes and encoding.yml to be more specific about the txt files it checks against. UTF-16LE-BOM will crash the game with a division by zero error if it's not expecting the file to be encoded as such. * Replace Fira Code with Northstar Mono (Modified Fira Mono Regular) --- .gitattributes | 2 +- .github/workflows/encoding.yml | 2 +- Northstar.Client/mod/resource/Lato-Regular.ttf | Bin 0 -> 657212 bytes Northstar.Client/mod/resource/NorthstarMono.ttf | Bin 0 -> 170600 bytes Northstar.Client/mod/resource/fontfiletable.txt | 40 ++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Northstar.Client/mod/resource/Lato-Regular.ttf create mode 100644 Northstar.Client/mod/resource/NorthstarMono.ttf create mode 100644 Northstar.Client/mod/resource/fontfiletable.txt diff --git a/.gitattributes b/.gitattributes index f18a3db7..c6a941df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -/Northstar.Client/mod/resource/*.txt text diff working-tree-encoding=UTF-16LE-BOM \ No newline at end of file +/Northstar.Client/mod/resource/northstar_client_localisation_*.txt text diff working-tree-encoding=UTF-16LE-BOM \ No newline at end of file diff --git a/.github/workflows/encoding.yml b/.github/workflows/encoding.yml index 0b54639e..ac63e784 100644 --- a/.github/workflows/encoding.yml +++ b/.github/workflows/encoding.yml @@ -9,5 +9,5 @@ jobs: uses: actions/checkout@v2 - name: Check localization files encoding run: | - files=$(ls Northstar.Client/mod/resource/*.txt) + files=$(ls Northstar.Client/mod/resource/northstar_client_localisation_*.txt) IFS=$'\n'; files=($files); unset IFS; ! file --mime "${files[@]}" | grep -v "charset=utf-16le" diff --git a/Northstar.Client/mod/resource/Lato-Regular.ttf b/Northstar.Client/mod/resource/Lato-Regular.ttf new file mode 100644 index 00000000..adbfc467 Binary files /dev/null and b/Northstar.Client/mod/resource/Lato-Regular.ttf differ diff --git a/Northstar.Client/mod/resource/NorthstarMono.ttf b/Northstar.Client/mod/resource/NorthstarMono.ttf new file mode 100644 index 00000000..2814eee6 Binary files /dev/null and b/Northstar.Client/mod/resource/NorthstarMono.ttf differ diff --git a/Northstar.Client/mod/resource/fontfiletable.txt b/Northstar.Client/mod/resource/fontfiletable.txt new file mode 100644 index 00000000..b4238134 --- /dev/null +++ b/Northstar.Client/mod/resource/fontfiletable.txt @@ -0,0 +1,40 @@ +FontFileTable +{ + "Default" "resource/MetronicPro-Regular.vfont" [!$JAPANESE && !$TCHINESE] + "Default" "resource/NotoSansJP-Regular.vfont" [$JAPANESE] + "Default" "resource/NotoSansTC-Regular.vfont" [$TCHINESE] + + "DefaultBold" "resource/MetronicPro-SemiBold.vfont" [!$JAPANESE && !$TCHINESE] + "DefaultBold" "resource/NotoSansJP-Regular.vfont" [$JAPANESE] + "DefaultBold" "resource/NotoSansTC-Regular.vfont" [$TCHINESE] + + "Titanfall" "resource/Titanfall-Regular.vfont" [!$JAPANESE && !$TCHINESE && !$RUSSIAN] + "Titanfall" "resource/NotoSansJP-Regular.vfont" [$JAPANESE] + "Titanfall" "resource/NotoSansTC-Regular.vfont" [$TCHINESE] + "Titanfall" "resource/MetronicPro-SemiBold.vfont" [$RUSSIAN] + + "marlett" "vgui/fonts/marlett.ttf" + + // Everything below is DONOTSHIP / Dev only + + "arial unicode ms" "resource/Lato-Regular.ttf" + + "lucida console" "resource/NorthstarMono.ttf" [$PC] + "lucida console" "resource/MetronicPro-Regular.vfont" [$GAMECONSOLE] + + "tahoma" "fonts\\tahoma.ttf" [$PC] + "tahoma" "resource/MetronicPro-Regular.vfont" [$GAMECONSOLE] + + "tahoma bold" "fonts\\tahomabd.ttf" [$PC] + "tahoma bold" "resource/MetronicPro-SemiBold.vfont" [$GAMECONSOLE] + + "courier new" "fonts\\cour.ttf" [$PC] + "courier new" "vgui/fonts/cour.ttf" [$GAMECONSOLE] + + "times new roman" "fonts\\times.ttf" [$PC] + "times new roman" "vgui/fonts/times.ttf" [$GAMECONSOLE] + + "arial" "resource/Lato-Regular.ttf" + "arial bold" "resource/Lato-Regular.ttf" + "arial narrow" "resource/Lato-Regular.ttf" +} -- cgit v1.2.3