Skip to content

Commit

Permalink
fix typos in code sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorp committed Oct 10, 2024
1 parent be7c564 commit 2b01e22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here is sample code for Node.js that loads `filename` from disk, creates a Samsa
const nodeBuffer = fs.readFileSync(filename);
const arrayBuffer = nodeBuffer.buffer;
const samsaBuffer = new SamsaBuffer(arrayBuffer);
const font = new SamsaFont(buffer);
const font = new SamsaFont(samsaBuffer);
const instance = font.instance({ wght: 900, wdth: 200 });
const svg = instance.renderText({ text: "hello, world!", fontSize: 72 });
fs.writeFileSync("render.svg", svg);
Expand All @@ -39,8 +39,8 @@ fs.writeFileSync("render.svg", svg);
In a browser, you obtain an ArrayBuffer and process it similarly. The resulting SVG can be inserted into the DOM.

```javascript
const buffer = new SamsaBuffer(arrayBuffer);
const font = new SamsaFont(buffer);
const samsaBuffer = new SamsaBuffer(arrayBuffer);
const font = new SamsaFont(samsaBuffer);
const instance = font.instance({ wght: 900, wdth: 200 });
const svg = instance.renderText({ text: "hello, world!", fontSize: 72 });
document.getElementById("myDiv").innerHTML = svg;
Expand Down

0 comments on commit 2b01e22

Please sign in to comment.