-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document coordinate system #105
Comments
Thanks for raising this, I agree we should improve the There are some docs on x coords go right, y coords go down. |
Thanks @alexheretic! I'm a bit confused though. I use |
|
So What I don't understand here is that normally when you render text, the baseline is where you start from (see e.g. in Inkscape or whatnot, you position the baseline origin when you align some text). Then each glyph is positioned relative to it (the bounding rect of the glyph's raster is expressed relative to that point, starting at |
That isn't actually determined by this crate, In glyph_brush's case glyph positions are all screen positions. You layout text at some screen position & bounds and the glyph screen positions are calculated. Where the baselines end up depends on the |
Ok I think I start to understand. I'm looking at Bevy's code and there it passes the text justification as the |
Hmm glyph_brush h_align & v_align both affect single or multiline layouts as documented. They affect where the bounds go too. I can't help with how bevy uses it though. |
I added new docs in f6eb81a let me know if you have further suggestions |
Hi-
Could you please document the coordinate system? I'm trying to figure out how to use
Glyph::position
, and the values coming out of the call make sense horizontally but not vertically. I assume there's a subtlety like the Y position being the distance from the current origin (pen position) to the top of the glyph (so, maybe equal to the ascent?), but that would mean that Y is upward, whileRect::min
is documented as being the top left corner, hinting at Y being downward.Thanks!
The text was updated successfully, but these errors were encountered: