EriKWDev / nanim

Nanim is an easy-to-use framework to create smooth GPU-accelerated animations that can be previewed live inside a glfw window and, when ready, rendered to videos at an arbitrary resolution and framerate.
MIT License
119 stars 3 forks source link

Fonts load but no text shown #13

Closed JorySchossau closed 2 years ago

JorySchossau commented 2 years ago

I'm just trying to run the demo code from the frontpage readme. The debug output says the ttf font is being loaded (I had to make a fonts/ dir). But there's no text displayed.

Linux Nim 1.6.0 nanim default nimble & head

JorySchossau commented 2 years ago

Turns out this is a bug in how fonts are loaded. All is fine if I make all font names specified as lowercase in the load function call. The font file has uppercase letters, but loading specifying all lowercase make loading work okay.

EriKWDev commented 2 years ago

Thanks for reporting and for the PR!

15 is probably an OK fix.

It stems from the fact that I make it lowercase (https://github.com/EriKWDev/nanim/blob/eb039590379d9130cecb2a94129e4dbc2b09e35f/src/nanim/core.nim#L1119) and indeed don't enforce that on the user input side.