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 Order for Clarity #12

Closed
crhallberg opened this issue Mar 27, 2023 · 5 comments
Closed

Font Order for Clarity #12

crhallberg opened this issue Mar 27, 2023 · 5 comments

Comments

@crhallberg
Copy link
Contributor

I wonder if it would be useful to order the fonts in a consistent way, perhaps by operating system market share.

For example, Android is the most common OS, so put Android-targeting fonts first. I think this would make it clear which fonts are most-likely to be used when styling with a particular stack. I don't think it'll have any meaningful performance impacts.

Happy to do a PR if I can help! Just a thought. Love the project very much!

@danklammer
Copy link
Contributor

danklammer commented Apr 2, 2023

This is a great idea in theory, but there are issues as the order matters for priority and how android names their fonts.

Android uses a lot of generic aliases for the very limited fonts that are available. If we were to use these first the it would default to fonts that are less than ideal for everyone else (since it comes first).

For example, if we were to format the stack use by popularity first for the Transitional stack:
font-family: serif, 'Sitka Text', Charter, Cambria, 'Bitstream Charter';
(Android, Windows 10, MacOS/iOS, Windows 7, Linux)

While Android would be correct, all other OSs would likely render Times New Roman.

Another miss by sorting by popularity is that users that installed the better font is missing out. Charter is the best font (subjectively) in this stack—it's free and could be manually installed by a user.

@crhallberg
Copy link
Contributor Author

Understood! Subjectivity is a perfectly valid way to sort these! In case this comes up in the future, I would recommend that generics like "serif" be at the end for the exact reason you said - almost anything is better than Times New Roman.

@brycewray
Copy link

One note about Charter (not Bitstream Charter): at least as of this writing, the version currently supplied with macOS has oddly wide letter-spacing with the   character so, if one regularly uses that character manually to prevent unfortunate line breaks, using Charter might not be advisable.

@danklammer
Copy link
Contributor

@brycewray Wow — that is really unfortunate and odd. Thank you for calling this out. I just tested and can verify. I hate to throw this option away knowing it's such a great typeface otherwise. I will definitely add to the README, and decide if is a dealbreaker.

Less than ideal, but a fix is to use two narrow non-breaking space instead of the one non-breaking space:
https://codepen.io/danklammer/pen/VwqbNPx?editors=1100

charter-non-break-spaces

@tomdai
Copy link

tomdai commented Oct 13, 2023

Firefox on macOS renders two narrow non-breaking spaces wider than a normal space.

Screenshot 2023-10-13 at 13 37 41@2x

Found another workaround though: wrapping the space ( ) with zero width spaces (​).

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

4 participants