All Projects → daniel-araujo → fontfacegen-webpack-plugin

daniel-araujo / fontfacegen-webpack-plugin

Licence: MIT License
A plugin for webpack that allows you to convert .ttf and .otf files into various other font formats such as .eot, .ttf, .svg, .woff and .woff2 using the existing NPM package fontfacegen.

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to fontfacegen-webpack-plugin

beatrix
A tool to chop off useless fonts glyphs and convert TTF/OTF into WOFF & WOFF2
Stars: ✭ 22 (+10%)
Mutual labels:  woff2, woff, ttf, otf
Font Spider
Smart webfont compression and format conversion tool
Stars: ✭ 4,550 (+22650%)
Mutual labels:  woff2, woff, ttf, eot
fontagon
Fontagon is a great tool that easily converts svg into icon font. Fontagon-cli allows faster conversion to commands.
Stars: ✭ 18 (-10%)
Mutual labels:  font, woff2, woff, ttf
Typography
C# Font Reader (TrueType / OpenType / OpenFont / CFF / woff / woff2) , Glyphs Layout and Rendering
Stars: ✭ 246 (+1130%)
Mutual labels:  font, ttf, otf
FontRegister
FontRegister is a small Windows utility to install fonts and/or repair the font registry via commandline.
Stars: ✭ 17 (-15%)
Mutual labels:  font, ttf, otf
Acy-Font
自制手写字体。A hand-writing font set.
Stars: ✭ 20 (+0%)
Mutual labels:  font, ttf, otf
Codeface
Typefaces for source code beautification
Stars: ✭ 5,612 (+27960%)
Mutual labels:  font, ttf, otf
font-v
Font version string reporting and modification library + executable tool
Stars: ✭ 15 (-25%)
Mutual labels:  font, ttf, otf
SUIT
SUIT―수트는 반복되는 노력을 기울이지 않아도 완성도 높은 형태를 유지하며, 소모적인 커뮤니케이션도 줄일 수 있도록 제작한 UI 본문용 폰트입니다.
Stars: ✭ 168 (+740%)
Mutual labels:  font, woff2, otf
Php Font Lib
A library to read, parse, export and make subsets of different types of font files.
Stars: ✭ 1,530 (+7550%)
Mutual labels:  font, woff, ttf
Haack
Hæck
Stars: ✭ 142 (+610%)
Mutual labels:  font, ttf, otf
Woffle
Drag and drop woff and woff2 web font generator for macOS
Stars: ✭ 24 (+20%)
Mutual labels:  woff2, woff
Neodgm
Modern TrueType font based on an old-but-good Korean bitmap font.
Stars: ✭ 230 (+1050%)
Mutual labels:  font, ttf
Hack
A typeface designed for source code
Stars: ✭ 14,543 (+72615%)
Mutual labels:  font, ttf
apple-emoji-linux
Apple Color Emoji for Linux
Stars: ✭ 392 (+1860%)
Mutual labels:  font, ttf
MaterialDesign-Font
Distribution Repo for the TTF font
Stars: ✭ 102 (+410%)
Mutual labels:  font, ttf
Webfont
Awesome generator of webfont
Stars: ✭ 170 (+750%)
Mutual labels:  font, ttf
lv lib freetype
Interface to FreeType to generate font bitmaps run time
Stars: ✭ 41 (+105%)
Mutual labels:  font, ttf
ansi-to-svg
😹 convert ANSI Escaped CLI strings to SVGs
Stars: ✭ 18 (-10%)
Mutual labels:  font, convert
chiron-sans-hk
昭源黑體:現代筆形風格,平衡標準字形和印刷體慣用筆形的免費開源黑體字型
Stars: ✭ 131 (+555%)
Mutual labels:  font, otf

fontfacegen-webpack-plugin

This plugin allows you to convert .ttf and .otf files into various other font formats such as .eot, .ttf, .svg, .woff and .woff2 using the existing NPM package fontfacegen.

               fontfacegen
fontfile.ttf ---------------> fontfile.ttf
                              fontfile.eot
                              fontfile.svg
                              fontfile.woff
                              fontfile.woff2

Install

npm install fontfacegen
npm install fontfacegen-webpack-plugin

Usage

Require the module fontfacegen-webpack-plugin, create an instance of FontfacegenWebpackPlugin and pass the instance to the plugins array.

const FontfacegenWebpackPlugin = require('fontfacegen-webpack-plugin')

module.exports = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new FontfacegenWebpackPlugin({ tasks: ['fontfile.ttf', 'anotherfont.otf'] })
  ]
}

This will generate the following files:

  • dist/fontfile.eot
  • dist/fontfile.ttf
  • dist/fontfile.svg
  • dist/fontfile.woff
  • dist/fontfile.woff2
  • dist/anotherfont.eot
  • dist/anotherfont.ttf
  • dist/anotherfont.svg
  • dist/anotherfont.woff
  • dist/anotherfont.woff2

You can then reference these files in your code.

@font-face {
  src: url("dist/fontfile.eot");
  src: url("dist/fontfile.eot?#iefix") format("embedded-opentype"),
    url("dist/fontfile.woff2") format("woff2"),
    url("dist/fontfile.woff") format("woff"),
    url("dist/fontfile.ttf") format("ttf"),
    url("dist/fontfile.svg") format("svg");
  font-family: fontfile;
  font-style: normal;
  font-weight: normal;
}

@font-face {
  src: url("dist/anotherfont.eot");
  src: url("dist/anotherfont.eot?#iefix") format("embedded-opentype"),
    url("dist/anotherfont.woff2") format("woff2"),
    url("dist/anotherfont.woff") format("woff"),
    url("dist/anotherfont.ttf") format("ttf"),
    url("dist/anotherfont.svg") format("svg");
  font-family: anotherfont;
  font-style: normal;
  font-weight: normal;
}

Documentation

The fontfacegen-webpack-plugin module default exports a single class: FontfacegenWebpackPlugin

An instance of this object is passed to the plugins array of webpack's config options.

The constructor takes an object as its first argument:

Property Description
tasks Array of directories or file paths.
- Directory: Files with the extension .ttf and .otf in the directory will be converted.
- File. That single file will be converted.
subset A string or array with the characters desired to be included inside the generated fonts.

Contributing

The easiest way to contribute is by starring this project on GitHub!

https://github.com/daniel-araujo/fontfacegen-webpack-plugin

If you've found a bug, would like to suggest a feature or need some help, feel free to create an issue on GitHub:

https://github.com/daniel-araujo/fontfacegen-webpack-plugin/issues

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].