skia-canvas
Advanced tools
Comparing version 0.9.19 to 0.9.20
@@ -288,5 +288,7 @@ "use strict" | ||
if (Buffer.isBuffer(src)) data = src | ||
else if (typeof src != 'string') return | ||
else if (/^\s*data:/.test(src)) { | ||
if (Buffer.isBuffer(src)){ | ||
[data, src] = [src, ''] | ||
} else if (typeof src != 'string'){ | ||
return | ||
} else if (/^\s*data:/.test(src)) { | ||
// data URI | ||
@@ -293,0 +295,0 @@ let split = src.indexOf(','), |
{ | ||
"name": "skia-canvas", | ||
"version": "0.9.19", | ||
"version": "0.9.20", | ||
"description": "A canvas environment for Node", | ||
@@ -53,4 +53,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@mapbox/node-pre-gyp": "^1.0.1", | ||
"glob": "^7.1.6", | ||
"node-pre-gyp": "^0.15.0", | ||
"simple-get": "^4.0.0", | ||
@@ -57,0 +57,0 @@ "string-split-by": "^1.0.0" |
@@ -35,4 +35,11 @@ # Skia Canvas | ||
Until prebuilt binaries can be provided you’ll need to compile the portions of this library that directly interface with Skia. For this you’ll need to install: | ||
On macOS and Linux, installation *should* be as simple as: | ||
```console | ||
$ npm install skia-canvas | ||
``` | ||
This will download a pre-compiled library from the project’s most recent [release](https://github.com/samizdatco/skia-canvas/releases). Note that these binaries are in an early state and currently only work with fairly recent systems. In particular, if using the library with Docker you’ll want to pick a base system from the last few years like [`node:buster`](https://hub.docker.com/_/node) or [`ubuntu:bionic`](https://hub.docker.com/_/ubuntu). | ||
If prebuilt binaries aren’t available for your system you’ll need to compile the portions of this library that directly interface with Skia. Start by installing: | ||
1. The [Rust compiler](https://www.rust-lang.org/tools/install) and cargo package manager using `rustup` | ||
@@ -43,9 +50,4 @@ 2. Python 2.7 (Python 3 is not supported by [neon](https://neon-bindings.com/docs/getting-started#install-node-build-tools)) | ||
Once these are all in place, installation *should* be as simple as: | ||
```console | ||
$ npm install skia-canvas | ||
``` | ||
Once all these dependencies are present, installing from npm should work (after a fairly lengthy compilation process). | ||
> Development of this library has taken place entirely on macOS, so reports from users of other platforms on the specifics of getting everything to compile properly would be appreciated. | ||
## Module Contents | ||
@@ -117,24 +119,24 @@ | ||
|----------------------------------------|---------------------------------------------|--------------------------------------|----------------------------------------------------------| | ||
| [**canvas**](#canvas) [⚡](#canvas) | [clearRect()][clearRect()] | [**fillStyle**][fillStyle] | [**filter**][filter] | | ||
| [**canvas**](#canvas) [⚡](#canvas) | [clearRect()][clearRect()] | [**fillStyle**][fillStyle] | [**filter**][filter] | | ||
| [**globalAlpha**][globalAlpha] | [drawImage()][drawImage()] | [**lineCap**][lineCap] | [**globalCompositeOperation**][globalCompositeOperation] | | ||
| [beginPath()][beginPath()] | [fill()][fill()] | [**lineDashOffset**][lineDashOffset] | [**shadowBlur**][shadowBlur] | | ||
| [clip()][clip()] | [fillRect()][fillRect()] | [**lineJoin**][lineJoin] | [**shadowColor**][shadowColor] | | ||
| [isPointInPath()][isPointInPath()] | [fillText()][fillText()] [⚡][drawText] | [**lineWidth**][lineWidth] | [**shadowOffsetX**][shadowOffsetX] | | ||
| [isPointInPath()][isPointInPath()] | [fillText()][fillText()] [⚡][drawText] | [**lineWidth**][lineWidth] | [**shadowOffsetX**][shadowOffsetX] | | ||
| [isPointInStroke()][isPointInStroke()] | [stroke()][stroke()] | [**miterLimit**][miterLimit] | [**shadowOffsetY**][shadowOffsetY] | | ||
| [restore()][restore()] | [strokeRect()][strokeRect()] | [**strokeStyle**][strokeStyle] | | | ||
| [save()][save()] | [strokeText()][strokeText()] [⚡][drawText] | [getLineDash()][getLineDash()] | | | ||
| [save()][save()] | [strokeText()][strokeText()] [⚡][drawText] | [getLineDash()][getLineDash()] | | | ||
| | | [setLineDash()][setLineDash()] | | | ||
| Bezier Paths | Typography | Pattern & Image | Transform | | ||
|------------------------------------------|-------------------------------------------------------------|----------------------------------------------------|----------------------------------------| | ||
| [arc()][arc()] | [**direction**][direction] | [**imageSmoothingEnabled**][imageSmoothingEnabled] | [**currentTransform**][currentTransform] | | ||
| [arcTo()][arcTo()] | [**font**][font] | [**imageSmoothingQuality**][imageSmoothingQuality] | [getTransform()][getTransform()] | | ||
| [bezierCurveTo()][bezierCurveTo()] | [**fontVariant** ⚡](#fontvariant) | [createImageData()][createImageData()] | [resetTransform()][resetTransform()] | | ||
| [closePath()][closePath()] | [**textAlign**][textAlign] | [createLinearGradient()][createLinearGradient()] | [rotate()][rotate()] | | ||
| [ellipse()][ellipse()] | [**textBaseline**][textBaseline] | [createPattern()][createPattern()] | [scale()][scale()] | | ||
| [lineTo()][lineTo()] | [**textTracking** ⚡](#texttracking) | [createRadialGradient()][createRadialGradient()] | [setTransform()][setTransform()] | | ||
| [moveTo()][moveTo()] | [**textWrap** ⚡](#textwrap) | [getImageData()][getImageData()] | [transform()][transform()] | | ||
| [quadraticCurveTo()][quadraticCurveTo()] | [measureText()][measureText()] [⚡](#measuretextstr-width) | [putImageData()][putImageData()] | [translate()][translate()] | | ||
| [rect()][rect()] | | | | | ||
| Bezier Paths | Typography | Pattern & Image | Transform | | ||
|------------------------------------------|-------------------------------------------------------------|----------------------------------------------------|------------------------------------------| | ||
| [arc()][arc()] | [**direction**][direction] | [**imageSmoothingEnabled**][imageSmoothingEnabled] | [**currentTransform**][currentTransform] | | ||
| [arcTo()][arcTo()] | [**font**][font] [⚡](#font) | [**imageSmoothingQuality**][imageSmoothingQuality] | [getTransform()][getTransform()] | | ||
| [bezierCurveTo()][bezierCurveTo()] | [**fontVariant** ⚡](#fontvariant) | [createImageData()][createImageData()] | [resetTransform()][resetTransform()] | | ||
| [closePath()][closePath()] | [**textAlign**][textAlign] | [createLinearGradient()][createLinearGradient()] | [rotate()][rotate()] | | ||
| [ellipse()][ellipse()] | [**textBaseline**][textBaseline] | [createPattern()][createPattern()] | [scale()][scale()] | | ||
| [lineTo()][lineTo()] | [**textTracking** ⚡](#texttracking) | [createRadialGradient()][createRadialGradient()] | [setTransform()][setTransform()] | | ||
| [moveTo()][moveTo()] | [**textWrap** ⚡](#textwrap) | [getImageData()][getImageData()] | [transform()][transform()] | | ||
| [quadraticCurveTo()][quadraticCurveTo()] | [measureText()][measureText()] [⚡](#measuretextstr-width) | [putImageData()][putImageData()] | [translate()][translate()] | | ||
| [rect()][rect()] | | | | | ||
@@ -184,2 +186,6 @@ | ||
##### `.font` | ||
By default any [`line-height`][lineHeight] value included in a font specification (separated from the font size by a `/`) will be preserved but ignored. If the `textWrap` property is set to `true`, the line-height will control the vertical spacing between lines. | ||
##### `.fontVariant` | ||
@@ -343,2 +349,3 @@ | ||
[Path2D]: https://developer.mozilla.org/en-US/docs/Web/API/Path2D | ||
[lineHeight]: https://developer.mozilla.org/en-US/docs/Web/CSS/line-height | ||
@@ -345,0 +352,0 @@ [canvas]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/canvas |
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
218983
20
1218
409
+ Added@mapbox/node-pre-gyp@^1.0.1
+ Added@mapbox/node-pre-gyp@1.0.11(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedare-we-there-yet@2.0.0(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedgauge@3.0.2(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpmlog@5.0.1(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedyallist@4.0.0(transitive)
- Removednode-pre-gyp@^0.15.0
- Removedansi-regex@2.1.1(transitive)
- Removedaproba@1.2.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedchownr@1.1.4(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@3.2.7(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddetect-libc@1.0.3(transitive)
- Removedfs-minipass@1.2.7(transitive)
- Removedgauge@2.7.4(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedignore-walk@3.0.4(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedminipass@2.9.0(transitive)
- Removedminizlib@1.3.3(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedneedle@2.9.1(transitive)
- Removednode-pre-gyp@0.15.0(transitive)
- Removednopt@4.0.3(transitive)
- Removednpm-bundled@1.1.2(transitive)
- Removednpm-normalize-package-bin@1.0.1(transitive)
- Removednpm-packlist@1.4.8(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrc@1.2.8(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsax@1.4.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedtar@4.4.19(transitive)
- Removedyallist@3.1.1(transitive)