FL.objects.Component.Component
- class FL.objects.Component.Component(component_or_index: Component | int | None = None, delta: Point | None = None, scale: Point | None = None)
Bases:
CopyableComponent - class to represent glyph component
Components are defined by the glyph index which they reference, Shift of components origin point and scale factor of a component Scale is measured in relation to 1.0, so 100% scale is 1.0 and 60% - 0.6 This class is Multiple Master - compatible
- __init__(component_or_index: Component | int | None = None, delta: Point | None = None, scale: Point | None = None) None
- Component()
generic constructor, creates an empty Component
- Component(Component)
copy constructor
- Component(index)
creates component referencing glyph index with zero shift and 100% scale
- Component(index, Point(integer) delta)
creates component referencing glyph index with delta shift and 100% scale
- Component(index, Point(integer) delta, Point(float) scale)
creates component referencing glyph index with delta shift and scale factor defined by scale
Methods
Get([f])Creates a glyph from component applying delta and scale transformations.
Paste()Appends component to a parent glyph as a set of outlines.
__init__([component_or_index, delta, scale])Component()
fake_deserialize(num_masters, data)fake_serialize()Attributes
deltalist of shift values for each master
referencing glyph index
parent object, Glyph
scale factor
list of scale values for each master
- Get(f: Font | None = None) Glyph
Creates a glyph from component applying delta and scale transformations.
Font parameter is not needed when component has a parent FIXME: Apparently, the font parameter is always needed
- Parameters:
f (Font | None, optional) – _description_. Defaults to None.
- Paste() None
Appends component to a parent glyph as a set of outlines.
Component must have a parent