font-glyph-loader

0.1.0 • Public • Published

font-glyph-loader

Webpack loader for extracting subset containing specific glyphs from font. font-glyph-loader is similar to font-subset-loader except:

  1. The loader works on glyph file, not font file. Font is loaded in the same directory using the same filename.
  2. The font subset building can be cachable, Avoiding reduplicate font subset files(increase the size of built files) which are built by the same font and the same glyphs .

Installation

npm i font-glyph-loader -D

Usage

  1. Create MyFont.glyph with glyphs to build font subset with. The raw font file should be also named MyFont.ttf in the same directory.
hello, world!
  1. Loader config in webpack.config.js
module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.glyph$/,
        use: [{
          loader: 'file-loader'
        }, {
          loader: 'font-glyph-loader'
        }]
      }
    ]
  }
  // ...
}
 
@font-face {
  font-family: 'MyFont';
  src: url('../fonts/MyFont.glyph') format('truetype'); /* Safari, Android, iOS */
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    0
  • 0.0.1
    1

Package Sidebar

Install

npm i font-glyph-loader

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

4.54 kB

Total Files

6

Last publish

Collaborators

  • icefox0801