Isn't the whole point of AMP to remove unnecessary downloads? Why force a font download on people? Just provide a Georgia stack instead.
Merriweather looks much nicer than Georgia :) Plus, we're serving from a CDN so the download should be super fast.
But, overall, this is a valid point. We'll re-asses.
Merriweather looks much nicer than Georgia
:100:% subjective. Personally I like Georgia better. Merriweather has a dumb question mark.
we're serving from a CDN so the download should be super fast
Slippery slope reasoning like this was literally why AMP was invented.
I second the reasons corysimmons gave.
AMP shouldn't be unnecessarily dependent off any CDN.
Besides The extra DNS call's could easily make the AMP page run slow again when on slow network. So it totally defeats the purpose of AMP.
I suggest the usage of fontfaceobserver.
https://github.com/bramstein/fontfaceobserver
With that one can display text in Georgia and swap to Merriweather immediately after the font is downloaded.
I still think layout and design should be kept dynamic and configurable by the developer/administrator instead of being implanted in core code.
fontfaceobserver looks cool, but why are we doing _any_ fonts by default?
What if I don't want my visitors to have to download a font on their small mobile phone plan?
This is actually fairly relevant to me. I'm about to downgrade my phone plan to a bare minimum of slow data and every kb counts.
I suppose the underlying point is people are going to use the default theme for this (millions probably already are with wp.com and VIP) -- why are we adding a significant amount of download data to people by default? Just because some amp-wp designer thought Merriweather looked prettier than Georgia?
There's a big difference in data size between setting a few minimal styles for a default theme, and loading an entire font.
Let's ask the core contributors of AMP what they think.
@cramforce @dvoytenko @erwinmombay @Meggin
Do you think amp-wp's default theme should load a font that will be served to millions of websites by default because someone thinks it looks slightly prettier than a system font?
I'd recommend using amp-font to mitigate the effect of the font download on page load. This is particular important on iOS which has an infinite timeout by default (other browsers wait 3s)
One interesting usage is to set the timeout in amp-font to 0. That means that the font will only be used if it was already cached.
Not sure why you're closing this. It's a valid issue like I noted; we just haven't had a chance to work on it yet.
+1 for amp-font usage.
"One interesting usage is to set the timeout in amp-font to 0."
That's not optimal because users will rarely get to cache the fonts. The idea is to make the plugin popular so that caching of Merriweather on people's mobiles is widespread. If timeout is set to 0, nobody will have fonts-cached.
I filed a bug to update the documentation (@sriramkrish85 has that happened yet)? Timing out the font does not terminate the connection. Thus subsequent page views will have it. That is why the 0 value is so great. You never get slow down, but you do typically get the font on page view N > 1.
@cramforce,
But I think what amp-font does is it detects if fonts are loaded and adds/removes classes. And via css we can change the font-family by defining it differently for different classes. Such as if the class is loading font-family is Georgia and if the class is loaded, it is Merriweather.
So for the scenario you are thinking, even the first view can have the first paint without fonts and swapped to Merriweather when it gets loaded.
Swapping is definitely an option. That is up to you. Some people argue that
it is better UX to stick with the fallback when it was first picked.
On Wed, Mar 30, 2016 at 2:10 PM, Ramanan [email protected] wrote:
@cramforce https://github.com/cramforce,
But I think what amp-font does is it detects if fonts are loaded and
adds/removes classes. And via css we can change the font-family by defining
it differently for different classes. Such as if the class is loading
font-family is Georgia and if the class is loaded, it is Merriweather.So for the scenario you are thinking, even the first view can have the
first paint without fonts and swapped to Merriweather when it gets loaded.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/Automattic/amp-wp/issues/328#issuecomment-203637354
@cramforce no not yet - but @Meggin has promised that we would be working on it on monday.
Here is the bug to follow for the updates on the Docs: https://github.com/ampproject/docs/issues/65
I don't understand how loading Merriweather from Google Fonts actually closes this defect report. It's still loading an external asset needlessly, based off a subjective preference for Merriweather over Georgia and introducing an additional network dependency in the default configuration.
Thanks @westonruter
I too have no need for this font load, and want to remove it from the list of resources loaded. I'm using an Adobe TypeKit font which is working perfectly, but I'm still forced to have a request to get Merriweather, even though it's not used anywhere.
You should by default, just let the CSS set the font in the style.php to either serif or sans-serif and leave it at that for default.
3 years and nobody still removed it, & we thought this project cares about people's opinion.
@nabtron if you don't want Merriweather, you can use Georgia now via the following plugin code:
<?php
add_filter( 'amp_post_template_data', function( $data ) {
$data['font_urls'] = array();
return $data;
} );
add_action( 'amp_post_template_css', function() {
echo 'body { font-family: Georgia, "Times New Roman", Times, Serif; }';
} );
I'll open a PR to remove Merriweather otherwise.
is it works other amp plugins like amp for wp