1.0.4 • Published 4 years ago

fix-text-baseline v1.0.4

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

fix-text-baseline

Wrapper for canvas.getContext, designed to fix differences in textBaseline in different browsers

Install

Install with npm

$ npm install fix-text-baseline

Or install with yarn

$ yarn add fix-text-baseline
import fixTextBaseline from "fix-text-baseline";

Or umd builds are also available

<script src="path/to/fix-text-baseline.js"></script>

Will expose the global variable to window.fixTextBaseline.

Usage

var canvas = document.createElement("canvas");
var ctx = fixTextBaseline(canvas.getContext("2d"));
ctx.font = "40px Arial";
ctx.fillText("test", 0, 10);

License

MIT © Harvey Zack

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago