PGijsbers / pgijsbers.github.io

My webpage
https://pgijsbers.github.io/
Other
0 stars 1 forks source link

Benchmark (and possibly add) font subsetting #14

Closed PGijsbers closed 1 year ago

PGijsbers commented 1 year ago

Test the effect of font subsetting by creating a pipeline that:

  1. detects characters used per page 2a. creates a single subset for all pages and 2b. creates a single subset per page
  2. compresses the subset to woff2

Compare the effects of 2a to 2b, and use the best alternative. At this point, there should be very large overlap between the pages, so that subsetting to a single file makes more sense for reusability. See also fonttools.

PGijsbers commented 1 year ago

Subsetting separately currently leads to font files of 4.4kb (index.html) and 6.4kb (about.html), while the combined file is 6.5kb (as expected, minimal differences between the largest file and the combined file). Benefit of a shared file is that subpages won't need a separate font to load, as it is already cached. For that reason I think it's reasonable to subset based on all characters on all pages and provide only a single font file.

PGijsbers commented 1 year ago

Added font subsetting for published builds.