typekit / webfontloader

Web Font Loader gives you added control when using linked fonts via @font-face.
Apache License 2.0
9.23k stars 649 forks source link

Google Fonts Text subsetting #367

Open RedLucas opened 7 years ago

RedLucas commented 7 years ago

Hey, so I'm referring specifically to the Text parameter in https://github.com/typekit/webfontloader#google.

I noticed that it is being added separate from the families. I was wondering if it would be worth it to have a way to attach it right to the families themselves.

The use-case is as follows:

Let's say I have a select field (let's say I'm using something like Select2 to display the actual list) and it is displaying a list of Google fonts.

I'd love to be able to use the webfont.js api to load all these fonts, but only the characters of each font's labels.

This way you get a nice select field with each item using it's own font. A nice user experience in my opinion.

But ya, long story short, I don't see a way to use the Webfontloader for this at the moment.

RedLucas commented 7 years ago

You know I'd actually consider tackling this problem myself if it's something others agree should be changed... I need the FontApiUrlBuilder.prototype.build that probably just needs some adjustments.

RedLucas commented 7 years ago

If that text parameter is an array, perhaps map it to the same index's font family from the families parameter?

quicoto commented 6 years ago

Yeah I agree. Here's another use case:

1) Font 1 = for title title text 2) Font 2 = for rest of body text

I imagine we would see a load improvement if we were to load Font 1 with just the needed text, and not the whole subset.

stedwick commented 6 years ago

+1