chrisdill / raylib-cs

C# bindings for raylib, a simple and easy-to-use library to learn videogames programming

Home Page:http://www.raylib.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading font from truetype with LoadFontEX() produces null characters.

Boyfinn opened this issue · comments

Issue description

I'm trying to move stuff over from Raylib and Raylib_cpp to Raylib_cs. And I've noticed that LoadFontEX(), unlike just plain LoadFont() produces null characters when implemented this way:
public static Font DebugFont = Raylib.LoadFontEx("res/fnt/_stmr.ttf",12,[2],256);
image
The font I'm using is the TrueType version of this font: https://fonts.google.com/specimen/Share+Tech+Mono

System & Environment

System:
-Linux Mint 21.3
-Kernel, 6.5.0
-Dekstop, Cinnamon 6.4.0

.NET:
-net8.0
-Raylib-cs 6.0.0

Giving the 'codepoints' parameter an empty array instead of a null pointer(in unsafe mode) or pre-defined size array seems to work. This is a bit inconsistent with the C and C++ implementations of Raylib

@Boyfinn
I don't understand your issue.

You can use this syntax to use the default codepoints:
var font = LoadFontEx("myfont.ttf", 22, null, 0);

Or this one, if you only need abc for example:
var font = LoadFontEx("myfontttf", 22, new int[] { 'a', 'b', 'c' }, 3);