-
Notifications
You must be signed in to change notification settings - Fork 56
Description
It’s not clear from the documentation which coordinate system Glyph.y uses.
On one hand, it appears to be defined in the glyph coordinate system, where the origin is at the bottom-left and Y points upwards. Several references seem to support this:
-
parley/examples/swash_render/src/main.rs
Line 254 in e581c08
let glyph_y = run_y - glyph.y + (padding as f32); -
parley/examples/tiny_skia_render/src/main.rs
Line 175 in e581c08
let glyph_y = run_y - glyph.y + padding as f32; -
More importantly,
, which indicates that Parley follows the coordinate conventions defined by HarfRust.parley/parley/src/layout/data.rs
Line 754 in e581c08
y: (glyph_pos.y_offset as f32) * scale_factor,
On the other hand, some parts of the code suggest that it might instead use a screen coordinate system (origin at the top-left, Y downwards):
parley/parley/src/layout/line.rs
Line 231 in e581c08
g.y += baseline;
My local experiments also seem to suggest that the Glyph.y is defined in the former coordinate system. Then, is the latter a bug?