Replies: 3 comments 2 replies
-
In this crate's inner workings, all it does is process all queued text (done through the Sadly, as you stated, there are no existing functions for applying rotations to a One way I can think of so rotations could be implemented is that each Therefore, there is no standard way to rotate a You can also try an alternative text rendering method which utilizes signed distance fields or, if you need higher quality, multi-channel signed distance fields. You can read more on it here. I'll leave this issue open in case you have some other questions or some news pop up. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I had the same idea about using two brushes and I tried it, and it works. It's not pretty because for positioning, all the x's and y's and layouts are swapped. Also I had problems with getting mirrored text (unreadable). But it does work in the end, and looks nice in the rendering. I'll just drop a comment in my code about this. I won't be looking at that much after all once it is working. Thanks for the thoughtful note! |
Beta Was this translation helpful? Give feedback.
-
I have similar issue and I am using patched wgpu_text to resolve it. In my case y axis for world is in opposite direction of assumed y axis direction in wgpu_text. (I need to flip y axis of the text) I have tried to resolve it by modifying matrix or using negative position coordinates, but it looks like to flip text (y axis) I need additional information about texture box size etc. But to resolve the issue I just modified shader to render text in needed direction. |
Beta Was this translation helpful? Give feedback.
-
Wgpu-text is working pretty well for me for standard use cases. I next tried to rotate my text, so that it reads not left-to-right but top-to-bottom; I did this to try to cram in more x-axis labels on a numerical plot that does not have enough room.
I messed around quite a bit with
update_matrix(...)
and it also works. However, the new transform seems to affect both the rendering of the font itself in addition to my other positioning commands to get the annotation in the right spot. My glyphs are also being distorted by my positioning and scaling to the clip coordinates; I want to move and rotate the glyph, but not actually change the glyph itself.I think this is because I need to rotate the glyphs independently of the positioning transform. Like maybe I need a function like
Section::with_orientation()
that is used similarly toSection::with_screen_location()
except that it transforms the glyph before the placement.Is this a good strategy? Or am I making this too hard (hopefully this is the case)? I also looked at the underlying
ab_glyph
library to see if it had any useful features that could help, but as far as I can tell the whole font rendering stack just assumes that the glyphs should be rendered to read horizontally.Am I missing a simple way to render vertically oriented fonts here?
Beta Was this translation helpful? Give feedback.
All reactions