kekee000 / Fonteditor Core
Licence: mit
fonteditor core functions
Stars: ✭ 207
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Fonteditor Core
Font Spider
Smart webfont compression and format conversion tool
Stars: ✭ 4,550 (+2098.07%)
Mutual labels: svg, ttf
Birdfont
A font editor for creating fonts in TTF, EOT, SVG and BIRDFONT format.
Stars: ✭ 272 (+31.4%)
Mutual labels: svg, ttf
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 (-90.34%)
Mutual labels: convert, ttf
Svg Text Animate
A Javascript library for convert texts to SVG stroke animations in the browser.
Stars: ✭ 197 (-4.83%)
Mutual labels: svg
Vue Eva Icons
Is a pack of more than 480 beautiful open source Eva icons as Vue components
Stars: ✭ 189 (-8.7%)
Mutual labels: svg
Svg Sprite Module
Optimize SVG files and combine them into sprite
Stars: ✭ 187 (-9.66%)
Mutual labels: svg
Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (-0.97%)
Mutual labels: svg
Shields
Concise, consistent, and legible badges in SVG and raster format
Stars: ✭ 15,716 (+7492.27%)
Mutual labels: svg
Vue Awesome
Awesome SVG icon component for Vue.js, built-in with Font Awesome icons.
Stars: ✭ 2,302 (+1012.08%)
Mutual labels: svg
Free Gophers Pack
✨ This pack of 100+ gopher pictures and elements will help you to build own design of almost anything related to Go Programming Language: presentations, posts in blogs or social media, courses, videos and many, many more.
Stars: ✭ 2,343 (+1031.88%)
Mutual labels: svg
Richpath
💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.
Stars: ✭ 2,259 (+991.3%)
Mutual labels: svg
Visualizer
UI-Router state visualizer and transition visualizer
Stars: ✭ 205 (-0.97%)
Mutual labels: svg
Svg Gauge
Minimalistic, animated SVG gauge. Zero dependencies
Stars: ✭ 188 (-9.18%)
Mutual labels: svg
Animating Vue Workshop
Animated Interfaces with Vue.js Workshop Materials
Stars: ✭ 195 (-5.8%)
Mutual labels: svg
Snap.svg
The JavaScript library for modern SVG graphics.
Stars: ✭ 13,346 (+6347.34%)
Mutual labels: svg
Svelte Awesome
Awesome SVG icon component for Svelte JS, built with Font Awesome icons. Based on Justineo/vue-awesome
Stars: ✭ 193 (-6.76%)
Mutual labels: svg
React Simple Maps
Beautiful React SVG maps with d3-geo and topojson using a declarative api.
Stars: ✭ 2,360 (+1040.1%)
Mutual labels: svg
fonteditor-core
FontEditor core functions
Feature
- sfnt parse
- read, write, transform fonts
- ttf (read and write)
- woff (read and write)
- woff2 (read and write)
- eot (read and write)
- svg (read and write)
- otf (only read)
- ttf glyph adjust
- svg to glyph
Usage
// read font file
const Font = require('fonteditor-core').Font;
const fs = require('fs');
let buffer = fs.readFileSync('font.ttf');
// read font data
let font = Font.create(buffer, {
type: 'ttf', // support ttf, woff, woff2, eot, otf, svg
subset: [65, 66], // only read `a`, `b` glyf
hinting: true, // save font hinting
compound2simple: true, // transform ttf compound glyf to simple
inflate: null, // inflate function for woff
combinePath: false, // for svg path
});
let fontObject = font.get();
console.log(Object.keys(fontObject));
/* => [ 'version',
'numTables',
'searchRenge',
'entrySelector',
'rengeShift',
'head',
'maxp',
'glyf',
'cmap',
'name',
'hhea',
'post',
'OS/2',
'fpgm',
'cvt',
'prep'
]
*/
// write font file
let buffer = font.write({
type: 'woff', // support ttf, woff, woff2, eot, svg
hinting: true, // save font hinting
deflate: null, // deflate function for woff
support: {head: {}, hhea: {}} // for user to overwrite head.xMin, head.xMax, head.yMin, head.yMax, hhea etc.
});
// fs.writeFileSync('font.woff', buffer);
// to base64 str
font.toBase64({
type: 'ttf' // support ttf, woff, woff2, eot, svg
});
// optimize glyf
font.optimize()
// compound2simple
font.compound2simple()
// sort glyf
font.sort()
// find glyf
let result = font.find({
unicode: [65]
});
let result = font.find({
filter: function (glyf) {
return glyf.name == 'icon'
}
});
// merge another font object
font.merge(font1, {
scale: 1
});
woff2
Notice: woff2 use wasm build of google woff2, before read and write woff2
,
you should first call woff2.init()
.
const Font = require('fonteditor-core').Font;
const woff2 = require('fonteditor-core').woff2;
woff2.init().then(() => {
// read
let font = Font.create(buffer, {
type: 'woff2'
});
// write
font.write({type: 'woff2'});
});
Demo
npm run dev
build
npm run build
test
npm run test
support
Node.js:>= 8.0
Browser: Chrome, Safari
Related
License
MIT © Fonteditor
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].