How to use the fontkit.open function in fontkit

To help you get started, we’ve selected a few fontkit 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 qooxdoo / qooxdoo-compiler / source / class / qx / tool / compiler / app / WebFont.js View on Github external
__processFontFile : function(filename, resolve, reject) {
      fontkit.open(filename, null, function(err, font) {
        if (err) {
          reject(err);
          return;
        }

        let resources = {};

        // If we have a mapping file, take this information instead
        // of anaylzing the font.
        if (this.getMapping()) {
          let mapPath = path.join(this.__library.getRootDir(), path.join(this.__library.getResourcePath(), this.getMapping()));
          fs.readFile(mapPath, {encoding: "utf-8"}, (err, data) => {
            if (err) {
              log.error(`Cannot read mapping file '${mapPath}': ${err.code}`);
              reject(err);
              return;

fontkit

An advanced font engine for Node and the browser

MIT
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis