Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme: Fix measureText sample code #1102

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/jimp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(font => {
If you need to do calculations on where to place your text jimp provides two methods that measure how wide and how tall a piece of text will be. You can use these methods to lay out multiple pieces of text in relation to each other

```js
Jimp.measureText(Jimp.FONT_SANS_32_BLACK, 'Some string'); // width of text
Jimp.measureTextHeight(Jimp.FONT_SANS_32_BLACK, 'Some string', 100); // height of text
Jimp.measureText((await Jimp.loadFont(Jimp.FONT_SANS_32_BLACK)), 'Some string'); // width of text
Jimp.measureTextHeight((await Jimp.loadFont(Jimp.FONT_SANS_32_BLACK)), 'Some string', 100); // height of text
```

#### Staggering Text
Expand Down