Glyph¶
|
Represent the basis for a glyph object. |
|
Set the image in the glyph. |
Get all anchors in the glyph. |
|
|
Append an anchor to the glyph. |
|
Append a component to the glyph. |
|
Append the given contour's data to the glyph. |
|
Append data from other to new objects in the glyph. |
|
Append a guideline to the glyph. |
|
Get the area of the glyph |
|
Automatically order the glyph's contours based on heuristics. |
Use heuristics to set the Unicode values in the glyph. |
|
Get or set the glyph's bottom margin. |
|
Get the bounds of the glyph. |
|
|
Deprecated Glyph.box |
|
|
|
Tell the environment that something has changed in the object. |
|
Clear the glyph data. |
Clear all anchors in the glyph. |
|
Clear all components in the glyph. |
|
Clear all contours in the glyph. |
|
Clear all guidelines in the glyph. |
|
|
|
Remove the image from the glyph. |
|
|
|
|
|
Get all components in the glyph. |
|
Get all contours in the glyph. |
|
Copy data from the current glyph into a new glyph. |
|
|
|
|
|
|
Copy data from another glyph instance. |
|
Correct the winding direction of the glyph's contours. |
Decompose all components in the glyph to contours. |
|
|
Draw the glyph's outline data to the given pen object. |
|
Draw the glyph's outline data to the given point pen object. |
|
Return the glyph's contents as a string in GLIF format. |
Get the glyph's parent font object. |
|
|
Replace the glyph's data with the specified mathGlyph. |
|
|
|
|
|
Get the named layer from the glyph. |
|
|
Return a pen object for adding outline data to the glyph. |
|
Return a point pen object for adding outline data to the glyph. |
|
Get all guidelines in the glyph. |
|
Get or set the glyph's height. |
|
Get the image for the glyph. |
|
|
Interpolate all possible data in the glyph. |
|
Evaluate interpolation compatibility with another glyph. |
|
Check if the glyph is empty. |
Get or set the glyph's parent layer object. |
|
Get the layers of the glyph. |
|
Get or set the glyph's left margin. |
|
Get the font's lib object. |
|
|
Read data in GLIF format into the glyph. |
|
Deprecated Mark color |
Get or set the glyph's mark color. |
|
|
|
|
Move the object according to the given coordinates. |
Return the environment's native object wrapped by the current object. |
|
Get or set the name of the glyph. |
|
|
Create a new layer in the glyph. |
Get or set the glyph's note. |
|
|
Check if point lies inside the filled area of the glyph. |
|
Raise a |
|
|
|
Remove the given anchor from the glyph. |
|
Remove the specified component from the glyph. |
|
Remove the given contour from the glyph. |
|
Remove the given guideline from the glyph. |
|
Remove the specified layer from the glyph. |
Perform a remove overlap operation on the glyph's contours. |
|
Get or set the glyph's right margin. |
|
|
|
|
Rotate the object by the specified value. |
Round coordinates in the glyph to the nearest integer. |
|
|
|
|
Scale the glyph according to the given values. |
|
Get or set the object's selection state. |
|
Get or set the selected anchors in the glyph. |
|
Get or set the selected components in the glyph. |
|
Get or set the selected contours in the glyph. |
|
Get or set the selected guidelines in the glyph. |
|
|
|
|
|
|
|
Skew the object by the given value. |
|
Get the glyph's temporary lib object. |
|
Return the glyph as a fontMath |
Get or set the glyph's top margin. |
|
|
|
|
Transform the object according to the given matrix. |
|
|
Get or set the glyph's primary Unicode value. |
|
Get or set the glyph's Unicode values. |
|
|
|
Get or set the width of the glyph. |
|
|
Description¶
The Glyph object represents a glyph, its parts and associated data.
Glyph can be used as a list of Contour objects.
When a Glyph is obtained from a Font object, the font is the parent object of the glyph.
Overview¶
Copy¶
Copy data from the current glyph into a new glyph. |
Parents¶
Get or set the glyph's parent layer object. |
|
Get the glyph's parent font object. |
Identification¶
Get or set the name of the glyph. |
|
Get or set the glyph's Unicode values. |
|
Get or set the glyph's primary Unicode value. |
Metrics¶
Get or set the width of the glyph. |
|
Get or set the glyph's left margin. |
|
Get or set the glyph's right margin. |
|
Get or set the glyph's height. |
|
Get or set the glyph's bottom margin. |
|
Get or set the glyph's top margin. |
Queries¶
Get the bounds of the glyph. |
|
Check if point lies inside the filled area of the glyph. |
Pens and Drawing¶
Return a pen object for adding outline data to the glyph. |
|
Return a point pen object for adding outline data to the glyph. |
|
Draw the glyph's outline data to the given pen object. |
|
Draw the glyph's outline data to the given point pen object. |
Layers¶
Get the layers of the glyph. |
|
Get the named layer from the glyph. |
|
Create a new layer in the glyph. |
|
Remove the specified layer from the glyph. |
Global¶
Clear the glyph data. |
|
Append data from other to new objects in the glyph. |
Contours¶
Get all contours in the glyph. |
|
Get the number of contours in the glyph. |
|
Iterate through all contours in the glyph. |
|
Get the contour located at the given index from the glyph. |
|
Append the given contour's data to the glyph. |
|
Remove the given contour from the glyph. |
|
Clear all contours in the glyph. |
|
Perform a remove overlap operation on the glyph's contours. |
Components¶
Get all components in the glyph. |
|
Append a component to the glyph. |
|
Remove the specified component from the glyph. |
|
Clear all components in the glyph. |
|
Decompose all components in the glyph to contours. |
Anchors¶
Get all anchors in the glyph. |
|
Append an anchor to the glyph. |
|
Remove the given anchor from the glyph. |
|
Clear all anchors in the glyph. |
Guidelines¶
Get all guidelines in the glyph. |
|
Append a guideline to the glyph. |
|
Remove the given guideline from the glyph. |
|
Clear all guidelines in the glyph. |
Image¶
Get the image for the glyph. |
|
Set the image in the glyph. |
|
Remove the image from the glyph. |
Note¶
Get or set the glyph's note. |
|
Get or set the glyph's mark color. |
Sub-Objects¶
Get the font's lib object. |
|
|
Get the glyph's temporary lib object. |
Transformations¶
Transform the object according to the given matrix. |
|
Move the object according to the given coordinates. |
|
Scale the glyph according to the given values. |
|
Rotate the object by the specified value. |
|
Skew the object by the given value. |
Interpolation¶
Evaluate interpolation compatibility with another glyph. |
|
Interpolate all possible data in the glyph. |
Normalization¶
Round coordinates in the glyph to the nearest integer. |
|
Use heuristics to set the Unicode values in the glyph. |
Environment¶
Return the environment's native object wrapped by the current object. |
|
Tell the environment that something has changed in the object. |
Reference¶
- class fontParts.base.BaseGlyph(*args: Any, **kwargs: Any)[source]¶
Represent the basis for a glyph object.
This object will almost always be created by retrieving it from a font object.
Copy¶
Parents¶
Identification¶
- BaseGlyph.name: dynamicProperty¶
Get or set the name of the glyph.
The value must be a
str.- Returns:
A
strdefining the name of the glyph.- Raises:
ValueError – If attempting to set the name to one that already exists in the layer.
Example:
>>> glyph.name "A" >>> glyph.name = "A.alt"
- BaseGlyph.unicodes: dynamicProperty¶
Get or set the glyph’s Unicode values.
The value must be a
listortupleofintor hexadecimalstrvalues, ordered from most to least important.- Returns:
A
tupleofintvalues representing the glyphs Unicode values in order from most to least important.
Example:
>>> glyph.unicodes (65,) >>> glyph.unicodes = [65, 66] >>> glyph.unicodes = []
- BaseGlyph.unicode: dynamicProperty¶
Get or set the glyph’s primary Unicode value.
This property is equivalent to
glyph.unicodes[0]and will resetBaseGlyph.unicodesto atuplecontaining that value, or to an emptytupleif value isNone.The value must be an
int, a hexadecimalstrorNone.Example:
>>> glyph.unicode 65 >>> glyph.unicode = None None
Interaction with the
BaseGlyph.unicodesproperty:>>> glyph.unicodes (65, 67) >>> glyph.unicode = 65 >>> glyph.unicodes (65,) >>> glyph.unicode = None >>> glyph.unicodes ()
Metrics¶
- BaseGlyph.width: dynamicProperty¶
Get or set the width of the glyph.
The value must be an
intor afloat.Example:
>>> glyph.width 500 >>> glyph.width = 200
- BaseGlyph.leftMargin: dynamicProperty¶
Get or set the glyph’s left margin.
The value must be either an
intor afloat.Example:
>>> glyph.leftMargin 35 >>> glyph.leftMargin = 45
- BaseGlyph.rightMargin: dynamicProperty¶
Get or set the glyph’s right margin.
The value must be either an
intor afloat.Example:
>>> glyph.rightMargin 35 >>> glyph.rightMargin = 45
- BaseGlyph.height: dynamicProperty¶
Get or set the glyph’s height.
The value must be
intorfloat.Example:
>>> glyph.height 500 >>> glyph.height = 200
Queries¶
- BaseGlyph.bounds: dynamicProperty¶
Get the bounds of the glyph.
This property is read-only.
- Returns:
A
tupleof fourintorfloatvalues in the form(x minimum, y minimum, x maximum, y maximum)representing the bounds of the glyph, orNoneif the glyph is empty.
Example:
>>> glyph.bounds (10, 30, 765, 643)
- BaseGlyph.pointInside(point: list[int | float] | tuple[int | float, int | float]) bool[source]¶
Check if point lies inside the filled area of the glyph.
- Parameters:
point – The point to check as a Coordinate.
- Returns:
Trueif point is inside the filled area of the glyph,Falseotherwise.
Example:
>>> glyph.pointInside((40, 65)) True
Pens and Drawing¶
- BaseGlyph.getPen() AbstractPen[source]¶
Return a pen object for adding outline data to the glyph.
- Returns:
An instance of an
AbstractPensubclass.- Raises:
NotImplementedError – If the method has not been overridden by a subclass.
Example:
>>> pen = glyph.getPen()
- BaseGlyph.getPointPen() AbstractPointPen[source]¶
Return a point pen object for adding outline data to the glyph.
- Returns:
An instance of an
AbstractPointPensubclass.- Raises:
NotImplementedError – If the method has not been overridden by a subclass.
Example:
>>> pointPen = glyph.getPointPen()
- BaseGlyph.draw(pen: AbstractPen, contours: bool = True, components: bool = True) None[source]¶
Draw the glyph’s outline data to the given pen object.
- Parameters:
Example:
>>> glyph.draw(pen) >>> glyph.draw(pen, contours=False) >>> glyph.draw(pen, components=False)
- BaseGlyph.drawPoints(pen: AbstractPointPen, contours: bool = True, components: bool = True) None[source]¶
Draw the glyph’s outline data to the given point pen object.
- Parameters:
Example:
>>> glyph.drawPoints(pointPen) >>> glyph.drawPoints(pointPen, contours=False) >>> glyph.drawPoints(pointPen, components=False)
Layers¶
Layer interaction in glyphs is very similar to the layer interaction in fonts. When you ask a glyph for a layer, you get a glyph layer in return. A glyph layer lets you do anything that you can do to a glyph. In fact a glyph layer is really just a glyph.
>>> bgdGlyph = glyph.newLayer('background')
>>> bgdGlyph.appendGlyph(glyph)
>>> bgdGlyph.appendGuideline((10, 10), 45)
- BaseGlyph.layers: dynamicProperty¶
Get the layers of the glyph.
This property is read-only.
Example:
>>> glyphLayers = glyph.layers
- BaseGlyph.getLayer(name: str) BaseGlyph[source]¶
Get the named layer from the glyph.
- Parameters:
name – The name of the
BaseLayerinstance to retrieve.- Returns:
The specified
BaseLayerinstance.- Raises:
ValueError – If no layer with the given name exists in the font.
Example:
>>> glyphLayer = glyph.getLayer("foreground")
- BaseGlyph.newLayer(name: str) BaseGlyph[source]¶
Create a new layer in the glyph.
If the named layer already exists in the glyph, it will be cleared.
- Parameters:
name – The name of the new layer to create.
- Returns:
A newly created
BaseLayerinstance.
Example:
>>> glyphLayer = glyph.newLayer("background")
Global¶
- BaseGlyph.clear(contours: bool = True, components: bool = True, anchors: bool = True, guidelines: bool = True, image: bool = True) None[source]¶
Clear the glyph data.
This will clear:
The clearing of portions of the glyph may be turned off with the listed parameters.
- Parameters:
contours – Whether to clear the glyph’s contour data. Defaults to
Truecomponents – Whether to clear the glyph’s component data. Defaults to
Trueanchors – Whether to clear the glyph’s anchor data. Defaults to
Trueguidelines – Whether to clear the glyph’s guideline data. Defaults to
Trueimage – Whether to clear the glyph’s image data. Defaults to
True
Example:
>>> glyph.clear() >>> glyph.clear(guidelines=False)
- BaseGlyph.appendGlyph(other: BaseGlyph, offset: list[int | float] | tuple[int | float, int | float] | None = None) None[source]¶
Append data from other to new objects in the glyph.
This will append:
- Parameters:
other – The
BaseGlyphinstace containing the source data to append.offset – The x and y shift values to be applied to the appended data as a Coordinate, or
Nonerepresenting an offset of(0, 0).
Example:
>>> glyph.appendGlyph(otherGlyph) >>> glyph.appendGlyph(otherGlyph, (100, 0))
Contours¶
- BaseGlyph.contours: dynamicProperty¶
Get all contours in the glyph.
This property is read-only.
- Returns:
A
tupleofBaseContourobjects.
Example:
>>> contours = glyph.contours
- BaseGlyph.__len__() int[source]¶
Get the number of contours in the glyph.
- Returns:
An
intrepresenting the number of contours in the glyph.
Example:
>>> len(glyph) 2
- BaseGlyph.__iter__() Iterator[BaseContour][source]¶
Iterate through all contours in the glyph.
- Returns:
An iterator of
BaseContourinstances.
Example:
>>> for contour in glyph: ... contour.reverse()
- BaseGlyph.__getitem__(index: int) BaseContour[source]¶
Get the contour located at the given index from the glyph.
- Parameters:
index – The index of the glyph to return as an
int.- Returns:
An instance of the
BaseContourclass.
Example:
>>> contour = glyph[0]
- BaseGlyph.appendContour(contour: BaseContour, offset: CoordinateLike | None = None) BaseContour[source]¶
Append the given contour’s data to the glyph.
- Parameters:
contour – The
BaseContourinstace containing the source data to append.offset – The x and y shift values to be applied to the appended data as a Coordinate, or
Nonerepresenting an offset of(0, 0).
- Returns:
A
BaseContourinstance containing the appended data.
Example:
>>> contour = glyph.appendContour(contour) >>> contour = glyph.appendContour(contour, (100, 0))
- BaseGlyph.removeContour(contour: BaseContour | int) None[source]¶
Remove the given contour from the glyph.
- Parameters:
contour – The contour to remove as a
BaseContourinstance or anintrepresenting a contour index.- Raises:
ValueError – If no contour can be found at the given index.
Example:
>>> glyph.removeContour(contour)
Components¶
- BaseGlyph.components: dynamicProperty¶
Get all components in the glyph.
This property is read-only.
- Returns:
A
tupleofBaseComponentinstances.
Example:
>>> components = glyph.components
- BaseGlyph.appendComponent(baseGlyph: str | None = None, offset: CoordinateLike | None = None, scale: ScaleFactorLike | None = None, component: BaseComponent | None = None) BaseComponent[source]¶
Append a component to the glyph.
If baseGlyph, offset or scale is specified, those values will be used instead of the values in the given component.
- Parameters:
baseGlyph – An optional glyph name to append as a component. Defaults to
None.offset – The x and y shift values to be applied to the appended data as a Coordinate, or
Nonerepresenting an offset of(0, 0). Defaults toNonescale – The x and y scale values that should be applied to the appended component as a
tupleofintorfloatvalues, orNonerepresenting a scale of(1.0, 1.0). Defaults toNonecomponent – An optional
BaseComponentinstance from which to copy attribute values. Defaults toNone.
- Returns:
The newly appended
BaseComponentinstance.- Raises:
FontPartsError – If the baseGlyph refers to the current glyph instance, which would result in a component referencing itself. This is not permitted.
Example:
>>> component = glyph.appendComponent("A") >>> component = glyph.appendComponent("A", offset=(10, 20)) >>> component = glyph.appendComponent("A", scale=(1.0, 2.0))
- BaseGlyph.removeComponent(component: BaseComponent | int) None[source]¶
Remove the specified component from the glyph.
- Parameters:
component – The component to remove as a
BaseComponentinstance or anintrepresenting the component’s index.- Raises:
ValueError – If no component can be found at the given index.
Example:
>>> glyph.removeComponent(component)
Anchors¶
- BaseGlyph.anchors: dynamicProperty¶
Get all anchors in the glyph.
This property is read-only.
- Returns:
A
tupleofBaseAnchorinstances.
Example:
>>> anchors = glyph.anchors
- BaseGlyph.appendAnchor(name: str | None = None, position: CoordinateLike | None = None, color: RGBALike | None = None, anchor: BaseAnchor | None = None) BaseAnchor[source]¶
Append an anchor to the glyph.
If name, position or color are specified, those values will be used instead of the values in the given anchor object.
- Parameters:
name – An optional name to be assigned to the anchor as a
str. Defaults toNone.position – The optional x and y location to be applied to the anchor as a Coordinate. Defaults to
None.color – The optional color to be applied to the anchor as a Color. Defaults to
None.anchor – An optional
BaseAnchorinstance from which attribute values will be copied. Defualts toNone.
- Returns:
The newly appended
BaseAnchorinstance.
Example:
>>> anchor = glyph.appendAnchor("top", (10, 20)) >>> anchor = glyph.appendAnchor("top", (10, 20), color=(1, 0, 0, 1))
- BaseGlyph.removeAnchor(anchor: BaseAnchor | int) None[source]¶
Remove the given anchor from the glyph.
- Parameters:
anchor – The anchor to remove as a
BaseAnchorintance, or anintrepresenting the anchor’s index.- Raises:
ValueError – If no anchor can be found at the given index.
Example:
>>> glyph.removeAnchor(anchor)
Guidelines¶
- BaseGlyph.guidelines: dynamicProperty¶
Get all guidelines in the glyph.
This property is read-only.
- Returns:
A
tupleofBaseGuidelineinstances.
Example:
>>> guidelines = glyph.guidelines
- BaseGlyph.appendGuideline(position: CoordinateLike | None = None, angle: IntFloatType | None = None, name: str | None = None, color: RGBALike | None = None, guideline: BaseGuideline | None = None) BaseGuideline[source]¶
Append a guideline to the glyph.
If name, position or color are specified, those values will be used instead of the values in the given guideline object.
- Parameters:
position – The optional x and y location to be applied to the guideline as a Coordinate. Defaults to
None.angle – The optional angle to be applied to the guideline as
intorfloat. Defaults toNone.name – An optional name to be assigned to the guideline as a
str. Defaults toNone.color – The optional color to be applied to the guideline as a Color. Defaults to
None.guideline – An optional
BaseGuidelineinstance from which attribute values will be copied. Defualts toNone.
- Returns:
The newly appended
BaseGuidelineinstance.
Example:
>>> anchor = glyph.appendGuideline("top", (10, 20)) >>> anchor = glyph.appendGuideline("top", (10, 20), color=(1, 0, 0, 1))
- BaseGlyph.removeGuideline(guideline: BaseGuideline | int) None[source]¶
Remove the given guideline from the glyph.
- Parameters:
guideline – The guideline to remove as a
BaseGuidelineintance, or anintrepresenting the guideline’s index.- Raises:
ValueError – If no guideline can be found at the given index.
Example:
>>> glyph.removeGuideline(guideline)
Image¶
- BaseGlyph.image: dynamicProperty¶
Get the image for the glyph.
This property is read-only.
- Returns:
The
BaseImageinstance belonging to the glyph.
- BaseGlyph.addImage(path: str | None = None, data: bytes | None = None, scale: ScaleFactorLike | None = None, position: CoordinateLike | None = None, color: RGBALike | None = None) BaseImage[source]¶
Set the image in the glyph.
The image data may be provided as either the path to an image file or directly as raw image data. The supported image formats will vary across environments. Refer to
BaseImagefor complete details.- Parameters:
path – The optional path to the image file to add to the glyph as a
str. Defaults toNone.data – The optional raw image data to add to the glyph as
bytes. Defaults toNone.scale – The optional x and y values to scale the glyph by as a
tupleof twointorfloatvalues. Defaults toNone.position – The optional location of the lower left point of the image as a Coordinate. Defaults to
None.color – The optional color to be applied to the image as a Color. Defaults to
None.
- Returns:
The
BaseImageinstance added to the glyph.- Raises:
IOError – If no valid image file can be found at the given path.
FontPartsError – If path and data are both provided.
Add the image as a filepath:
>>> image = glyph.addImage(path="/path/to/my/image.png")
Add the image as raw data:
>>> image = glyph.addImage(data=someImageData)
Add the image with scale:
>>> image = glyph.addImage(path="/p/t/image.png", scale=(0.5, 1.0))
Add the image with position:
>>> image = glyph.addImage(path="/p/t/image.png", position=(10, 20))
Add the image with color:
>>> image = glyph.addImage(path="/p/t/image.png", color=(1, 0, 0, 0.5))
Note¶
Sub-Objects¶
Transformations¶
- BaseGlyph.transformBy(matrix: list[int | float] | tuple[float, float, float, float, float, float], origin: list[int | float] | tuple[int | float, int | float] | None = None) None¶
Transform the object according to the given matrix.
- Parameters:
matrix – The Transformation Matrix to apply.
origin – The optional point at which the transformation should originate as a:ref:type-coordinate. Defaults to
None, representing an origin of(0, 0).
Example:
>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0)) >>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0), origin=(500, 500))
- BaseGlyph.moveBy(value: list[int | float] | tuple[int | float, int | float]) None¶
Move the object according to the given coordinates.
- Parameters:
value – The x and y values to move the object by as a Coordinate.
Example:
>>> obj.moveBy((10, 0))
- BaseGlyph.scaleBy(value: int | float | list[int | float] | tuple[float, float], origin: list[int | float] | tuple[int | float, int | float] | None = None, width: bool = False, height: bool = False) None[source]¶
Scale the glyph according to the given values.
- Parameters:
value – The x and y values to scale the glyph by as a
tupleof twointorfloatvalues.origin – The optional point at which the scale should originate as a Coordinate. This must not be set when scaling the width or height. Defaults to
None, representing an origin of(0, 0).width – Whether the glyph’s width should be scaled. Defaults to
False.height – Whether the glyph’s height should be scaled. Defaults to
False.
- Raises:
FontPartsError – If the origin is specified while width or height are set to
True.
Example:
>>> glyph.scaleBy(2.0) >>> glyph.scaleBy((0.5, 2.0), origin=(500, 500))
- BaseGlyph.rotateBy(value: int | float, origin: list[int | float] | tuple[int | float, int | float] | None = None) None¶
Rotate the object by the specified value.
- Parameters:
value – The angle at which to rotate the object as an
intor afloat.origin – The optional point at which the rotation should originate as a Coordinate. Defaults to
None, representing an origin of(0, 0).
Example:
>>> obj.rotateBy(45) >>> obj.rotateBy(45, origin=(500, 500))
- BaseGlyph.skewBy(value: int | float | list[int | float] | tuple[float, float], origin: list[int | float] | tuple[int | float, int | float] | None = None) None¶
Skew the object by the given value.
- Parameters:
value – The value by which to skew the object as either a single
intorfloatcorresponding to the x direction, or atupleof twointorfloatvalues corresponding to the x and y directions.origin – The optional point at which the rotation should originate as a Coordinate. Defaults to
None, representing an origin of(0, 0).
Example:
>>> obj.skewBy(11) >>> obj.skewBy((25, 10), origin=(500, 500))
Interpolation¶
- BaseGlyph.isCompatible(other: BaseGlyph, cls=None) tuple[bool, GlyphCompatibilityReporter][source]¶
Evaluate interpolation compatibility with another glyph.
- BaseGlyph.interpolate(factor: int | float | list[int | float] | tuple[float, float], minGlyph: BaseGlyph, maxGlyph: BaseGlyph, round: bool = True, suppressError: bool = True) None[source]¶
Interpolate all possible data in the glyph.
- Parameters:
factor – The interpolation value as a single
intorfloator atupleof twointorfloatvalues representing the factors(x, y).minGlyph – The
BaseGlyphinstance corresponding to the 0.0 position in the interpolation.maxGlyph – The
BaseGlyphinstance corresponding to the 1.0 position in the interpolation.round – A
boolindicating whether the result should be rounded to integers. Defaults toTrue.suppressError – A
boolindicating whether to ignore incompatible data or raise an error when such incompatibilities are found. Defaults toTrue.
- Raises:
TypeError – If minGlyph or maxGlyph are not instances of
BaseGlyph.
Example:
>>> glyph.interpolate(0.5, otherGlyph1, otherGlyph2) >>> glyph.interpolate((0.5, 2.0), otherGlyph1, otherGlyph2, round=False)
Normalization¶
Environment¶
- BaseGlyph.naked() Any¶
Return the environment’s native object wrapped by the current object.
- Raises:
NotImplementedError – If the method has not been overridden by a subclass.
Example:
>>> loweLevelObj = obj.naked()