Shifted slanted glyphs leftward a little.

This commit is contained in:
be5invis 2015-08-05 22:47:52 +08:00
parent 4b57df8389
commit 9ec44543f3
3 changed files with 22 additions and 13 deletions

View file

@ -6,6 +6,17 @@ exports.transformPoint = function(tfm, pt){
cubic: pt.cubic
}
}
exports.inverse = function(tfm){
var denom = tfm.xx * tfm.yy - tfm.xy * tfm.yx;
return {
xx : tfm.yy / denom,
yx : -tfm.yx / denom,
xy : -tfm.xy / denom,
yy : tfm.xx / denom,
x : -(tfm.x * tfm.yy - tfm.y * tfm.yx) / denom,
y : -(-tfm.x * tfm.xy + tfm.y * tfm.xx) / denom,
}
}
exports.untransform = function(tfm, pt){
var xx = pt.x - tfm.x
var yy = pt.y - tfm.y