Socket
Socket
Sign inDemoInstall

ttfjs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ttfjs - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

21

lib/directory.js

@@ -15,7 +15,3 @@ var Struct = require('structjs')

$packing: function() {
var searchRange, next = 1
while ((next = next * 2) <= this.numTables) {
searchRange = next
}
return searchRange * 16
return easySearchable(this.numTables) * 16
}

@@ -25,3 +21,3 @@ }),

$packing: function() {
return Math.log(this.searchRange / 16) / Math.LN2
return Math.log(easySearchable(this.numTables)) / Math.LN2
}

@@ -31,6 +27,15 @@ }),

$packing: function() {
return this.numTables * 16 - this.searchRange
var searchRange = easySearchable(this.numTables) * 16
return this.numTables * 16 - searchRange
}
}),
entries: Struct.Hash(Entry, 'tag', Struct.Ref('numTables'))
})
})
function easySearchable(numTables) {
var result, next = 1
while ((next = next * 2) <= numTables) {
result = next
}
return result
}

@@ -125,2 +125,6 @@ var Directory = require('./directory')

TTFFont.prototype.lineDescent = function(size) {
return this.descent / 1000 * size
}
TTFFont.prototype.subset = function() {

@@ -127,0 +131,0 @@ return new Subset(this)

@@ -8,3 +8,3 @@ {

"description": "TTFjs is a TrueType font parser entirely written in JavaScript and compatible to both Node.js and the Browser.",
"version": "0.2.1",
"version": "0.2.2",
"main": "./lib/ttf",

@@ -11,0 +11,0 @@ "homepage": "https://github.com/rkusa/ttfjs",

@@ -19,3 +19,3 @@ # ttfjs

## MIT License
Copyright (c) 2013-2014 Markus Ast
Copyright (c) 2013-2015 Markus Ast

@@ -22,0 +22,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc