mdi-font-build-subset
v1.0.0
Published
Build a reduced version of the Material Design Icons webfont.
Readme
mdi-font-build-subset
Synopsis
Dev helper package to build a reduced version of the Material Design Icons webfont:
- Skips ttf and eot fonts, only generates woff and woff2 fonts and matching css - that's enough for the modern web.
- The font contains only the given subset of icons - can save a lot of space.
Define, build, use
Generate a new, reduced mdi webfont
- Prerequisite: Have a working Node.js environment.
cdinto this dir, runnpm installoryarn installto load the dev dependencies.- Add the names of the icons you want to the
./subset.jsonfile. Leave the top 3 there, they are required for the./dist/index.htmlsample page. npm buildoryarn buildcreates the fonts, css, and sample page in the./distfolder.- Optional:
cd dist, runhttp-serverand check the sample page containing your icon selection athttp://localhost:8080.
Use the font in an app
- From
./dist, copy thecssandfontsfolder as peers into the app assets folder. - Include the
css/materialdesignicons.cssinto the app css structure. - Accessing the icons in the reduced webfont is the same as with the full mdi font.
Notes
- The package is basically a clone of the original
@mdi/font-buildpackage. 2 files have been slightly adapted:./bin/index.js./src/scss/_path.scss
- In addition to
./dist, the build also creates an./iconfolder that contains the specified icon svg files. You can safely delete that folder after a successful build.
Credits
Full credits go to the creators and contributors of the @mdi/font-build package, released under the MIT license. My additions make it worse.
