Closed antonok-edm closed 4 years ago
Yes, I have noticed this too.
However, wgpu_glyph
doesn't contain any positioning/measurement logic. This logic lives in glyph-brush
, a direct dependency.
A new glyph-brush
version was released a couple of days ago, and I believe it may fix this. I will try to update the dependency this week. If it doesn't fix the problem, we should file an issue in glyph-brush
.
I tested it and this seems to be fixed by #43. Let me know!
Awesome! I just tried it out and everything appears as expected now :smile:
It appears that the choice of anchor point for text positioning depends on the actual width of the text in pixels rather than the width of the glyphs. In general this is hard to notice, but it definitely causes issues with monospaced/fixed width fonts that are dynamically updated. For instance, consider a simple counter app, where the text of the current count is positioned with the following
Layout
:When the rightmost character of the text updates from a wide character (e.g.
0
) to a narrow character (e.g.1
) or vice versa, there is a noticeable horizontal shift in the rest of the characters on the left.