@insab9/measurewidth
v1.0.1
Published
measure's the width of the given text properties
Downloads
3
Readme
Measure the width of the text using Canvas, HTML5 element.
Installation:
-> npm i @insab9/measurewidth --save
import {measurewidth} from '@insab9/measurewidth';
const width = measurewidth({
text:'Keep coding'
size: "20px",
weight:'bold',
font:'Arial'
});
Note: Text parameter is must. Remaining are optional.
Default parameters is
{
text:'Hello world'
size: "16px",
weight:'normal',
font:'Arial'
}