Skip to content

Commit

Permalink
hidden text hack for early font loading
Browse files Browse the repository at this point in the history
Doesn't ensure that the font is loaded before shields start generating,
but makes it more likely
  • Loading branch information
zekefarwell committed Oct 9, 2023
1 parent e2ecdcc commit 3c71625
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
</head>

<body>
<p style="font-family: 'Encode Sans Condensed'; font-weight: 500; visibility: hidden">
Invisible text so the font will load early
</p>
<div id="map"></div>
<div id="attribution-logo"></div>
<a href="https://github.com/ZeLonewolf/openstreetmap-americana/"
Expand Down
2 changes: 1 addition & 1 deletion src/shieldtest.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</thead>
</table>

<p style="font-family: Overpass; visibility: hidden">
<p style="font-family: 'Encode Sans Condensed'; font-weight: 500; visibility: hidden">
Invisible text so the font will load early
</p>
<div id="map" style="display: none"></div>
Expand Down

0 comments on commit 3c71625

Please sign in to comment.