Skip to content
/ bmt Public

đź“Ź in Browser, Measure Text width.

License

Notifications You must be signed in to change notification settings

hustcc/bmt

Repository files navigation

bmt

in Browser, Measure Text width.

npm Version Build Status Coverage Status npm License

Install

$ npm i --save bmt

Usage

import { measureTextByDOM, measureTextByCanvas } from 'bmt';

const font = {
  fontFamily: 'sans-serif',
  fontSize: 16,
};

measureTextByDOM('hello world', font); // = 80
measureTextByCanvas('hello world', font); // ~= 80

Perf

perf

Run on your computer.

$ npm run perf

License

MIT@hustcc.

About

đź“Ź in Browser, Measure Text width.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published