The download size of Google Material is large: 3.3 MB with the defaults:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
I have followed the advice to download only a certain variant:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
and now the size is 242kB.
But since I am only using 2 of the symbols, is there any easy way (best not to involve storing the font on my server) to subset it? Thanks!
You can use the
textquery parameter to reduce the number of icons.Since Material icons rely on ligatures you need to enter the names of the desired icons (See list of icons).
E.g for filtering to
closeandsearchicon we append this query parameter:We can also remove duplicate characters (e.g "s", "e")
The new subset font file is only ~ 4KB