opentype.js
Advanced tools
Comparing version 0.6.5 to 0.6.6
{ | ||
"name": "opentype.js", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"main": "dist/opentype.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "opentype.js", | ||
"description": "OpenType font parser", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Frederik De Bleser", |
opentype.js | ||
=========== | ||
[![Join the chat at https://gitter.im/nodebox/opentype.js](https://badges.gitter.im/nodebox/opentype.js.svg)](https://gitter.im/nodebox/opentype.js) | ||
[![Gitter](https://badges.gitter.im/nodebox/opentype.js.svg)](https://gitter.im/nodebox/opentype.js) | ||
[![npm](https://img.shields.io/npm/v/opentype.js.svg)](https://www.npmjs.com/package/opentype.js) | ||
[![david-dm](https://david-dm.org/nodebox/opentype.js.svg)](https://david-dm.org/nodebox/opentype.js) | ||
@@ -5,0 +7,0 @@ opentype.js is a JavaScript parser and writer for TrueType and OpenType fonts. |
@@ -0,1 +1,6 @@ | ||
0.6.6 (October 25, 2016) | ||
========================= | ||
* Add support for letter-spacing and tracking (thanks @lachmanski!). | ||
* Fixed a bug in the nameToGlyph function. | ||
0.6.5 (September 9, 2016) | ||
@@ -2,0 +7,0 @@ ========================= |
@@ -164,3 +164,3 @@ // The Font object | ||
Font.prototype.nameToGlyph = function(name) { | ||
var glyphIndex = this.nametoGlyphIndex(name); | ||
var glyphIndex = this.nameToGlyphIndex(name); | ||
var glyph = this.glyphs.get(glyphIndex); | ||
@@ -239,2 +239,8 @@ if (!glyph) { | ||
} | ||
if (options.letterSpacing) { | ||
x += options.letterSpacing * fontSize; | ||
} else if (options.tracking) { | ||
x += (options.tracking / 1000) * fontSize; | ||
} | ||
} | ||
@@ -403,6 +409,6 @@ }; | ||
*/ | ||
Font.prototype.download = function() { | ||
Font.prototype.download = function(fileName) { | ||
var familyName = this.getEnglishName('fontFamily'); | ||
var styleName = this.getEnglishName('fontSubfamily'); | ||
var fileName = familyName.replace(/\s/g, '') + '-' + styleName + '.otf'; | ||
fileName = fileName || familyName.replace(/\s/g, '') + '-' + styleName + '.otf'; | ||
var arrayBuffer = this.toArrayBuffer(); | ||
@@ -409,0 +415,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
887798
18183
261