Scaling issue with slate text

I’m not certain if this is a bug or an expected side effect of DPI scaling. I’m using the Font Measure Service to right align my text in the images below, with the width of the space available to draw the text in determined by the largest X extent among the labels.


The first image is at 1:1 scale and is flush. If I zoom in on the canvas to +1 scale, some of the labels remain flush whilst others are not. It seems that the size the text is actually drawn at does not match up precisely with the size returned by the font measuring. This effect does not get more pronounced as I zoom further in or out - it just fluctuates slightly between each zoom level.

Hello kamrann,

This is working as intended text does not zoom linearly, it can’t because of kerning and pixel snapping. You could try adjusting your anchors and or changing the aliment of your text. I hope that this information helps.

Make it a great day

Hi Rudy.
Right the non-linear zooming makes a lot of sense. To clarify though, I’m drawing this text at a fairly low level in Slate code (they are not STextBlock widgets) so I can’t fix this with anchors or alignment.

I’ve just done a test though with right-aligned text blocks in a vertical box, and it remains flush regardless of zoom. So clearly it is possible. I’ll look into how STextBlock alignment is implemented, perhaps I was misusing the text measure service.