Skip to content
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

Take negative left offset into account when forming SDF #34

Open
mourner opened this issue Feb 23, 2021 · 0 comments
Open

Take negative left offset into account when forming SDF #34

mourner opened this issue Feb 23, 2021 · 0 comments
Labels

Comments

@mourner
Copy link
Member

mourner commented Feb 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant