coollabsio / fonts

A privacy-friendly drop-in replacement for Google Fonts
https://fonts.coollabs.io
Apache License 2.0
405 stars 14 forks source link

Loading multiple fonts at once with display swap not working #17

Open jploch opened 8 months ago

jploch commented 8 months ago

This works: https://api.fonts.coollabs.io/css2?family=Space+Grotesk&family=Space+Mono&family=Aguafina+Script&family=Audiowide

This doesn't (only returning some fonts): https://api.fonts.coollabs.io/css2?family=Space+Grotesk&family=Space+Mono&family=Aguafina+Script&family=Audiowide&display=swap

andrasbacsai commented 8 months ago

I see all the fonts with the swap option. What is missing or incorrect?

jploch commented 8 months ago

Not sure if it's a cache thing on my end. The first link is returning all fonts correctly but the second link is only returning "Space Grotesk". I had some issues when adding the display=swap parameter with other links as well.

andrasbacsai commented 8 months ago

image

Can you please check it now? I purged the cache.

jploch commented 8 months ago

Thanks for looking into it! Now it works correctly. Is there a way to add cache busting to the request url?

sudomistress commented 2 months ago

Ran into the same issue. In my case when using https://api.fonts.coollabs.io/css2?family=Kiwi+Maru&family=Stick&display=swap. When I looked at the result, I only saw Kiwi Maru.

Shown Here: image

I swapped the order thinking it would show me Stick using https://api.fonts.coollabs.io/css2?family=Stick&family=Kiwi+Maru&display=swap and it gave me Stick only and not Kiwi Maru.

Shown here: image

However, if I made the font "Stick" lowercase, it works. So https://api.fonts.coollabs.io/css2?family=stick&family=Kiwi+Maru&display=swap works.

Shown here: image

Not sure if this helps, but wanted to add this in case it helps narrow down the issue.