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

Font Fallback breaks text alignment #2

Open
Clancey opened this issue Nov 18, 2019 · 2 comments
Open

Font Fallback breaks text alignment #2

Clancey opened this issue Nov 18, 2019 · 2 comments

Comments

@Clancey
Copy link
Contributor

Clancey commented Nov 18, 2019

Right now the current logic, is spaces uses the last Font found during the fallback. When you take into a string like Ride the Comet! ☄️ with even spaces on each side, the spacing is being used to help with padding. It should still properly center, however Emoji character spaces are a lot larger than say Helvetica.

I propose the line should be changed to RunFace = typeface;

@Gillibald
Copy link

The logic should just find a matching typeface for missing character to glyph mappings. Everything else should use the original typeface.

@toptensoftware
Copy link
Owner

toptensoftware commented Nov 19, 2019

There are a couple of issues here that are affected by this logic.

In general I agree with @Gillibald however this was specifically was trying to prevent breaking a sequence of words that all require font replacement into separate font runs and thereby introducing a (probably redundant) font switch at each word boundary.

I'm not sure about replacing the spaces around emojis - seems their should be some more heuristics here but not sure what they should be.

Also, this may also affect alignment of font replacements in a fixed pitch base font. eg: see this example.

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

No branches or pull requests

3 participants