Loading fonts causes panic
I encountered a panic while loading "Microsoft YaHei.ttf"
thread 'main' panicked at 'Vertical fonts are not supported', C:\Users\pc\.cargo\registry\src\index.crates.io-6f17d22bba15001f\macroquad-0.3.26\src\text.rs:92:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
just tested this and the mentioned font seems to load and work with no problems when the panic on text.rs:83, is commented out, even with chinese characters.
@not-fl3 any reasons this panic should be kept? any other vertical fonts that don't work?
just tested this and the mentioned font seems to load and work with no problems when the panic on text.rs:83, is commented out, even with chinese characters.
I do not not enough about vertical fonts, but I assume that they should be rendered vertically (draw_text should draw a label with each symbol above/beyound each other, not left to right).
So I would keep this panic on until the correct vertical rendering would be fixed.
I don't know enough about fonts to say too much about this, but my guess is that advance_height being non-zero doesn't mean the font is "vertical", it just means that it has the potential to be rendered vertically. Chinese characters are quite commonly used in both horizontal and vertical writing, so it makes sense that a font would try to support both styles. So I think ignoring it, or maybe logging a warning or something, is preferable to panicking here (a lot of chinese/japanese fonts have advance_height set, so it's pretty much impossible to render even just horizontal text in those languages using macroquad right now without forking)
I'm running into this issue trying to load an ordinary Noto Sans CJK font from my system's font path - trying to open the .ttc file at all causes this panic, even though I want to render fonts horizontally.
Bit annoying to have to vendor and invasively modify the source code just to be able to use NotoSansJP on here. There's no reason to panic this if the API only supports left-to-right (horizontal layout) writing to begin with, which said fonts will work fine with anyway.
https://freetype.org/freetype2/docs/glyphs/glyphs-3.html
I have raised #913 to address at least my current use case for vertical font rotation.