Font fallbacks.
This commit is contained in:
3
TestGame/Resources/fonts/default.fontset.toml
Normal file
3
TestGame/Resources/fonts/default.fontset.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[FontSet]
|
||||
|
||||
fonts = ["Inter-Regular.ttf", "NotoSansJP-Regular.ttf"]
|
||||
@@ -54,6 +54,8 @@ public class TestGame : Game
|
||||
{
|
||||
throw new Exception("Failed to load emitter settings!");
|
||||
}
|
||||
|
||||
_defaultFontSet = new([_font, _jpFont]);
|
||||
}
|
||||
|
||||
protected override void Ready()
|
||||
@@ -78,7 +80,7 @@ public class TestGame : Game
|
||||
|
||||
if (Input.IsActionPressed("accept"))
|
||||
{
|
||||
_container.AddChild(new Label("こんにちは世界!", _jpFont));
|
||||
_container.AddChild(new Label("こんにちは世界!", _defaultFontSet));
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("cancel") && _container.Children.Count != 0)
|
||||
@@ -126,6 +128,9 @@ public class TestGame : Game
|
||||
private ResourceRef<ParticleEmitterSettingsResource> _fireEffect;
|
||||
private ResourceRef<Font> _font;
|
||||
private ResourceRef<Font> _jpFont;
|
||||
|
||||
private FontSet _defaultFontSet;
|
||||
|
||||
private ResourceRef<Sound> _sound;
|
||||
private ResourceRef<Texture2d> _icon;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user