Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2020 Fonts chapter #1643

Merged
merged 31 commits into from Dec 8, 2020
Merged

2020 Fonts chapter #1643

merged 31 commits into from Dec 8, 2020

Conversation

raphlinus
Copy link
Contributor

This adds a first draft of text, as well as images, for the fonts
chapter.

There's quite a bit more text, including some written by Jason, that
hasn't been folded into this text. But I think it makes sense to get
this in and then propose refinements on top of it.

Closes #902

raphlinus and others added 2 commits December 5, 2020 13:09
This adds a first draft of text, as well as images, for the fonts
chapter.

There's quite a bit more text, including some written by Jason, that
hasn't been folded into this text. But I think it makes sense to get
this in and then propose refinements on top of it.

Closes #902
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2020

Images automagically compressed by Calibre's image-actions

Compression reduced images by 37.5%, saving 438.00 KB.

Filename Before After Improvement Visual comparison
src/static/images/2020/fonts/04_01.web_fonts_usage.png 91.96 KB 53.37 KB -42.0% View diff
src/static/images/2020/fonts/04_02.web_fonts_usage_by_country.png 179.35 KB 124.82 KB -30.4% View diff
src/static/images/2020/fonts/04_02.web_fonts_usage_top_countries.png 72.27 KB 45.47 KB -37.1% View diff
src/static/images/2020/fonts/04_04.web_hosting_performance_desktop.png 61.89 KB 36.51 KB -41.0% View diff
src/static/images/2020/fonts/04_04.web_hosting_performance_mobile.png 60.42 KB 36.19 KB -40.1% View diff
src/static/images/2020/fonts/04_06.font_display_performance_desktop.png 72.10 KB 44.09 KB -38.8% View diff
src/static/images/2020/fonts/04_06.font_display_performance_mobile.png 78.31 KB 49.04 KB -37.4% View diff
src/static/images/2020/fonts/04_06.usage_of_font_display.png 59.52 KB 37.20 KB -37.5% View diff
src/static/images/2020/fonts/04_07.resource_hints_performance_desktop.png 79.20 KB 49.51 KB -37.5% View diff
src/static/images/2020/fonts/04_07.resource_hints_performance_mobile.png 75.59 KB 47.20 KB -37.6% View diff
src/static/images/2020/fonts/04_07.resource_hints_use.png 69.97 KB 42.82 KB -38.8% View diff
src/static/images/2020/fonts/04_08.usage_of_unicode_range.png 62.46 KB 35.72 KB -42.8% View diff
src/static/images/2020/fonts/04_10.web_font_mime_types.png 61.12 KB 35.48 KB -42.0% View diff
src/static/images/2020/fonts/04_11a.popular_typefaces.png 86.98 KB 57.32 KB -34.1% View diff
src/static/images/2020/fonts/04_17.font-variation-settings-usage.png 58.33 KB 36.72 KB -37.1% View diff

476 images did not require optimisation.

Update required: Update image-actions configuration to the latest version before 1/1/21. See README for instructions.

@rviscomi rviscomi added the writing Related to wording and content label Dec 5, 2020
@rviscomi rviscomi added this to TODO in 2020 via automation Dec 5, 2020
@rviscomi rviscomi added this to the 2020 Content Writing milestone Dec 5, 2020
@raphlinus
Copy link
Contributor Author

Re the images, I plan to run image optimization as soon as we're confident on the images. Please review the content of the images now (a handy link is https://github.com/HTTPArchive/almanac.httparchive.org/tree/fonts/src/static/images/2020/fonts), as I think they're mostly final except for 04_11a, which is in the process of being redone.

@tunetheweb
Copy link
Member

Re the images, I plan to run image optimization as soon as we're confident on the images. Please review the content of the images now (a handy link is https://github.com/HTTPArchive/almanac.httparchive.org/tree/fonts/src/static/images/2020/fonts), as I think they're mostly final except for 04_11a, which is in the process of being redone.

Calibre does a decent enough job of optimising and has already done that for you, though I find tinypng.com does a better job.

Any chance you could rename the images to be of the format fonts-web-fonts-usage.png? Having the figure number at the beginning can be confusing if we prefer it or move about, we’ve been trying to put chapter name at the beginning rather than number, and try to use dash instead of underscore as easier to read in a URL bar.

This is mostly renaming as requested. This also uses the new "popular
typefaces" data as generated by rick.
@raphlinus
Copy link
Contributor Author

Ok, I think that latest commit renames the fonts successfully, and updates "popular fonts" and "top countries".

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2020

Images automagically compressed by Calibre's image-actions

Compression reduced images by 41%, saving 78.22 KB.

Filename Before After Improvement Visual comparison
src/static/images/2020/fonts/fonts-popular-typefaces.png 120.16 KB 69.53 KB -42.1% View diff
src/static/images/2020/fonts/fonts-web-fonts-usage-top-countries.png 70.54 KB 42.95 KB -39.1% View diff

489 images did not require optimisation.

Update required: Update image-actions configuration to the latest version before 1/1/21. See README for instructions.

src/config/2020.json Outdated Show resolved Hide resolved
This commit adds sections on WOFF (mime types generally), a paragraph on
cache partitioning, local vs external hosting, and popular fonts.
Copy link
Contributor

@svgeesus svgeesus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is very good! Some small corrections and additions in my review comments.

src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
)
}}

The single top country is South Korea, which is not all that surprising given their consistently high internet speeds and the fact that Korean (Hangul) fonts are almost an order of magnitude larger than Latin. As we'll see in the "popular typefaces" chapter, Korean fonts are two of the top 14 most popular, further evidence they really like web fonts. Web font usage in Japan and Chinese-speaking countries is considerably lower, likely because CJK fonts are even larger and connections are not as fast.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High speeds and low latency (the latter being more important as speeds drop).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"because CJK fonts are even larger" can't really say that Chinese, Japanese and Korean fonts are even larger than Korean :)

Suggest instead "because Chinese and Japanese fonts are vastly larger (the median font size being 10,000 times larger than the median Latin size).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding "This means web font usage in Japan is very low, and usage in China is effectively zero. Although recent developments may make web fonts usable in both countries, within a couple of years."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10,000 times larger? I don't see how that can be. I'm going to put "over 100" in as a placeholder for now, but can refine it based on data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raphlinus I think 1,000x is safely on the mark (at least): I've seen many CJK web fonts in the 20MB+ range for a single instance. Might be reasonable to say 'on average several hundred times larger' to emphasize the scale of the difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we feel about "the median font size can be 1000 times or more larger than the median Latin size"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10,000 times larger? I don't see how that can be. I'm going to put "over 100" in as a placeholder for now, but can refine it based on data.

Good catch, the figure was indeed based on data but I was calculating a percentage. 1,834,496 * 100 / 17,660 = 10,388 %

"The TrueType or OpenType fonts used for alphabetic languages had a median size of 17,660 bytes, with a spread from 15,784 bytes (5th percentile) to 184,152 bytes (95th percentile). The median size once WOFF2 compressed was 8,360 bytes"

"The TrueType or OpenType fonts used for CJK languages had a median size of 1,834,496 bytes, with a spread from 16,832 bytes (5th percentile) to 5,524,2080 bytes (95th percentile). The median size once WOFF2 compressed was 768,492 bytes."

https://www.w3.org/TR/2020/NOTE-PFE-evaluation-20201015/#font-langtype

src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
2020 automation moved this from TODO to In progress Dec 6, 2020
@tunetheweb
Copy link
Member

Figures updated (including descriptions (except last 1.5 figures as ran out of time) and fallback images).

[Details here])https://github.com/HTTPArchive/almanac.httparchive.org/wiki/Figures-Guide#google-sheets) on how to add more in the correct format (the video is a good guide).

Latest version staged here: https://20201206t121332-dot-webalmanac.uk.r.appspot.com/en/2020/fonts
And with images: https://20201206t121332-dot-webalmanac.uk.r.appspot.com/en/2020/fonts?print

@jpamental
Copy link
Contributor

The use of local is [controversial](https://bramstein.com/writing/web-font-anti-patterns-local-fonts.html), as it can save bytes, but it can also yield bad results if the locally installed version of the font is outdated.

I think maybe I misunderstood the terminology of 'local' vs 'external'—I took that to mean font resources hosted on the same domain (self-hosted) versus with an external service. If that is the case, then I think we can definitely include more from the data about self-hosting versus services, and what the differences are (around page 5 in the Google doc draft)

@AbbyTsai or @rviscomi can you confirm if 'local' refers to 'self-hosted on the same domain' or the actual use if 'local(...)' in the @font-face declaration?

Copy link
Contributor

@RoelN RoelN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, a few of them about the language being used. Sometimes things sounded weird or stuffy to me as a non-native speaker. If the sentence works and you feel differently, feel free to ignore these comments :-)

Very excited to see this article, great work @raphlinus et al!

src/content/en/2020/fonts.md Outdated Show resolved Hide resolved

### Serving with a service

It likely comes as no surprise that Google Fonts remains by far the most popular platform, but the percentage use has actually dropped almost 5% from 2019 to about 70%. Adobe Fonts (formerly Typekit) has dropped about 3% as well, but Bootstrap usage has grown from about 3% to over 6% (in aggregate from several providers). It’s worth noting that the largest provider for Bootstrap (BootstrapCDN) also provides icon fonts from FontAwesome, so it may be that it’s not Bootstrap itself but rather older versions also referencing icon font files that is behind the rise in that source data.
Copy link
Contributor

@RoelN RoelN Dec 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels as if Bootstrap is presented as a service similar to Google/Adobe Fonts, which is not the case. Also I wonder about this, as newest versions of Bootstrap focus on having a "system fonts" font stack, and are pushing SVG icons over icon fonts. So if anything, I would've expected a drop in font usage, certainly not doubling usage. I don't think FontAwesome is pointing to Bootstrap's CDN to download their font (they use their own CDN in examples, but do offer a "CDN picker" for customers which I haven't tried). Either way, Bootstrap's rise seems suspicious?

Indeed FontAwesome can use the Bootstrap CDN: https://www.bootstrapcdn.com/fontawesome/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about it too, but after seeing that icon fonts were being served from the same domain, my hunch is that it's related to those somehow, either from older versions of Bootstrap or just some other common theme system referencing those icon fonts.

src/content/en/2020/fonts.md Outdated Show resolved Hide resolved

There are two other interesting inferences from this data. One might expect the `block` setting to have a significant impact on FCP, especially on mobile, but in practice the effect is not that large. That suggests that waiting for font assets is seldom the "long pole in the tent" for the webpage as a whole, though it would certainly be a major. The `auto` setting (which is also what you get if you don't specify it) looks a lot like `block`; though it's technically up to the browser, [the default seems to be blocking](https://nooshu.github.io/blog/2020/02/23/improving-perceived-performance-with-the-css-font-display-property/).

Finally, the data do not support the use of the `fallback` setting, as there is no actual empirical performance gain compared with `swap`. Fortunately, it only is used by about 1% of pages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, the data do not support the use of the fallback setting, as there is no actual empirical performance gain compared with swap.

I'm having trouble parsing that sentence 😅 Our data doesn't see use of fallback? (Why not?) Or are we deducting usage based on the performance, and swap is too similar to tell them apart?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I'll just rewrite this to be clearer.

src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
I've done my best to respond to feedback from @RoelN
@raphlinus raphlinus marked this pull request as ready for review December 7, 2020 00:05
@rviscomi
Copy link
Member

rviscomi commented Dec 7, 2020

@jpamental just to give you advanced warning regarding your commit to change quote marks, the Web Almanac style guide actually enforces straight quotes for everything for consistency. I know I know they're inferior, please see the discussion in #1485 if you'd like to add your two cents.

@tunetheweb tunetheweb changed the title First draft of Fonts chapter 2020 Fonts chapter Dec 7, 2020
@jpamental
Copy link
Contributor

Understood @rviscomi - Just pushed a commit reverting them all back to straight (and have commented on the issue you linked - thanks!)

raphlinus and others added 4 commits December 7, 2020 15:21
A few improvements to the text, trying to accommodate all feedback.
I didn't get feedback on this from the PR, but think it's an improvement.
Adopt Roel's suggestion on EOT

Co-authored-by: Roel Nieskens <RoelN@users.noreply.github.com>
@svgeesus
Copy link
Contributor

svgeesus commented Dec 8, 2020

I think maybe I misunderstood the terminology of 'local' vs 'external'—I took that to mean font resources hosted on the same domain (self-hosted) versus with an external service. If that is the case, then I think we can definitely include more from the data about self-hosting versus services, and what the differences are (around page 5 in the Google doc draft)

I also find this confusing. On the one hand, people use local to mean "fonts hosted on the same server as the content", as opposed to a font hsting CDN. On the other hand, CSS Fonts talks about local in the sense of locally installed on the client machine, as opposed to downloaded.

@tunetheweb
Copy link
Member

I think maybe I misunderstood the terminology of 'local' vs 'external'—I took that to mean font resources hosted on the same domain (self-hosted) versus with an external service. If that is the case, then I think we can definitely include more from the data about self-hosting versus services, and what the differences are (around page 5 in the Google doc draft)

I also find this confusing. On the one hand, people use local to mean "fonts hosted on the same server as the content", as opposed to a font hsting CDN. On the other hand, CSS Fonts talks about local in the sense of locally installed on the client machine, as opposed to downloaded.

I would personally use "self-hosted" and "local" and think we should use this to avoid ambiguity. do we need @AbbyTsai to confirm any stats here?

Comment on lines +75 to +77
It likely comes as no surprise that Google Fonts remains by far the most popular platform, but the percentage use has actually dropped almost 5% from 2019 to about 70%. Adobe Fonts (formerly Typekit) has dropped about 3% as well, but Bootstrap usage has grown from about 3% to over 6% (in aggregate from several providers). It's worth noting that the largest provider for Bootstrap (BootstrapCDN) also provides icon fonts from FontAwesome, so it may be that it's not Bootstrap itself but rather older versions also referencing icon font files that is behind the rise in that source data.

Another surprise in the data is the rise in fonts being served by Shopify. Growing from roughly 1.1% in 2019 to about 4% in 2020, there has clearly been a significant uptick in usage of web fonts by sites hosted on that platform. It's unclear if that is due to that service offering more fonts that they host on their CDN, if it's growth in use of their platform, or both. However, the increase in usage of both Shopify and Bootstrap represent the largest amount of growth other than Google Fonts, making it a very noticeable data point.
Copy link
Contributor

@AbbyTsai AbbyTsai Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found somewhere on which comparison between 2020 and 2019 is on a different assumption. 2020 is based by the percent of pages, while 2019 is the percent of requests (refer to 2019. figure2. top 20 font hosts). I then re-run the font host ranking by percent of pages as of 2019. Here's the update sheet, as it may not see a significant variance greater than 1%, only Bootstrap decreased and Shopify increased roughly 1%. PR#1669

src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Outdated Show resolved Hide resolved
src/content/en/2020/fonts.md Show resolved Hide resolved
@jpamental
Copy link
Contributor

I think maybe I misunderstood the terminology of 'local' vs 'external'—I took that to mean font resources hosted on the same domain (self-hosted) versus with an external service. If that is the case, then I think we can definitely include more from the data about self-hosting versus services, and what the differences are (around page 5 in the Google doc draft)

I also find this confusing. On the one hand, people use local to mean "fonts hosted on the same server as the content", as opposed to a font hsting CDN. On the other hand, CSS Fonts talks about local in the sense of locally installed on the client machine, as opposed to downloaded.

I would personally use "self-hosted" and "local" and think we should use this to avoid ambiguity. do we need @AbbyTsai to confirm any stats here?

I would certainly appreciate verifying that in this case 'local' is referring to 'specifying locally installed fonts' rather than as @svgeesus put it 'fonts hosted on the same domain' (self-hosted). Ideally I would love to see stats on both. It's often seemed true that self-hosting ends up being faster than using a service (and is called out as 'better' for best page loading performance). Seeing some data on a larger scale that would help uncover the truth of that maxim would be interesting: does the data show if there is a significant difference in FCP and LCP times for self-hosted fonts vs using a service (Google Fonts, BootstrapCDN, Fonts.com, etc).

I realize it may not be possible to do this year, but I think it's very worth exploring if we can.

@AbbyTsai
Copy link
Contributor

AbbyTsai commented Dec 8, 2020

I would certainly appreciate verifying that in this case 'local' is referring to 'specifying locally installed fonts' rather than as @svgeesus put it 'fonts hosted on the same domain' (self-hosted). Ideally I would love to see stats on both. It's often seemed true that self-hosting ends up being faster than using a service (and is called out as 'better' for best page loading performance). Seeing some data on a larger scale that would help uncover the truth of that maxim would be interesting: does the data show if there is a significant difference in FCP and LCP times for self-hosted fonts vs using a service (Google Fonts, BootstrapCDN, Fonts.com, etc).

I realize it may not be possible to do this year, but I think it's very worth exploring if we can.

Saying that, for example, a page requesting local fonts only within the domain itself would be in the “local” category, while a page only requesting fonts from outside domain would then be put in the “external” category. Otherwise, it would be placed in the “both” category, in which a page requesting fonts locally and outside domain as well. Moreover, How would you measure these services (Google Fonts, BootstrapCDN, Fonts.com, etc) to those categories?

@rviscomi rviscomi added the ASAP This issue is blocking progress label Dec 8, 2020
raphlinus and others added 4 commits December 8, 2020 09:40
Co-authored-by: AbbyTsai <44442451+AbbyTsai@users.noreply.github.com>
Co-authored-by: AbbyTsai <44442451+AbbyTsai@users.noreply.github.com>
Co-authored-by: AbbyTsai <44442451+AbbyTsai@users.noreply.github.com>
@raphlinus
Copy link
Contributor Author

Ok, I believe I'm up to date on the suggestions and discussions, these are fairly minor tweaks. I don't see a clear action item for the "local" discussion, it seems like this might just be an internal confusion and the text is good enough, but I'm open to suggestions otherwise.

Is there anything else that's on my plate here?

@tunetheweb
Copy link
Member

OK I'm gonna merge this when the tests complete and copy edit it. Will have another look at local thing then.

Thanks all for the progress so far - nearly there now! If you could keep an eye out for a Copy Edit pull request to review that would be great. Hopefully will get it done this evening before launch but got a lot to do so not promising anything!

@tunetheweb tunetheweb merged commit 0c95e72 into main Dec 8, 2020
2020 automation moved this from In progress to Done Dec 8, 2020
@tunetheweb tunetheweb deleted the fonts branch December 8, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASAP This issue is blocking progress writing Related to wording and content
Projects
No open projects
2020
  
Done
Development

Successfully merging this pull request may close these issues.

Fonts 2020
7 participants