Skip to content

Some vector utilities for dealing with font glyph positioning in 2D and 3D space.

Notifications You must be signed in to change notification settings

mattdesl/fontpath-vecmath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fontpath-vecmath

Some vector utilities for dealing with font glyph positioning in 2D and 3D space.

API

var util = require('fontpath-vecmath');
var Font = require('./myfonts/Font.ttf.js');

var glyph = Font.glyphs["A"];

var matrix = util.toGlyphMatrix3(Font, glyph, fontPtSize, x, y);

//example using canvas context.setTransform
var val = matrix.val;
var scale = val[0],
	xoff = val[6],
	yoff = val[7];
context.setTransform(scale, 0, 0, -scale, xoff, yoff);

//... draw some paths ...

demo

For more detailed examples, see the demos in fontpath-shape2d.

About

Some vector utilities for dealing with font glyph positioning in 2D and 3D space.

Resources

Stars

Watchers

Forks

Packages

No packages published