1.0.4 • Published 6 years ago
fix-text-baseline v1.0.4
fix-text-baseline
Wrapper for canvas.getContext, designed to fix differences in textBaseline in different browsers
Install
Install with npm
$ npm install fix-text-baselineOr install with yarn
$ yarn add fix-text-baselineimport 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