Skip to content

Commit

Permalink
Bump GitHub CI Node version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronyeh committed Nov 18, 2021
1 parent d5a99f5 commit b66967c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 7 additions & 5 deletions demos/node/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ const fClef = 0xe062;
const gClef = 0xe050;

function canvas1() {
const canvas = createCanvas(850, 400);
const canvas = createCanvas(1600, 700);
const ctx = canvas.getContext('2d');
ctx.scale(2, 2);
ctx.font = '100px Bravura';
ctx.fillText(String.fromCharCode(gClef, 0x20, fClef), 20, 220);
return canvas;
Expand All @@ -32,15 +33,16 @@ function canvas1() {
function canvas2() {
const dom = new JSDOM(`<!DOCTYPE html><body></body>`);
const canvas = dom.window.document.createElement('canvas');
canvas.width = 850;
canvas.height = 400;
canvas.width = 1700;
canvas.height = 800;
const ctx = canvas.getContext('2d');
ctx.scale(2, 2);
ctx.font = '100px PetalumaScript';
ctx.fillText('Hello PetalumaScript', 20, 220);
ctx.fillText('This is the\nPetalumaScript\nText Font', 20, 130);
return canvas;
}

console.log(
`<!DOCTYPE html><html><head><style>img { border: 1px solid #666; }</style></head><body>` +
`<img src="${canvas1().toDataURL()}"><br><img src="${canvas2().toDataURL()}"></body></html>`
`<img width="800" src="${canvas1().toDataURL()}"><br><img width="850" src="${canvas2().toDataURL()}"></body></html>`
);

0 comments on commit b66967c

Please sign in to comment.