sign / translate

Effortless Real-Time Sign Language Translation
https://sign.mt
Other
489 stars 83 forks source link

Material Icons Font - Subset Glyphs #26

Closed AmitMY closed 11 months ago

AmitMY commented 2 years ago

Expected Behavior

Material Icons should only load used icons

Actual Behavior

The Material Icons font is 100kb(!), loads all icons.

Steps to fix?

Use https://fonttools.readthedocs.io/en/latest/subset/index.html to subset the font to only the used glyphs.

AmitMY commented 1 year ago

Possible solution:

// npm install -D @mdi/font @mdi/svg

import { MdiProvider } from 'subset-iconfont';

const mdi = new MdiProvider(['plus', 'circle', 'check'], {
  formats: ['ttf', 'woff2'],
});

mdi.makeFonts('./outputDir').then((result) => {
  console.log('Done!');
});

from https://stackoverflow.com/questions/64614572/creating-a-material-icons-subset

AmitMY commented 11 months ago

Dropped material icons as a dependency.