Socket
Socket
Sign inDemoInstall

opentype.js

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentype.js - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

2

bower.json
{
"name": "opentype.js",
"version": "0.9.0",
"version": "0.10.0",
"main": "dist/opentype.js",

@@ -5,0 +5,0 @@ "keywords": [

{
"name": "opentype.js",
"description": "OpenType font parser",
"version": "0.9.0",
"version": "0.10.0",
"author": {

@@ -6,0 +6,0 @@ "name": "Frederik De Bleser",

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)
[![npm](https://img.shields.io/npm/v/opentype.js.svg)](https://www.npmjs.com/package/opentype.js)
[![Build Status](https://travis-ci.org/nodebox/opentype.js.svg?branch=master)](https://travis-ci.org/nodebox/opentype.js)
[![david-dm](https://david-dm.org/nodebox/opentype.js.svg)](https://david-dm.org/nodebox/opentype.js)
[![Gitter](https://badges.gitter.im/nodebox/opentype.js.svg)](https://gitter.im/nodebox/opentype.js)

@@ -7,0 +8,0 @@ opentype.js is a JavaScript parser and writer for TrueType and OpenType fonts.

@@ -0,1 +1,5 @@

0.10.0 (August 14, 2018)
=====================
* font.download(): use window.URL instead of window.requestFileSystem, which works on a larger set of browsers : Chrome (32+), Opera (19+), Firefox (26+), Safari (7.1+), and all of Edge.
0.9.0 (June 21, 2018)

@@ -2,0 +6,0 @@ =====================

@@ -505,20 +505,18 @@ // The Font object

if (isBrowser()) {
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(window.TEMPORARY, arrayBuffer.byteLength, function(fs) {
fs.root.getFile(fileName, {create: true}, function(fileEntry) {
fileEntry.createWriter(function(writer) {
const dataView = new DataView(arrayBuffer);
const blob = new Blob([dataView], {type: 'font/opentype'});
writer.write(blob);
window.URL = window.URL || window.webkitURL;
writer.addEventListener('writeend', function() {
// Navigating to the file will download it.
location.href = fileEntry.toURL();
}, false);
});
});
},
function(err) {
throw new Error(err.name + ': ' + err.message);
});
if (window.URL) {
const dataView = new DataView(arrayBuffer);
const blob = new Blob([dataView], {type: 'font/opentype'});
let link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = fileName;
let event = document.createEvent('MouseEvents');
event.initEvent('click', true, false);
link.dispatchEvent(event);
} else {
console.warn('Font file could not be downloaded. Try using a different browser.');
}
} else {

@@ -525,0 +523,0 @@ const fs = require('fs');

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 not supported yet

Sorry, the diff of this file is too big to display

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