Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/next-canvas-measure-text
A wrapper for measureText.
https://github.com/afeiship/next-canvas-measure-text
canvas measure next text
Last synced: 21 days ago
JSON representation
A wrapper for measureText.
- Host: GitHub
- URL: https://github.com/afeiship/next-canvas-measure-text
- Owner: afeiship
- License: mit
- Created: 2019-09-20T05:53:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-20T06:41:45.000Z (about 5 years ago)
- Last Synced: 2024-10-05T19:41:24.409Z (about 1 month ago)
- Topics: canvas, measure, next, text
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-canvas-measure-text
> A wrapper for measureText.## installation
```bash
npm install -S afeiship/next-canvas-measure-text --registry=https://registry.npm.taobao.org
```## usage
```js
import 'next-canvas-measure-text';
import { createCanvas } from 'canvas';const canvas = createCanvas(1000, 1000);
const ctx = canvas.getContext('2d');nx.canvasMeasureText({
context: ctx,
callback: function(ctx){ ctx.font = '12px PingFang SC' },
text:'Just a tse'
});
```