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 shield font to Noto Sans Condensed #965

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

claysmalley
Copy link
Member

Fixes #834

Based on discussion in #954, Noto Sans Condensed satisfies all our needs, and matches the existing style. This PR changes the shield font to Noto Sans Condensed, and updates various shield definitions to accommodate the change.

I've set up a repository for web fonts at osm-americana/web-fonts. If we want to support route networks that incorporate other scripts like Georgian and Arabic, we'll need to add their corresponding fonts.

@claysmalley claysmalley marked this pull request as ready for review October 18, 2023 00:28
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with a JS-drawn trapezoid. I probably should have done this in #585, honestly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with a JS-drawn escutcheon. It was either that, or vertically stretch the SVG.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visually identical to the 'deleted' shield_ca_tch.svg. Drawn in a different way to make widening easier.

Copy link
Member

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shield definition changes look great to me at a glance. Thanks for facilitating the discussion around choosing a font. I haven’t heard much enthusiasm for continuing to rely on system fonts, so at least we can standardize on this font while we pursue further improvements either to the font selection or to metrics in #768.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to adjust the Americana project’s logo given these changes? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Korean expressway shield bulges out in a different way. I think our logo is fine 😅

Comment on lines +101 to +109
<p
style="
font-family: 'Noto Sans Condensed';
font-weight: 500;
visibility: hidden;
"
>
Invisible text so the font will load early
</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add any aural CSS properties or an ARIA role to avoid exposing this text to assistive technology?

/ref #768 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure there must be a way to ensure the font is loaded before the first shield is rendered without relying on a hidden text hack.

src/js/shield_defs.js Outdated Show resolved Hide resolved
src/js/shield_defs.js Outdated Show resolved Hide resolved
src/shieldtest.js Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two-digit Interstate shields are massively improved. I would consider #834 to be fixed. We’re still fitting the text to the shield a bit too pedantically. For example, the 7 and 1 in I-71 conspire to gain an extra point or two compared to I-65. However, this discrepancy is much less glaring than before.

Louisville Erlanger

Unfortunately, the text metrics are still a mess in Safari: #625. But at least it remains usable:

Safari

src/fonts.css Show resolved Hide resolved
Comment on lines +6 to +7
<link rel="preconnect" href="https://osm-americana.github.io" />
<link href="fonts.css" rel="stylesheet" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the #955 (comment) still possible, but less likely? Or should we continue to investigate a JavaScript-based alternative to the CSS stylesheet that can respond to font loading events?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still possible. I'm probably not going to include it in this PR, but it may be useful as tail work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes still possible. Try shield test with browser cache disabled and you'll see a fallback font for the first few rows.

src/fonts.css Outdated Show resolved Hide resolved
@claysmalley claysmalley merged commit f300ab7 into main Oct 18, 2023
4 checks passed
@claysmalley claysmalley deleted the clay-shields-fonts-noto branch October 18, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two-digit Interstate shields are too wide
4 participants