[utf8] Codepoint 2193 and 2191 do not render with cascadia-code font
Before submitting a new issue, please verify and check:
- [x] The issue is specific to Raylib-cs and not raylib
- [x] I checked there is no similar issue already reported
- [x] My code has ~no~ errors or misuse of Raylib-cs
Issue description
[20:16] SW_CreeperKing: i mean i think theres one more bug :D 2 characters will render as _ : ↓ and ↑ im using cascadia mono, which should support the characters [20:17] SW_CreeperKing: but idk if its because they are out of range or something (2193 and 2191 respectively) [20:56] MiniJack: https://github.com/microsoft/cascadia-code this? [20:57] SW_CreeperKing: yes
Environment
raylib-cs 4.0.0
Issue screenshot
If possible, provide a screenshot that illustrates the issue. Usually an image is better than a thousand words.
Code example
TODO
I use these characters for my drop down box, terrible code: https://github.com/SWCreeperKing/RayWrapper/blob/master/RayWrapper/Objs/DropDown.cs
i am using DrawTextEx to draw the text, and for loading the font i have
private static Font LoadFont(string font, int fontSize, int toChar = 5000)
{
var f = LoadFontEx(font, fontSize, null, toChar);
SetTextureFilter(f.texture, fontFilter);
return f;
}
LoadCodepoints returns 8595 for ↓ and 8593 for ↑. So these would not be included by default loading up to 5000.
Changing to a number higher than this and I can get them to draw with Cascadia-Regular.otf.
Yep, setting it to a number greater than or equal to 8595 allows me to grab them! I thought it went based off of unicode.
The issue is that if we set toChar to a higher number by default, it may take a lot longer to load the font, which is not a great user experience
You can also use LoadFontEx and pass in just the codepoints you want. I made a few fixes when testing this that will be in the next release.