Comparing version 0.1.0 to 0.1.1
var Subset = module.exports = function(font) { | ||
this.font = font | ||
this.subset = {} | ||
this.mapping = {} | ||
this.subset = { '32': 32 } | ||
this.mapping = { '32': 32 } | ||
this.pos = 33 | ||
@@ -11,2 +11,3 @@ } | ||
var code = chars.charCodeAt(i) | ||
if (code in this.mapping || code < 33) continue | ||
this.subset[this.pos] = code | ||
@@ -13,0 +14,0 @@ this.mapping[code] = this.pos++ |
@@ -27,3 +27,3 @@ var Struct = require('structjs') | ||
glyphIndexArray: Struct.Array(Struct.Uint16, function() { | ||
var length = (this.length - (7 + this.segCount * 4) * 2) / 2 | ||
var length = (this.length - (8 + this.segCount * 4) * 2) / 2 | ||
return length | ||
@@ -30,0 +30,0 @@ }) |
@@ -27,2 +27,16 @@ var Directory = require('./directory') | ||
// workaround for browserify | ||
if (false) { | ||
require('./table/cmap') | ||
require('./table/head') | ||
require('./table/hhea') | ||
require('./table/maxp') | ||
require('./table/hmtx') | ||
require('./table/loca') | ||
require('./table/glyf') | ||
require('./table/name') | ||
require('./table/post') | ||
require('./table/os2') | ||
} | ||
unpackTable('cmap') | ||
@@ -92,3 +106,3 @@ for (var i = 0, len = this.tables.cmap.subtables.length; i < len; ++i) { | ||
} | ||
return width * this.scaleFactor * scale | ||
return width * scale | ||
} | ||
@@ -95,0 +109,0 @@ |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "./lib/ttf", | ||
@@ -14,3 +14,3 @@ "homepage": "https://github.com/rkusa/ttfjs", | ||
"dependencies": { | ||
"structjs": "0.1.x" | ||
"structjs": "0.2.x" | ||
}, | ||
@@ -17,0 +17,0 @@ "bugs": "https://github.com/rkusa/ttfjs/issues", |
@@ -7,3 +7,3 @@ # ttfjs | ||
{ "name": "ttfjs", | ||
"version": "0.1.0" } | ||
"version": "0.1.1" } | ||
``` | ||
@@ -13,3 +13,3 @@ | ||
The following tables are implemented: **cmap** (currently only format 4), **glyf** (glyphs are not actually decompose, only rewritten), **head**, **hhea**, **hmtx**, **loca**, **maxp**, **name**, **os2**, **post** (currently only format 3). | ||
The following tables are implemented: **cmap** (currently only format 4), **glyf** (glyphs are not actually decomposed, only rewritten), **head**, **hhea**, **hmtx**, **loca**, **maxp**, **name**, **os2**, **post** (currently only format 3). | ||
@@ -16,0 +16,0 @@ **TrueType Font Specification:** [Apple](https://developer.apple.com/fonts/TTRefMan/RM06/Chap6.html), [Microsoft](http://www.microsoft.com/typography/specs/default.htm) |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
29599
17
780
+ Addedstructjs@0.2.2(transitive)
- Removedstructjs@0.1.1(transitive)
Updatedstructjs@0.2.x