Skip to content

Take negative left offset into account when forming SDF #34

@mourner

Description

@mourner

From @ChrisLoer's #33 (comment):

You mentioned that the same logic for glyphWidth "doesn't affect rendering": I think that's just because the fonts we're using typically have an actualBoundingBoxLeft that's slightly negative? So even if the resulting glyphWidth is one pixel too small, the glyph doesn't look clipped from the right because it's actually eating slightly into the buffer on the left.

Right now we're counting on that as a common property of fonts, since we hardwire the x drawing position to this.buffer, and hardwire the left metric to 0. If we're worried, it would be straightforward to hook it up to the actual metrics the way we do for height.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions