The Font class has the constructor Font(byte[] data). That would be extremely useful for loading a Font from a file. However, when creating the object, providing the byte array from the file (a tinyfnt file, of course), the instance seems of Font type, but it doesn’t behave as a font and cannot be used, since the properties throw an ArgumentException.
Sounds a bug. Or am I missing something?
The problem as explained is not clear to me…
First, if you load the font file as a resource does it work okay?
Yes, loading fonts from embedded resources is working fine. The problem is that my fonts are too large to be all embedded, so I need to somehow load them from a file.
I tried by loading the byte array, and passing it to the Font constructor. But it’s very likely that it’s not supposed to get the tiny font binary as it is. It makes sense but… wondering about the use case of that constructor, now.
I did not mean embedded fonts in general. I meant the specific font that seems to have a problem.
You need to determine if the problem is with the firmware or with the specific font.
Have you tried to load smaller fonts from a file?
Is there anything different about this font that might provide a clue?
All of the said fonts (Noto for Chinese, in different sizes) work fine when embedded.
Not tried with smaller fonts but before wasting time with further testing, it would be great to know if the Font.Load constructor is supposed to get the binary of the tinyfnt as it is, because I now strongly doubt that it is the case.