opentype.js
Advanced tools
Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "opentype.js", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"main": "dist/opentype.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "opentype.js", | ||
"description": "OpenType font parser", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"author": { | ||
@@ -41,9 +41,6 @@ "name": "Frederik De Bleser", | ||
"browserify": "^6.2.0", | ||
"grunt": "~0.4.2", | ||
"grunt-contrib-uglify": "~0.4.0", | ||
"grunt-release": "~0.7.0", | ||
"jshint": "~2.5.0", | ||
"jshint": "^2.5.10", | ||
"uglifyify": "^2.6.0", | ||
"watchify": "^0.10.2" | ||
"watchify": "^2.1.1" | ||
} | ||
} |
@@ -0,1 +1,9 @@ | ||
0.4.2 (Nov 24, 2014) | ||
==================== | ||
* 2x speedup when writing fonts, thanks @louisremi! | ||
0.4.1 (Nov 10, 2014) | ||
==================== | ||
* Fix bug that prevented `npm install`. | ||
0.4.0 (Nov 10, 2014) | ||
@@ -2,0 +10,0 @@ ==================== |
@@ -114,3 +114,3 @@ // Geometric objects | ||
var v = arguments[i]; | ||
if (v > 0 && i > 0) { | ||
if (v >= 0 && i > 0) { | ||
s += ' '; | ||
@@ -117,0 +117,0 @@ } |
@@ -240,5 +240,7 @@ // Data types used in the OpenType font file. | ||
encode.DICT = function (m) { | ||
var d = []; | ||
var keys = Object.keys(m); | ||
for (var i = 0; i < keys.length; i += 1) { | ||
var d = [], | ||
keys = Object.keys(m), | ||
length = keys.length; | ||
for (var i = 0; i < length; i += 1) { | ||
// Object.keys() return string keys, but our keys are always numeric. | ||
@@ -251,2 +253,3 @@ var k = parseInt(keys[i], 0); | ||
} | ||
return d; | ||
@@ -293,10 +296,24 @@ }; | ||
// memoize charstring encoding using WeakMap if available | ||
var wmm = window.WeakMap && new window.WeakMap(); | ||
// Convert a list of CharString operations to bytes. | ||
encode.CHARSTRING = function (ops) { | ||
var d = [], i; | ||
for (i = 0; i < ops.length; i += 1) { | ||
var op = ops[i]; | ||
var encodingFunction = encode[op.type]; | ||
d = d.concat(encodingFunction(op.value)); | ||
if ( wmm && wmm.has( ops ) ) { | ||
return wmm.get( ops ); | ||
} | ||
var d = [], | ||
length = ops.length, | ||
op, | ||
i; | ||
for (i = 0; i < length; i += 1) { | ||
op = ops[i]; | ||
d = d.concat( encode[op.type](op.value) ); | ||
} | ||
if ( wmm ) { | ||
wmm.set( ops, d ); | ||
} | ||
return d; | ||
@@ -322,4 +339,7 @@ }; | ||
encode.TABLE = function (table) { | ||
var d = []; | ||
for (var i = 0; i < table.fields.length; i += 1) { | ||
var d = [], | ||
length = table.fields.length, | ||
i; | ||
for (i = 0; i < length; i += 1) { | ||
var field = table.fields[i]; | ||
@@ -326,0 +346,0 @@ var encodingFunction = encode[field.type]; |
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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
845742
4
13101