diff --git a/Content.Client/Resources/ResourceCacheExtensions.cs b/Content.Client/Resources/ResourceCacheExtensions.cs index 3f381216f1..cb0626c128 100644 --- a/Content.Client/Resources/ResourceCacheExtensions.cs +++ b/Content.Client/Resources/ResourceCacheExtensions.cs @@ -27,5 +27,23 @@ namespace Content.Client.Resources { return cache.GetFont(new ResourcePath(path), size); } + + public static Font GetFont(this IResourceCache cache, ResourcePath[] path, int size) + { + var fs = new Font[path.Length]; + for (var i = 0; i < path.Length; i++) + fs[i] = new VectorFont(cache.GetResource(path[i]), size); + + return new StackedFont(fs); + } + + public static Font GetFont(this IResourceCache cache, string[] path, int size) + { + var rp = new ResourcePath[path.Length]; + for (var i = 0; i < path.Length; i++) + rp[i] = new ResourcePath(path[i]); + + return cache.GetFont(rp, size); + } } } diff --git a/Content.Client/Stylesheets/StyleBase.cs b/Content.Client/Stylesheets/StyleBase.cs index 2193afe523..5804d39134 100644 --- a/Content.Client/Stylesheets/StyleBase.cs +++ b/Content.Client/Stylesheets/StyleBase.cs @@ -41,8 +41,26 @@ namespace Content.Client.Stylesheets protected StyleBase(IResourceCache resCache) { - var notoSans12 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 12); - var notoSans12Italic = resCache.GetFont("/Fonts/NotoSans/NotoSans-Italic.ttf", 12); + var notoSans12 = resCache.GetFont + ( + new [] + { + "/Fonts/NotoSans/NotoSans-Regular.ttf", + "/Fonts/NotoSans/NotoSansSymbols-Regular.ttf", + "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" + }, + 12 + ); + var notoSans12Italic = resCache.GetFont + ( + new [] + { + "/Fonts/NotoSans/NotoSans-Italic.ttf", + "/Fonts/NotoSans/NotoSansSymbols-Regular.ttf", + "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" + }, + 12 + ); var textureCloseButton = resCache.GetTexture("/Textures/Interface/Nano/cross.svg.png"); // Button styles. diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index e9131c96d0..55359940fd 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -18,6 +18,27 @@ using static Robust.Client.UserInterface.StylesheetHelpers; namespace Content.Client.Stylesheets { + public static class ResCacheExtension + { + public static Font notoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false) + { + var ds = display ? "Display" : ""; + var sv = variation.StartsWith("Bold") ? "Bold" : "Regular"; + return resCache.GetFont + ( + // Ew, but ok + new [] + { + $"/Fonts/NotoSans{ds}/NotoSans{ds}-{variation}.ttf", + $"/Fonts/NotoSans/NotoSansSymbols-{sv}.ttf", + "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" + }, + size + ); + + } + + } public sealed class StyleNano : StyleBase { public const string StyleClassBorderedWindowPanel = "BorderedWindowPanel"; @@ -88,19 +109,19 @@ namespace Content.Client.Stylesheets public StyleNano(IResourceCache resCache) : base(resCache) { - var notoSans10 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 10); - var notoSansItalic10 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Italic.ttf", 10); - var notoSans12 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 12); - var notoSansItalic12 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Italic.ttf", 12); - var notoSansBold12 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Bold.ttf", 12); - var notoSansBoldItalic12 = resCache.GetFont("/Fonts/NotoSans/NotoSans-BoldItalic.ttf", 12); - var notoSansDisplayBold14 = resCache.GetFont("/Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf", 14); - var notoSansDisplayBold16 = resCache.GetFont("/Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf", 16); - var notoSans15 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 15); - var notoSans16 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 16); - var notoSansBold16 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Bold.ttf", 16); - var notoSansBold18 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Bold.ttf", 18); - var notoSansBold20 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Bold.ttf", 20); + var notoSans10 = resCache.notoStack(size: 10); + var notoSansItalic10 = resCache.notoStack(variation: "Italic", size: 10); + var notoSans12 = resCache.notoStack(size: 12); + var notoSansItalic12 = resCache.notoStack(variation: "Italic", size: 12); + var notoSansBold12 = resCache.notoStack(variation: "Bold", size: 12); + var notoSansBoldItalic12 = resCache.notoStack(variation: "BoldItalic", size: 12); + var notoSansDisplayBold14 = resCache.notoStack(variation: "Bold", display: true, size: 14); + var notoSansDisplayBold16 = resCache.notoStack(variation: "Bold", display: true, size: 16); + var notoSans15 = resCache.notoStack(variation: "Regular", size: 15); + var notoSans16 = resCache.notoStack(variation: "Regular", size: 16); + var notoSansBold16 = resCache.notoStack(variation: "Bold", size: 16); + var notoSansBold18 = resCache.notoStack(variation: "Bold", size: 18); + var notoSansBold20 = resCache.notoStack(variation: "Bold", size: 20); var windowHeaderTex = resCache.GetTexture("/Textures/Interface/Nano/window_header.png"); var windowHeader = new StyleBoxTexture { diff --git a/Content.Client/Stylesheets/StyleSpace.cs b/Content.Client/Stylesheets/StyleSpace.cs index 6cfb8c78d1..ef3713fb34 100644 --- a/Content.Client/Stylesheets/StyleSpace.cs +++ b/Content.Client/Stylesheets/StyleSpace.cs @@ -27,8 +27,26 @@ namespace Content.Client.Stylesheets public StyleSpace(IResourceCache resCache) : base(resCache) { - var notoSans10 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 10); - var notoSansBold16 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Bold.ttf", 16); + var notoSans10 = resCache.GetFont + ( + new [] + { + "/Fonts/NotoSans/NotoSans-Regular.ttf", + "/Fonts/NotoSans/NotoSansSymbols-Regular.ttf", + "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" + }, + 10 + ); + var notoSansBold16 = resCache.GetFont + ( + new [] + { + "/Fonts/NotoSans/NotoSans-Bold.ttf", + "/Fonts/NotoSans/NotoSansSymbols-Regular.ttf", + "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" + }, + 16 + ); var progressBarBackground = new StyleBoxFlat { diff --git a/Resources/Fonts/NotoSans/NotoSansSymbols-Bold.ttf b/Resources/Fonts/NotoSans/NotoSansSymbols-Bold.ttf new file mode 100644 index 0000000000..e0db7a7d28 Binary files /dev/null and b/Resources/Fonts/NotoSans/NotoSansSymbols-Bold.ttf differ diff --git a/Resources/Fonts/NotoSans/NotoSansSymbols-Regular.ttf b/Resources/Fonts/NotoSans/NotoSansSymbols-Regular.ttf new file mode 100644 index 0000000000..81fce92ac6 Binary files /dev/null and b/Resources/Fonts/NotoSans/NotoSansSymbols-Regular.ttf differ diff --git a/Resources/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf b/Resources/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf new file mode 100644 index 0000000000..5119ca60f2 Binary files /dev/null and b/Resources/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf differ