Reputation: 321
I have site, which size (in browser) is ~90kb. But i have 5 fonts(Bold, extra bold, medium, regular, light), which size is 600kb. It amazing size, how can i reduce it? Fonts format is woff2
Upvotes: 2
Views: 1295
Reputation: 15213
The FontForge program - https://fontforge.github.io/en-US With its help, you will need to remove unnecessary glyphs, export the resulting font to OTF.
Then run the resulting file through - https://transfonter.org For the web, WOFF is universally suitable, but it is better to mark TTF, WOFF and WOFF2 (all the same, the one needed and determined by the browser itself will be loaded). Download the resulting archive (fonts + CSS) and connect them to the project.
You can also use the Font Squirrel Webfont Generator https://www.fontsquirrel.com/tools/webfont-generator. This service allows you to extract unnecessary characters from the font to reduce its weight. For example, you can pull out all the Cyrillic characters, or the Latin alphabet, or the punctuation marks, or even if these are large fonts they have a lot of Chinese characters, and so on.
You can additionally compress fonts by manually editing glyphs if they contain a lot of artifacts, unnecessary anchor points, etc. As a rule, there are no such fonts, if they are not self-made, of course.
Upvotes: 3