Skip to content

typerig.proxy.pens.outlinePen

typerig.proxy.pens.outlinePen (version 0.1.3)

#FLM: Refactor: Outline Pen
# MODULE: Typerig / Proxy / Pen / Outline Pen (Pen)
# -----------------------------------------------------------
# (C) Vassil Kateliev, 2019-2020        (http://www.kateliev.com)
# (C) Karandash Type Foundry            (http://www.karandash.eu)
#------------------------------------------------------------
# www.typerig.com

Modules

  • fontgate
  • fontlab
  • math

Classes

class OutlinePen(fontTools.pens.basePen.BasePen)

OutlinePen (protocol)
Adapted from: Frederik Berlaen's (Typemytype) outlinerRoboFontExtension
Original Source: https://github.com/typemytype/outlinerRoboFontExtension

Attribs:
- offset (float): Outline offset
- contrast (float): Outline Contrast
- contrastAngle (float): Outline contrast angle
- connection (string): Connection type - square; 
- cap (string): Cap type - round
- closeOpenPaths (bool): Close open paths
- optimizeCurve (bool): Optimize curve (adds an extra point of every curve at .5 time)
- filterDoubles (bool): Filter double nodes
- miterLimit (float): Sets miter limit

Returns:
- getGlyphs(): innerGlyph, outerGlyph, originalGlyph,(fgGlyph)
- getShapes():  innerShape, outerShape, originalShape (flShape)
- getContours(): innerContour, outerContour, originalContour (flShape)

Methods

__init__(self, **kwargs)


buildCap(self, firstContour, lastContour)
# - Line Caps --------------------------------
buildConnection(self, close=False)
# -- Connections --------------------------------
capButt(self, firstContour, lastContour, first, last, angle)


capRound(self, firstContour, lastContour, first, last, angle)


capSquare(self, firstContour, lastContour, first, last, angle)


connectionButt(self, first, last, pen, close)


connectionInnerCorner(self, first, last, pen, close)


connectionRound(self, first, last, pen, close)


connectionSquare(self, first, last, pen, close)


getGlyphs(self)
# - Output -----------------------------------------------
getShapes(self)


getThickness(self, angle)
# -- Thickness

Attributes

magicCurve = 0.5522847498
pointClass = <class 'typerig.proxy.pens.outlinePen.altPoint'>

Methods from fontTools.pens.basePen.BasePen

closePath(self)


curveTo(self, *points)


endPath(self)


lineTo(self, pt)


moveTo(self, pt)


qCurveTo(self, *points)


Methods from fontTools.pens.basePen.DecomposingPen

addComponent(self, glyphName, transformation)
Transform the points of the base glyph and draw it onto self.

Attributes from fontTools.pens.basePen.DecomposingPen

skipMissingComponents = True

Descriptors from fontTools.misc.loggingTools.LogMixin

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
log

class altPoint(typerig.core.objects.point.Point)

# - Classes ------------------------------

Methods

__eq__(self, p)


__getitem__(self, index)


__init__(self, x, y=None)


__iter__(self)


__ne__(self, p)


Descriptors

fgPoint

Methods from typerig.core.objects.point.Point

__abs__(self)


__add__(self, other)
# -- Operators
__and__(self, other)
self & other: Used as for Scalar product
__div__(self, other)


__mul__(self, other)


__neg__(self)


__or__(self, other)
self | other: Used as for Cross product
__rdiv__ = __div__(self, other)


__repr__(self)


__rmul__ = __mul__(self, other)


__sub__(self, other)


__truediv__ = __div__(self, other)


angle_to(self, other, add=90)
Angle to another point in radians
diff_to(self, other)


doFlip(self, sign=(True, True))


doSwap(self)
# -- Modifiers
doTransform(self, transform=None)


solve_width(self, y=0)
Get width - find adjacent X by opposite Y
solve_x(self, y)


solve_y(self, x)


Descriptors from typerig.core.objects.point.Point

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
angle
magnitude
slope
swap
tuple
unit
y_intercept

OutlinePen

typerig.proxy.pens.outlinePen.OutlinePen = class OutlinePen(fontTools.pens.basePen.BasePen)

OutlinePen (protocol)
Adapted from: Frederik Berlaen's (Typemytype) outlinerRoboFontExtension
Original Source: https://github.com/typemytype/outlinerRoboFontExtension

Attribs:
- offset (float): Outline offset
- contrast (float): Outline Contrast
- contrastAngle (float): Outline contrast angle
- connection (string): Connection type - square; 
- cap (string): Cap type - round
- closeOpenPaths (bool): Close open paths
- optimizeCurve (bool): Optimize curve (adds an extra point of every curve at .5 time)
- filterDoubles (bool): Filter double nodes
- miterLimit (float): Sets miter limit

Returns:
- getGlyphs(): innerGlyph, outerGlyph, originalGlyph,(fgGlyph)
- getShapes():  innerShape, outerShape, originalShape (flShape)
- getContours(): innerContour, outerContour, originalContour (flShape)

Methods

__init__(self, **kwargs)


buildCap(self, firstContour, lastContour)
# - Line Caps --------------------------------
buildConnection(self, close=False)
# -- Connections --------------------------------
capButt(self, firstContour, lastContour, first, last, angle)


capRound(self, firstContour, lastContour, first, last, angle)


capSquare(self, firstContour, lastContour, first, last, angle)


connectionButt(self, first, last, pen, close)


connectionInnerCorner(self, first, last, pen, close)


connectionRound(self, first, last, pen, close)


connectionSquare(self, first, last, pen, close)


getGlyphs(self)
# - Output -----------------------------------------------
getShapes(self)


getThickness(self, angle)
# -- Thickness

Attributes

magicCurve = 0.5522847498
pointClass = <class 'typerig.proxy.pens.outlinePen.altPoint'>

Methods from fontTools.pens.basePen.BasePen

closePath(self)


curveTo(self, *points)


endPath(self)


lineTo(self, pt)


moveTo(self, pt)


qCurveTo(self, *points)


Methods from fontTools.pens.basePen.DecomposingPen

addComponent(self, glyphName, transformation)
Transform the points of the base glyph and draw it onto self.

Attributes from fontTools.pens.basePen.DecomposingPen

skipMissingComponents = True

Descriptors from fontTools.misc.loggingTools.LogMixin

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
log

magicCurve

typerig.proxy.pens.outlinePen.OutlinePen.magicCurve = 0.5522847498