All Projects → funbox → beatrix

funbox / beatrix

Licence: MIT license
A tool to chop off useless fonts glyphs and convert TTF/OTF into WOFF & WOFF2

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to beatrix

fontfacegen-webpack-plugin
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.
Stars: ✭ 20 (-9.09%)
Mutual labels:  woff2, woff, ttf, otf
Urbanist
Urbanist is a low-contrast, geometric sans-serif inspired by Modernist design and typography.
Stars: ✭ 374 (+1600%)
Mutual labels:  webfonts, glyphs, fonttools
fontawesome-subset
Creates subsets of FontAwesome fonts for optimized use on the web.
Stars: ✭ 41 (+86.36%)
Mutual labels:  webfonts, glyphs, subset
Awesome Typography
✏︎ Curated list about digital typography 🔥
Stars: ✭ 947 (+4204.55%)
Mutual labels:  webfonts, ttf, otf
fontagon
Fontagon is a great tool that easily converts svg into icon font. Fontagon-cli allows faster conversion to commands.
Stars: ✭ 18 (-18.18%)
Mutual labels:  woff2, woff, ttf
Woffle
Drag and drop woff and woff2 web font generator for macOS
Stars: ✭ 24 (+9.09%)
Mutual labels:  webfonts, woff2, woff
Typography
C# Font Reader (TrueType / OpenType / OpenFont / CFF / woff / woff2) , Glyphs Layout and Rendering
Stars: ✭ 246 (+1018.18%)
Mutual labels:  webfonts, ttf, otf
Font Spider
Smart webfont compression and format conversion tool
Stars: ✭ 4,550 (+20581.82%)
Mutual labels:  woff2, woff, ttf
glyphhanger
Your web font utility belt. It can subset web fonts. It can find unicode-ranges for you automatically. It makes julienne fries.
Stars: ✭ 422 (+1818.18%)
Mutual labels:  webfonts, glyphs, subset
Haack
Hæck
Stars: ✭ 142 (+545.45%)
Mutual labels:  ttf, otf
Ttf Parser
A high-level, safe, zero-allocation TrueType font parser.
Stars: ✭ 221 (+904.55%)
Mutual labels:  ttf, otf
Codeface
Typefaces for source code beautification
Stars: ✭ 5,612 (+25409.09%)
Mutual labels:  ttf, otf
Php Font Lib
A library to read, parse, export and make subsets of different types of font files.
Stars: ✭ 1,530 (+6854.55%)
Mutual labels:  woff, ttf
Opentype.js
Read and write OpenType fonts using JavaScript.
Stars: ✭ 3,393 (+15322.73%)
Mutual labels:  glyphs, otf
SUIT
SUIT―수트는 반복되는 노력을 기울이지 않아도 완성도 높은 형태를 유지하며, 소모적인 커뮤니케이션도 줄일 수 있도록 제작한 UI 본문용 폰트입니다.
Stars: ✭ 168 (+663.64%)
Mutual labels:  woff2, otf
font-v
Font version string reporting and modification library + executable tool
Stars: ✭ 15 (-31.82%)
Mutual labels:  ttf, otf
pixel font
All-in-one tool for creating TrueType outline fonts from bitmap glyph data, purely written in Elixir.
Stars: ✭ 16 (-27.27%)
Mutual labels:  ttf, otf
Birdfont
A font editor for creating fonts in TTF, EOT, SVG and BIRDFONT format.
Stars: ✭ 272 (+1136.36%)
Mutual labels:  ttf, otf
Acy-Font
自制手写字体。A hand-writing font set.
Stars: ✭ 20 (-9.09%)
Mutual labels:  ttf, otf
FontRegister
FontRegister is a small Windows utility to install fonts and/or repair the font registry via commandline.
Stars: ✭ 17 (-22.73%)
Mutual labels:  ttf, otf
Beatrix logo: “BEATRIX” cut into two pieces by katana
Beatrix chops off useless fonts parts and converts TTF/OTF files into WOFF & WOFF2

Rationale

Users spend a lot of time downloading web assets: JS, CSS, images, fonts, etc. To reduce waiting time, developers compress the assets, gzip them, use optimized formats for images and fonts.

But sometimes the developers can go a little bit further. When they have all the rights for fonts they use, it's possible to leave only the glyphs their website needs. Just cut off the rest ones.

That's exactly how the tool works.

Getting Started

По-русски

First of all, the tool is a wrapper around Python scripts distributed as fonttools. You should install them and the deps they need to:

pip install fonttools zopfli brotli

Then you can install Beatrix:

npm install --save @funboxteam/beatrix

Now you're ready to optimize your fonts.

Usage

Beatrix expects to get a path to directory with TTF/OTF files inside and the config with allowed characters listed.

E.g. if you clone this repo and install the tool, you will be able to run it like this:

beatrix --config ./example/config.js --output ./dist ./example

It will load ./example/config.js, find all the TTF/OTF files inside ./example, optimize & convert them to WOFF & WOFF2, and put the results into ./dist.

The output of this command
$ beatrix --config ./example/config.js --output ./dist ./example
Output dir cleared.
------------------------
Start processing '/tmp/beatrix/example/Roboto/bold--italic.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 171 Kb → 33 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/bold--italic.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/bold.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 167 Kb → 32 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/bold.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/light--italic.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 173 Kb → 34 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/light--italic.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/light.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 167 Kb → 32 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/light.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/regular--italic.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 170 Kb → 33 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/regular--italic.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/regular.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 168 Kb → 32 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/regular.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/thin--italic.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 172 Kb → 34 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/thin--italic.ttf'.
------------------------
Start processing '/tmp/beatrix/example/Roboto/thin.ttf'...
Dest dir created: '/tmp/beatrix/dist/Roboto'.
TTF subset: 168 Kb → 32 Kb (−80%).
TTF created.
WOFF created.
WOFF2 created.
Completed processing '/tmp/beatrix/example/Roboto/thin.ttf'.
------------------------
Done.

Config file

Config is a JS or JSON file which describes an object containing CHARACTERS and LAYOUT_FEATURES.

CHARACTERS is an array, where each item is a string describing one Unicode number or a range of them. Each Unicode number is represented as 4 hex digits.

LAYOUT_FEATURES is an array of OpenType features (e.g., kern, liga, tnum, etc.).

Please note that if no config provided, the default config is used. If one of the options is not present in the config, the appropriate option from the default config is used.

Example:

module.exports = {
  CHARACTERS: [
    // Unicode range from U+0020 to U+007E (including the last one).
    // Contains: space, !, ", #, $, %, &, ', (, ), *, +, comma, 
    // -, dot, /, numbers, :, ;, <, =, >, ?, @, A-Z, [, \, ], ^,
    // _, `, a-z, {, |, }, ~
    '0020-007E',

    // One Unicode number
    // non-breaking space
    '00A0',

    // One more Unicode number
    // ©
    '00A9',
 
    // ...
  ],

  // Drop all the features except 'tnum' and 'kern'
  LAYOUT_FEATURES: ['tnum', 'kern']
}

The characters and features described above will be left in the font files, all the rest will be cut off.

If you want to remove all the characters or features completely just pass an empty array.

Sponsored by FunBox

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].