Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

font-finder

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

font-finder - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.0.5](https://github.com/princjef/font-finder/compare/v1.0.4...v1.0.5) (2020-11-26)
### Bug Fixes
* **parse:** handle incomplete OS/2 tables ([#9](https://github.com/princjef/font-finder/issues/9)) ([24fbd9f](https://github.com/princjef/font-finder/commit/24fbd9f))
## [1.0.4](https://github.com/princjef/font-finder/compare/v1.0.3...v1.0.4) (2018-08-11)

@@ -2,0 +9,0 @@

2

dist/tables/os2.d.ts

@@ -41,2 +41,2 @@ /// <reference types="node" />

}
export default function parseOS2Table(data: Buffer): OS2Table;
export default function parseOS2Table(data: Buffer): OS2Table | undefined;

@@ -8,2 +8,6 @@ "use strict";

function parseOS2Table(data) {
// The OS/2 table must be at least 78 bytes long
if (data.length < 78) {
return undefined;
}
const os2 = {

@@ -52,7 +56,7 @@ version: data.readUInt16BE(0),

};
if (os2.version >= 1) {
if (os2.version >= 1 && data.length >= 86) {
os2.ulCodePageRange1 = data.readUInt32BE(78);
os2.ulCodePageRange2 = data.readUInt32BE(82);
}
if (os2.version >= 2) {
if (os2.version >= 2 && data.length >= 96) {
os2.sxHeight = data.readInt16BE(86);

@@ -59,0 +63,0 @@ os2.sCapHeight = data.readInt16BE(88);

{
"name": "font-finder",
"version": "1.0.4",
"version": "1.0.5",
"description": "Quickly find system font names and metadata without native dependencies",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/princjef/font-finder#readme",

@@ -49,3 +49,8 @@ // This file is modified from opentype.js. All credit for the capabilities

// Parse the OS/2 and Windows metrics `OS/2` table
export default function parseOS2Table(data: Buffer): OS2Table {
export default function parseOS2Table(data: Buffer): OS2Table | undefined {
// The OS/2 table must be at least 78 bytes long
if (data.length < 78) {
return undefined;
}
const os2: OS2Table = {

@@ -100,3 +105,3 @@ version: data.readUInt16BE(0),

if (os2.version >= 1) {
if (os2.version >= 1 && data.length >= 86) {
os2.ulCodePageRange1 = data.readUInt32BE(78);

@@ -106,3 +111,3 @@ os2.ulCodePageRange2 = data.readUInt32BE(82);

if (os2.version >= 2) {
if (os2.version >= 2 && data.length >= 96) {
os2.sxHeight = data.readInt16BE(86);

@@ -109,0 +114,0 @@ os2.sCapHeight = data.readInt16BE(88);

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