Skip to content

Is Glyph.y described in Y up or down coordinate system? #484

@maitbayev

Description

@maitbayev

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:

  1. let glyph_y = run_y - glyph.y + (padding as f32);

  2. let glyph_y = run_y - glyph.y + padding as f32;

  3. More importantly,

    y: (glyph_pos.y_offset as f32) * scale_factor,
    , which indicates that Parley follows the coordinate conventions defined by HarfRust.

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):

  1. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions