-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,10 @@ pub struct Glyph { | |
/// Pixel scale of this glyph. | ||
pub scale: PxScale, | ||
/// Position of this glyph. | ||
/// | ||
/// Horizontally this is to the left of the glyph before applying | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
alexheretic
Author
Owner
|
||
/// `h_advance` or `h_side_bearing`. Vertically this is at the "baseline". | ||
/// See [glyph layout concepts](trait.Font.html#glyph-layout-concepts). | ||
pub position: Point, | ||
} | ||
|
||
|
The formulation is still not clear to me. Saying "the position is at the baseline" is confusing I think. A position is the offset of something relative to the origin of the coordinate system.
My understanding is that:
OutlineGlyph::px_bounds
is the position of the top left corner of the glyph's raster bounding rectangle relative to what I call the "pen position", which is the point on the baseline used as reference before applying e.g. the advance. (this would be the top row in the diagram below)Glyph::position
as returned byglyph_brush_layout::Layout
is the position of that "pen position" origin (and therefore, the position of the baseline) relative to a reference point which depends onHorizontalAlign
andVerticalAlign
, and can be called the "rendering point". (this would be the bottom row in the diagram below; the origin depends on the alignment)