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

Change default pixel scaling method #15

Open
alexheretic opened this issue Aug 6, 2020 · 2 comments
Open

Change default pixel scaling method #15

alexheretic opened this issue Aug 6, 2020 · 2 comments
Labels
breaking-change A change that would require a breaking semver bump

Comments

@alexheretic
Copy link
Owner

The current PxScale method was inherited from rusttype and defines the pixel height of glyphs in pixels. There are different ways that users would expect this work.

My current thoughts:

  • I don't want multiple px scale concepts inside ab-glyph. One is ok, and you should be able to convert that to any other.
  • Changing how it's done would clearly be breaking.
  • It would be nice to handle this in the least surprising & most common way as default.

Related: #11, #14

@TakWolf
Copy link

TakWolf commented Sep 2, 2020

A possible reference:

96px in fontforge(left), chrome(center) and ab-glyph(right, scale_factor = px / font.units_per_em())

image
image

@LoganDark
Copy link

LoganDark commented Jun 11, 2022

font-size should be in pixels-per-em. If users want something else they can do the calculations themselves from metrics in the head/os2 tables (not sure if ab_glyph exposes these)

for example, I use cap-height to size UI buttons. Though, I am not using ab_glyph because it does not support opentype features, but I am using ab_glyph_rasterizer which has a better API than anything else on crates.io

@alexheretic alexheretic changed the title Change default pixel scaling method? Change default pixel scaling method? (breaking) Aug 26, 2022
@alexheretic alexheretic added the breaking-change A change that would require a breaking semver bump label Apr 27, 2023
@alexheretic alexheretic changed the title Change default pixel scaling method? (breaking) Change default pixel scaling method Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that would require a breaking semver bump
Projects
None yet
Development

No branches or pull requests

3 participants