diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2013-08-16 14:13:47 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2013-08-19 14:17:11 -0400 |
commit | 4f033683ca79093de30b62f5a3b87c2c466496f0 (patch) | |
tree | cd73f35cb86fd8b12dcbac7e367fc87ac9f18f3f /Lib/fontTools/misc/arrayTools.py | |
parent | bca6e99d1c94b44cfc68c62229ac821e04809715 (diff) | |
download | fonttools-4f033683ca79093de30b62f5a3b87c2c466496f0.tar.gz |
Port glyf transform from numpy to lists
Diffstat (limited to 'Lib/fontTools/misc/arrayTools.py')
-rw-r--r-- | Lib/fontTools/misc/arrayTools.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/fontTools/misc/arrayTools.py b/Lib/fontTools/misc/arrayTools.py index 3f39e7e4..58cac006 100644 --- a/Lib/fontTools/misc/arrayTools.py +++ b/Lib/fontTools/misc/arrayTools.py @@ -6,6 +6,13 @@ import math +def matMult(a,b): + """Returns the matrix multiplication of two matrices. Matrices + are represented as lists of lists, row-major.""" + r1 = range(len(a[0])) + r2 = range(len(b[0])) + return [[sum(r[i]*b[i][j] for i in r1) for j in r2] for r in a] + def calcBounds(array): """Return the bounding rectangle of a 2D points array as a tuple: (xMin, yMin, xMax, yMax) |