Closed themancalledjakob closed 1 year ago
Which font needs its Y-axis inverted? I've never seen one before.
Thank you for the reply.
You're right, the font does not need an inverted Y-axis. The error must be in the way that I'm handling the atlas later. When I create an atlas with the same font using standalone msdf-atlas-gen, the Y-axis is fine. This is a bit embarrassing, I should have checked that before. Thank you anyways for having a look.
I'll close this now.
When generating the atlas with some fonts, I need to set
inverseYAxis
totrue
, but I cannot find a way to do this without removingconst
fromGlyphGeometry
'sgetShape()
function. My intuition tells me, that there is a good reason for const here, and it shouldn't just be removed. Another option would be to const_cast the shape. This also feels weird, but has the advantage that nothing would have to be changed in this repository.To clarify, here how I do it:
Is there a better way? If not, what about either an additional non-const function for getShape, or an additional inverseYAxis parameter when loading the glyphs in
FontGeometry::loadCharset
andGlyphGeometry::load
?I assume I am not the only one running into this, but if you think const_casting is fine, feel free to simply close this issue. Otherwise I'm happy to send you a PR, or, if there is a better way to do this I would greatly appreciate a pointer in the right direction.