bmt
v0.1.1
Published
in Browser, Measure Text width.
Downloads
86
Readme
bmt
in Browser, Measure Text width.
Install
$ npm i --save bmtUsage
import { measureTextByDOM, measureTextByCanvas } from 'bmt';
const font = {
fontFamily: 'sans-serif',
fontSize: 16,
};
measureTextByDOM('hello world', font); // = 80
measureTextByCanvas('hello world', font); // ~= 80Perf
Run on your computer.
$ npm run perfLicense
MIT@hustcc.
