Skip to content

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

License

Notifications You must be signed in to change notification settings

zhw2590582/fix-text-baseline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published