Closed HugoJourdan closed 1 year ago
Do you have some code where that is sued? It is easier to debug if I don’t need to recreate everything.
Yes of course :
There are two things that cause this. 1) you use a scaled string drawing method in a unscaled drawing callback. You probably have realized that the text scaled strangely when you zoom. 2) You use more than one line of text. For "topleft" there is a small optimization that expects only one line and a certain font size.
I’ll cleaned the code up a bit. Should work now.
To avoid the scaling of the test, use this:
font = Glyphs.font
tab = font.currentTab
viewPort = tab.viewPort;
x = viewPort.origin.x + 10
y = viewPort.origin.y + viewPort.size.height - 10
font_size = 10.0 * tab.scale
self.drawTextAtPoint("Hello1\nHello1\nHello2", NSPoint(x, y), fontSize=font_size, align="topleft")
I don't know if the right place to report this issue but when using this in Report Plugin :
topright
andtopcenter
works, onlytopleft
don't work.