FL.Glyph
Glyph
Glyph - class to represent glyph
CONSTRUCTOR: Glyph() - generic constructor, creates an empty glyph Glyph(Glyph) - copy constructor Glyph(masterscount) - creates a glyph with 'masterscount' number of masters Glyph(masterscount, [Node, ...]) - creates a glyph with 'masterscount' number of masters and assigns a list of nodes
ATTRIBUTES: parent (read-only) - Glyph's parent object nodes [Node] - list of Nodes customdata (string) - custom data defined for this glyph note (string) - note defined for this glyph mark (integer) - True if glyph is marked anchors [Anchor] - list of anchors hhints [Hint] - list of horizontal hints vhints [Hint] - list of vertical hints hlinks [Link] - list of horizontal links vlinks [Link] - list of vertical links components [Component] - list of componets replace_table [Replace] - hint replacing program, list of Replace objects kerning [KerningPair] - list of kerning pairs layers_number (integer) - number of masters flags (integer) - flags set for this glyph nodes_number (integer) - number of nodes, same as 'len(Glyph)' width (integer) - advance width for the first master height (integer) - advance height for the first master unicode (integer) - first Unicode index in integer form unicodes [integer] - list of Unicode indexes name (string) - glyph name mask (string) - mask
STORED TRUETYPE DATA advance_width (integer) advance_height (integer) left_side_bearing (integer) top_side_bearing (integer) y_pels (integer) bounding_box (Rect) number_of_contours (integer) end_points [integer] points [TTPoint] instructions [Byte] hdmx[Byte]
OPERATIONS: len() - returns number of nodes in the glyph [] - can be used to access individial nodes slice - can be used to access portion of the glyph's nodes array + or concatination - can be used to append Glyph, Node or sequence of Nodes multiply - second operand must be Matrix, applies matrix transformation to a glyph
METHODS Assign (Glyph) - copies all information from the assigned glyph Transform(Matrix m) - applies Matrix transformation to the Glyph (see Matrix().doc) SetLayersNumber(mastersnumber) - changes the number of masters, is applicable only to glyphs that have no parent Clear() - removes all nodes Add - refer to '+' operator Insert (Node | Glyph | [Node]) | (Node | Glyph | [Node], nodeindex) - inserts Node, Glyph or sequence of Nodes at the begining of glyph's nodes or at specified node index Present (style) - returns True if a layer or a combination of layers are present in the glyph Delete (index) | (index0, index1) - removes node or range of nodes ExpandLayer (masterindex) - expands selected master to all other masters Shift (Point) | (Point, masterindex) - shifts positions of all nodes at first or specified master Scale (Point(float) scale) | (Point(float) scale, Point center) | (Point(float) scale, Point center, masterindex) - scales the glyph Layer (masterindex) - returns list of Points for all nodes for the selected master Section (masterindex, pointindex, nodetype) - returns list of Points that conform to selected options MoveNode(...) - moves the node copying Edit tool behavior (see User manual for details) DeleteNode(nodeindex) - removes the node InsertNode(nodeindex) | (nodeindex, float time) | (nodeindex, float time, masterindex) - insers new node on a contour SELECTION OPERATIONS Selection() - returns list of selected nodes SelectAll() - selects all nodes UnselectAll() - deselects all nodes InvertSelection() - selects unselected nodes and deselects selected nodes isAnySelected() - returns True if at least one node is selected SelectedCount() - returns number of selected nodes SelectRect(Rect r) | (Rect r, masterindex) - selects all nodes that are inside the rectangle UnselectRect(Rect r) | (Rect r, masterindex) - deselects all nodes that are inside the rectangle DeleteSelected() - deletes all selected nodes
METRICS AND BBOX OPERATIONS GetBoundingRect() | (masterindex) - returns Rect - bounding box of the glyph GetMetrics() | (masterindex) - returns glyph advance width and advance height in a form of Point SetMetrics(Point p) | (Point p, masterindex) - assigns new values to the width and height of the glyph GetVSB() | (masterindex) - returns glyph bottom sidebearing position SetVSB(value) | (value, masterindex) - assigns new values to the bottom sidebearing of the glyph
OVERLAP OPERATIONS RemoveOverlap() | (masterindex) - removes overlap Badd(Glyph g) | ([Node]) | (Glyph g, masterindex) | ([Node], masterindex) - performs bollean Add operation with the glyph or list of nodes Bsubtract(Glyph g) | ([Node]) | (Glyph g, masterindex) | ([Node], masterindex) - performs bollean Subtract operation with the glyph or list of nodes Bintersect(Glyph g) | ([Node]) | (Glyph g, masterindex) | ([Node], masterindex) - performs bollean Insersect operation with the glyph or list of nodes
OPERATIONS ON CONTOURS GetContoursNumber() - returns number of contours in the glyph GetContourBegin(contourindex) - returns index of the first node for a contour GetContourLength(contourindex) - returns number of nodes in a contour SelectContour(contourindex) - selects all nodes in the contour DeleteContour(contourindex) - removes contour ReverseContour(contourindex) - reverses contour's direction ReorderContour(contourindex, newindex) - reorders contours in the glyph isContourClockwise(contourindex) - returns True if direction of contour is clockwise SetStartNode(nodeindex) - makes the node a starting node of the contour FindContour(nodeindex) - returns number of contour containing the 'nodeindex'
HINTS OPERATIONS RemoveHints(mode) - removes hints and links Autohint() | (masterindex) - automatically generates Type 1 hints
ANCHOR OPERATIONS FindAnchor(string name) - finds anchor by name
TRANSFORMATION ACTIONS Decompose() - pastes all components to the glyph outline MakeExtremeNodes() | (masterindex) - automatically detects and adds extreme nodes Audit() | (masterindex) - performs test of the glyph and returns list of AuditRecord objects Iterate(Iterator) - iterates glyph trough iterator class which must unclude following methods: Start(); ClosePath(); StartPath(Node); LineTo(Node); CurveTo(Node); SplineTo(Node); Finish() Rotate3D Extrude3D(outlinewidth, shift_x, shift_y) Shadow(outlinewidth, shift_x, shift_y) College(outlinewidth, distance) Gradient(outlinewidth, direction, stripes_number, start_y, finish_y) Distance(width_x, width_y, cornermode) | (width_x, width_y, cornermode, Glyph dest) Interpolate([(nodeindex, Point newposition]) Warp([Point], float force) Rasterize() | Rasterize(Image, [, active layer[, height]]) | Rasterize(Image, [, WeightVector[, height]]) - rasterizes glyph to the Image or to glyph's background. Returns resulting image_rect. Height is relative to font's UPM Blend(Glyph source, integer layer1, integer layer2, Point amount) - returns blend of the glyph and source JoinAll() - tries to join all open contours SaveEPS(string filename) | (string filename, layer) - writes layer into the EPS file named filename LoadEPS(string filename) - reads EPS from filename and returns Glyph object. Use Assign method to replace current glyph with the loaded outline R([Point], float force)
Native bases: object
Captured native MRO: Glyph, object
Native new allocation evidence (not an init overload): (args, *kwargs) Create and return a new object. See help(type) for accurate signature.
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
Add |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Add; argument details are not documented. |
Assign |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Assign; argument details are not documented. |
Audit |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Audit; argument details are not documented. |
Autohint |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Autohint; argument details are not documented. |
Badd |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Badd; argument details are not documented. |
Bintersect |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Bintersect; argument details are not documented. |
Blend |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Blend; argument details are not documented. |
Bsubtract |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Bsubtract; argument details are not documented. |
Clear |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Clear; argument details are not documented. |
College |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.College; argument details are not documented. |
Decompose |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Decompose; argument details are not documented. |
Delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Delete; argument details are not documented. |
DeleteContour |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.DeleteContour; argument details are not documented. |
DeleteNode |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.DeleteNode; argument details are not documented. |
DeleteSelected |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.DeleteSelected; argument details are not documented. |
Distance |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Distance; argument details are not documented. |
EditMask |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.EditMask; argument details are not documented. |
ExchangeMask |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.ExchangeMask; argument details are not documented. |
ExpandLayer |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.ExpandLayer; argument details are not documented. |
Extrude3D |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Extrude3D; argument details are not documented. |
FindAnchor |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.FindAnchor; argument details are not documented. |
FindContour |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.FindContour; argument details are not documented. |
GetBoundingRect |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.GetBoundingRect; argument details are not documented. |
GetContourBegin |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.GetContourBegin; argument details are not documented. |
GetContourLength |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.GetContourLength; argument details are not documented. |
GetContoursNumber |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.GetContoursNumber; argument details are not documented. |
GetMetrics |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.GetMetrics; argument details are not documented. |
Gradient |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Gradient; argument details are not documented. |
Insert |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Insert; argument details are not documented. |
InsertNode |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.InsertNode; argument details are not documented. |
Interpolate |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Interpolate; argument details are not documented. |
InvertSelection |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.InvertSelection; argument details are not documented. |
Iterate |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Iterate; argument details are not documented. |
JoinAll |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.JoinAll; argument details are not documented. |
Layer |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Layer; argument details are not documented. |
LoadEPS |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.LoadEPS; argument details are not documented. |
MakeExtremeNodes |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.MakeExtremeNodes; argument details are not documented. |
MoveNode |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.MoveNode; argument details are not documented. |
Present |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Present; argument details are not documented. |
Rasterize |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Rasterize; argument details are not documented. |
RemoveHints |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.RemoveHints; argument details are not documented. |
RemoveOverlap |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.RemoveOverlap; argument details are not documented. |
ReorderContour |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.ReorderContour; argument details are not documented. |
ReverseContour |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.ReverseContour; argument details are not documented. |
Rotate3D |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Rotate3D; argument details are not documented. |
SaveEPS |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SaveEPS; argument details are not documented. |
Scale |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Scale; argument details are not documented. |
Section |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Section; argument details are not documented. |
SelectAll |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SelectAll; argument details are not documented. |
SelectContour |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SelectContour; argument details are not documented. |
SelectRect |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SelectRect; argument details are not documented. |
SelectedCount |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SelectedCount; argument details are not documented. |
Selection |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Selection; argument details are not documented. |
SetLayersNumber |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SetLayersNumber; argument details are not documented. |
SetMetrics |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SetMetrics; argument details are not documented. |
SetStartNode |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.SetStartNode; argument details are not documented. |
Shadow |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Shadow; argument details are not documented. |
Shift |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Shift; argument details are not documented. |
Transform |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Transform; argument details are not documented. |
UnselectAll |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.UnselectAll; argument details are not documented. |
UnselectRect |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.UnselectRect; argument details are not documented. |
Warp |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.Warp; argument details are not documented. |
__init__ |
function | (self, /, *args: Any, **kwargs: Any) -> None |
Initialize self. (shared captured text) |
clear |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.clear; argument details are not documented. |
isAnySelected |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.isAnySelected; argument details are not documented. |
isContourClockwise |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native FL.Glyph.isContourClockwise; argument details are not documented. |