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 1.3.0 to 1.3.1

2

package.json
{
"name": "opentype.js",
"description": "OpenType font parser",
"version": "1.3.0",
"version": "1.3.1",
"author": {

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

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

1.3.1 (April 13, 2020)
=====================
* Revert Fix Path.toPathData and Path.toSVG - X Axis is flipped (#369)
1.3.0 (April 13, 2020)

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

@@ -279,7 +279,6 @@ // The Glyph object

function drawCircles(l, x, y, scale) {
const PI_SQ = Math.PI * 2;
ctx.beginPath();
for (let j = 0; j < l.length; j += 1) {
ctx.moveTo(x + (l[j].x * scale), y + (l[j].y * scale));
ctx.arc(x + (l[j].x * scale), y + (l[j].y * scale), 2, 0, PI_SQ, false);
ctx.arc(x + (l[j].x * scale), y + (l[j].y * scale), 2, 0, Math.PI * 2, false);
}

@@ -286,0 +285,0 @@

@@ -214,3 +214,3 @@ // The `glyf` table describes the glyphs in TrueType outline format.

// Convert the TrueType glyph outline to a Path.
function getPath(points, glyph) {
function getPath(points) {
const p = new Path();

@@ -220,6 +220,2 @@ if (!points) {

}
let flipY = null;
if (glyph) {
flipY = (glyph._yMax + glyph._yMin);
}

@@ -236,10 +232,10 @@ const contours = getContours(points);

if (curr.onCurve) {
p.moveTo(curr.x, flipY == null ? curr.y : (flipY - curr.y));
p.moveTo(curr.x, curr.y);
} else {
if (next.onCurve) {
p.moveTo(next.x, flipY == null ? next.y : (flipY - next.y));
p.moveTo(next.x, next.y);
} else {
// If both first and last points are off-curve, start at their middle.
const start = {x: (curr.x + next.x) * 0.5, y: (curr.y + next.y) * 0.5};
p.moveTo(start.x, flipY == null ? start.y : (flipY - start.y));
p.moveTo(start.x, start.y);
}

@@ -255,3 +251,3 @@ }

// This is a straight line.
p.lineTo(curr.x, flipY == null ? curr.y : (flipY - curr.y));
p.lineTo(curr.x, curr.y);
} else {

@@ -269,3 +265,3 @@ let prev2 = prev;

p.quadraticCurveTo(curr.x, flipY == null ? curr.y : (flipY - curr.y), next2.x, flipY == null ? next2.y : (flipY - next2.y));
p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y);
}

@@ -314,3 +310,3 @@ }

return getPath(glyph.points, glyph);
return getPath(glyph.points);
}

@@ -317,0 +313,0 @@

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

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