/ go Public
Face.Kern always returns the same value
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
I parsed the
arial.ttffont on my Windows 10 machine and attempted to use the
Face.Kernmethod to adjust the horizontal position of some glyphs as I rendered them.
What did you expect to see?
I expected to see
Face.Kernreturn a different value based on the size of the font face being used.
What did you see instead?
I always see the same number for a given pair of characters being returned regardless of the size of the font face being used.
I'm not sure if this is intended or not, but given that other methods on
Face, for example,
GlyphBounds, return different values based on the size of the face being used, I assumed that
Face.Kernshould do the same.
I brought this up as an issue here: hajimehoshi/ebiten#1671, where @hajimehoshi pointed out that it's being used without any additional scaling here: https://cs.opensource.google/go/x/image/+/775e3b0c:font/font.go;l=228;drc=3f4726a040e860b3702c9dab9e3b94cad413328f, which also leads me to believe that
Face.Kernalways returning the same number for a given pair of glyphs isn't the expected behaviour.
As can be seen in my linked issue in the Ebiten repo, my current workaround is to scale it myself:
I'm not sure if this is actually an accurate way to do it since I don't know much about fonts myself, but it seems to work for me for now.
If this is actually the intended behaviour then a bit more documentation explaining that it needs to be scaled by the user would be helpful, but based on what I've seen so far I'm guessing this is actually a bug.
The text was updated successfully, but these errors were encountered: