From 0b59a54a78ee22be83fe249c724c19ebd7d26ede Mon Sep 17 00:00:00 2001 From: Rod S Date: Fri, 25 Mar 2022 12:41:45 -0700 Subject: Update FontTools to 4.31.2 to gain access to iterSubTables. Needed to facilitate implementation of additional emoji font validation. Ran tools/external_updater/updater.sh update fonttools Bug: 226676748 Test: will run presubmit Test: m fontchain_lint Change-Id: I1207eea8394848bd2ef5040de9aebc8f940b1d96 --- Lib/fontTools/pens/basePen.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Lib/fontTools/pens/basePen.py') diff --git a/Lib/fontTools/pens/basePen.py b/Lib/fontTools/pens/basePen.py index 2161e021..e06c00ef 100644 --- a/Lib/fontTools/pens/basePen.py +++ b/Lib/fontTools/pens/basePen.py @@ -8,7 +8,7 @@ it is an abstraction for drawing outlines, making sure that outline objects don't need to know the details about how and where they're being drawn, and that drawings don't need to know the details of how outlines are stored. -The most basic pattern is this: +The most basic pattern is this:: outline.draw(pen) # 'outline' draws itself onto 'pen' @@ -21,13 +21,13 @@ The AbstractPen class defines the Pen protocol. It implements almost nothing (only no-op closePath() and endPath() methods), but is useful for documentation purposes. Subclassing it basically tells the reader: "this class implements the Pen protocol.". An examples of an AbstractPen -subclass is fontTools.pens.transformPen.TransformPen. +subclass is :py:class:`fontTools.pens.transformPen.TransformPen`. The BasePen class is a base implementation useful for pens that actually draw (for example a pen renders outlines using a native graphics engine). BasePen contains a lot of base functionality, making it very easy to build a pen that fully conforms to the pen protocol. Note that if you subclass -BasePen, you _don't_ override moveTo(), lineTo(), etc., but _moveTo(), +BasePen, you *don't* override moveTo(), lineTo(), etc., but _moveTo(), _lineTo(), etc. See the BasePen doc string for details. Examples of BasePen subclasses are fontTools.pens.boundsPen.BoundsPen and fontTools.pens.cocoaPen.CocoaPen. @@ -40,10 +40,14 @@ from typing import Tuple from fontTools.misc.loggingTools import LogMixin -__all__ = ["AbstractPen", "NullPen", "BasePen", +__all__ = ["AbstractPen", "NullPen", "BasePen", "PenError", "decomposeSuperBezierSegment", "decomposeQuadraticSegment"] +class PenError(Exception): + """Represents an error during penning.""" + + class AbstractPen: def moveTo(self, pt: Tuple[float, float]) -> None: @@ -147,7 +151,7 @@ class NullPen(AbstractPen): class LoggingPen(LogMixin, AbstractPen): - """A pen with a `log` property (see fontTools.misc.loggingTools.LogMixin) + """A pen with a ``log`` property (see fontTools.misc.loggingTools.LogMixin) """ pass -- cgit v1.2.3