#How to use the default font/is there a default font?

2 messages · Page 1 of 1 (latest)

light panther
#

I'm just trying to write some simple debug strings using DrawString. For the font I'm using new SystemFont() because I couldn't really find anything else, and because it works fine, however I'm getting an error every time the string is drawn. Is this normal, and should I be using something else instead?

This is the error btw ```
E 0:00:30:0885 Godot.NativeInterop.NativeFuncs.generated.cs:88 @ void Godot.NativeInterop.NativeFuncs.godotsharp_internal_refcounted_disposed(IntPtr , IntPtr , Godot.NativeInterop.godot_bool ): Disconnecting nonexistent signal 'changed', callable: Font::_invalidate_rids.
<C++ Error> Condition "!s->slot_map.has(*p_callable.get_base_comparator())" is true.
<C++ Source> core/object/object.cpp:1331 @ _disconnect()
<Stack Trace> Godot.NativeInterop.NativeFuncs.generated.cs:88 @ void Godot.NativeInterop.NativeFuncs.godotsharp_internal_refcounted_disposed(IntPtr , IntPtr , Godot.NativeInterop.godot_bool )
GodotObject.base.cs:117 @ void Godot.GodotObject.Dispose(Boolean )
GodotObject.base.cs:80 @ void Godot.GodotObject.Finalize()

hushed forge
#

I haven't tested, but it seems like you may be able to use the ThemeDB constant to get the inbuilt one.

var defaultFont = ThemeDB.FallbackFont
DrawString(defaultFont, ...)