arrayTools¶
-
fontTools.misc.arrayTools.
calcBounds
(array)[source]¶ Return the bounding rectangle of a 2D points array as a tuple: (xMin, yMin, xMax, yMax)
-
fontTools.misc.arrayTools.
calcIntBounds
(array)[source]¶ Return the integer bounding rectangle of a 2D points array as a tuple: (xMin, yMin, xMax, yMax) Values are rounded to closest integer.
-
fontTools.misc.arrayTools.
insetRect
(rect, dx, dy)[source]¶ Inset the rectangle by dx, dy on all sides.
-
fontTools.misc.arrayTools.
intRect
(rect1)[source]¶ Return the rectangle, rounded off to integer values, but guaranteeing that the resulting rectangle is NOT smaller than the original.
-
fontTools.misc.arrayTools.
normRect
(rect)[source]¶ Normalize the rectangle so that the following holds: xMin <= xMax and yMin <= yMax
-
fontTools.misc.arrayTools.
pointInRect
(p, rect)[source]¶ Return True when point (x, y) is inside rect.
-
fontTools.misc.arrayTools.
pointsInRect
(array, rect)[source]¶ Find out which points or array are inside rect. Returns an array with a boolean for each point.
-
fontTools.misc.arrayTools.
rectCenter
(rect0)[source]¶ Return the center of the rectangle as an (x, y) coordinate.
-
fontTools.misc.arrayTools.
sectRect
(rect1, rect2)[source]¶ Return a boolean and a rectangle. If the input rectangles intersect, return True and the intersecting rectangle. Return False and (0, 0, 0, 0) if the input rectangles don’t intersect.
-
fontTools.misc.arrayTools.
unionRect
(rect1, rect2)[source]¶ Return the smallest rectangle in which both input rectangles are fully enclosed. In other words, return the total bounding rectangle of both input rectangles.