0.1.11 • Published 4 years ago

@deprecatedluxas/width-measurer v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

width-measure

Installation

Using NPM

$ npm install @deprecatedluxas/width-measurer

Using Yarn

$ yarn add @deprecatedluxas/width-measurer

Usage

import { WidthMeasurer } from "@deprecatedluxas/width-measurer";


const measure = new WidthMeasurer({
    defaultOutputPath: "./widths", // Where the width blocks will be stored.
});

await measure.create("Basic Latin", {
    font: "10px Verdana"
});
// When creating a width block, the name of the file is the width block type and the font.
// example: basic-latin-10px-verdana.json

const textWidth = measure.measure("hello", measure.load("basic-latin-10px-verdana.json"));
// returns 23.84

License

MIT

0.1.10

4 years ago

0.1.11

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago