These are chat archives for assetgraph/assetgraph

6th
Apr 2017
Peter Müller
@Munter
Apr 06 18:05
I just had an idea that could move us along again on the font subsetting. I see it as a big problem that our algorithm might fail, and the fallback is currently non-existant
The subset range property seems badly supported, so we can't rely on it yet
But what if I renamed the subset font and kept the original CSS around with the original urls for the full woff fonts?
Then rewrote all the font-face properties to have my renamed subset font first, then fall back to the original google font name
Andreas Lind
@papandreou
Apr 06 18:22
Hmm, interesting idea! But wouldn't that be unsafe when text content is unexpectedly injected in nodes where the modified @font-face applies?
Peter Müller
@Munter
Apr 06 18:23
Then I assume the missing chars would be gotten from the fallback (previously original) font
So at that point a http request for the google font would be triggered
I think that's the default behavior
Unless the browser doesn't detect the missing glyph and falls back
I'm asking Bram
If it works the way I hope I think this can give us the security of not breaking things horribly for people if they try it
Andreas Lind
@papandreou
Apr 06 18:53
Ah, you mean rewrite all thefont-family properties?
Peter Müller
@Munter
Apr 06 18:54
yes
font-family: 'Roboto Assetgraph Subset', 'Roboto';
Andreas Lind
@papandreou
Apr 06 19:38
Riiight... AFAIR that does fall through to the next entry when a font is available, but misses a character. Worth the shot!
Peter Müller
@Munter
Apr 06 19:53
If I can make that work I'd be ready to merge it in and expose it in the builder
Andreas Lind
@papandreou
Apr 06 19:53
Awesome!
Peter Müller
@Munter
Apr 06 19:53
Worst case, it adds a few extra bytes overhead
Andreas Lind
@papandreou
Apr 06 19:54
But it's still depending on that Java-based utility, right?
Peter Müller
@Munter
Apr 06 19:54
Right now I'm playing with something different though: https://twitter.com/_munter_/status/850066792219389953
Oh, no, I'd only merge in the google font subsetting I think
Andreas Lind
@papandreou
Apr 06 19:54
Ah, oh yeah