How to use the fonteditor-core.Font function in fonteditor-core

To help you get started, we’ve selected a few fonteditor-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github retyui / postcss-icon / lib-old / FontIconSet.js View on Github external
value: function sliceGlyf(_ref7) {
			var type = _ref7.type,
			    subset = _ref7.subset;

			this._hash = (0, _helps.generateHash)(subset.toString());

			var _require2 = require("fonteditor-core"),
			    Font = _require2.Font;

			this._font = Font.create(this._buffer, {
				type,
				subset
			});

			var defaultFontFamily = this._font.data.name.fontFamily;

			this._ff = `${defaultFontFamily} ${this.getHash()}`;
			this._font.data.name.fullName = this._ff;
			this._font.data.name.fontFamily = this._ff;
			return this;
		}
	}, {
github matthewgonzalez / fontplop / lib / font.ts View on Github external
readFont () {
    const inBuffer = fs.readFileSync(this.ttfPath)
    return FontEditorCore.Font.create(inBuffer, {
      type: 'ttf'
    })
  }
github astefanutti / decktape / decktape.js View on Github external
#!/usr/bin/env node

'use strict';

const chalk     = require('chalk'),
      crypto    = require('crypto'),
      Font      = require('fonteditor-core').Font,
      fs        = require('fs'),
      hummus    = require('hummus'),
      os        = require('os'),
      parser    = require('./libs/nomnom'),
      path      = require('path'),
      puppeteer = require('puppeteer'),
      URI       = require('urijs'),
      util      = require('util');

const { delay, pause } = require('./libs/util');

const plugins = loadAvailablePlugins(path.join(path.dirname(__filename), 'plugins'));

parser.script('decktape').options({
  url : {
    position  : 1,
github taggon / fonty / index.js View on Github external
const fs = require('fs');
const path = require('path');
const Font = require('fonteditor-core').Font;
const TTF = require('fonteditor-core').TTF;
const ttf2woff2 = require('ttf2woff2');
const cssWriter = require('./css-writer');
const deflate = require('pako').deflate;

const allowedOutputTypes = [ 'ttf', 'eot', 'svg', 'woff', 'woff2' ];

function exists(path) {
	try {
		fs.accessSync(path);
		return true;
	} catch(e) {
		return false;
	}
}