WordPress / twentytwentyfive

140 stars 102 forks source link

Add default fonts and optional font presets #22

Closed carolinan closed 1 month ago

carolinan commented 2 months ago

This is a tracking issue for adding font families.

Fonts used in the default style

Font presets

Google fonts hub for Literata: https://fonts.google.com/specimen/Literata Source files with 60pt static: https://drive.google.com/file/d/10gXtroY3pgFzJ43CUaDM5aNPwp96LOOc/view


carolinan commented 2 months ago

Let's discuss how to name and organize the presets?

As discussed in https://github.com/WordPress/twentytwentyfive/issues/3 it would be good to standardize the naming.

carolinan commented 2 months ago

We also need to know which font weights and font styles that needs to be added, both for the download, and for theme.json.

beafialho commented 2 months ago

I believe some of these are variable, can we add the variable font file?

LittleBigThing commented 2 months ago

I believe some of these are variable, can we add the variable font file?

I think that it is better to use separate font files for each weight. Variable font files are large. The font weights that are not used on a page are mostly not loaded by the browser (also, they are not enqueued in unselected in the Font Library?). So using separate font files should make the page size smaller.

carolinan commented 2 months ago

@kafleg it looks like Beiruti and Robot Slab are not added to the theme?

carolinan commented 2 months ago

I believe some of these are variable, can we add the variable font file?

I think that it is better to use separate font files for each weight. Variable font files are large. The font weights that are not used on a page are mostly not loaded by the browser (also, they are not enqueued in unselected in the Font Library?). So using separate font files should make the page size smaller.

This is an interesting point. Long-term, variable fonts are easier to maintain since there are fewer files, but the performance for the user and website visitors is more important.

Do you have any reliable sources (articles) that show if the non-variable fonts are faster? The number of HTTP requests should also be considered.

carolinan commented 1 month ago

Let's revisit the performance question after the performance review.

askdesign commented 1 month ago

I believe some of these are variable, can we add the variable font file?

I think that it is better to use separate font files for each weight. Variable font files are large. The font weights that are not used on a page are mostly not loaded by the browser (also, they are not enqueued in unselected in the Font Library?). So using separate font files should make the page size smaller.

This is an interesting point. Long-term, variable fonts are easier to maintain since there are fewer files, but the performance for the user and website visitors is more important.

Do you have any reliable sources (articles) that show if the non-variable fonts are faster? The number of HTTP requests should also be considered.

Found some information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide https://ckeditor.com/blog/optimize-font-size-with-variable-fonts/

• Yes, variable font file size is typically larger than a single font file size. However, it's smaller than the collection of single font file sizes.