### Iterate and Access Glyphs Source: https://simoncozens.github.io/babelfont/Font.html Demonstrates how to iterate over the glyph list, append new glyphs, and access a specific glyph by its name using the font.glyphs property. ```python for g in font.glyphs: assert isinstance(g, Glyph) font.glyphs.append(newglyph) glyph_ampersand = font.glyphs["ampersand"] ``` -------------------------------- ### Shape() Source: https://simoncozens.github.io/babelfont/Shape.html Constructor for the Shape class. Initializes a new Shape object with optional parameters for reference, transform, nodes, closed state, direction, and format-specific data. ```APIDOC ## Shape() ### Description Creates a new Shape object. The Shape class represents a shape in a font, with optional parameters for reference, transform, nodes, closed state, direction, and format-specific data. ### Constructor Parameters - **ref** (str) - Optional - Reference string for the shape. Defaults to None. - **transform** (Transform) - Optional - Transformation applied to the shape. Defaults to None. - **nodes** ([Node]) - Optional - List of Node objects that make up the shape. Defaults to None. - **closed** (bool) - Optional - Indicates whether the shape is closed. Defaults to True. - **direction** (int) - Optional - Direction of the shape. Defaults to 1. - **_formatspecific** (dict) - Optional - Dictionary for storing format-specific information. Defaults to empty dict. - **_ (dict) - Optional - Additional dictionary. Defaults to None. ### Notes When writing to Babelfont-JSON, this class must be serialized without newlines. ``` -------------------------------- ### Shape._formatspecific Source: https://simoncozens.github.io/babelfont/Shape.html Property for storing format-specific information in a dictionary. ```APIDOC ## Shape._formatspecific ### Description Dictionary for storing format-specific information. Each object in Babelfont has an optional attached dictionary to allow the storage of format-specific information. Font creation software may store any additional information that they wish to have preserved on import and export under a namespaced (reverse-domain) key in this dictionary. For example, information specific to the Glyphs software should be stored under the key `com.glyphsapp`. The value stored under this key may be any data serializable in JSON; typically it will be a `dict`. ### Type dict ### Notes When stored to JSON, this key is exported not as `_formatspecific` but as a simple underscore (`_`). ``` -------------------------------- ### Shape.ref Source: https://simoncozens.github.io/babelfont/Shape.html Property representing the reference string of the Shape object. ```APIDOC ## Shape.ref ### Description Reference string for the shape. If not provided, defaults to None. ### Type str ``` -------------------------------- ### Shape.nodes Source: https://simoncozens.github.io/babelfont/Shape.html Property representing the list of Node objects that make up the Shape. ```APIDOC ## Shape.nodes ### Description List of Node objects that make up the shape. If not provided, defaults to None. ### Type [Node] ``` -------------------------------- ### Shape.transform Source: https://simoncozens.github.io/babelfont/Shape.html Property representing the transformation applied to the Shape object. ```APIDOC ## Shape.transform ### Description Transformation applied to the shape. If not provided, defaults to None. ### Type Transform ``` -------------------------------- ### Shape.direction Source: https://simoncozens.github.io/babelfont/Shape.html Property representing the direction of the Shape. ```APIDOC ## Shape.direction ### Description Direction of the shape. If not provided, defaults to 1. ### Type int ``` -------------------------------- ### Shape.closed Source: https://simoncozens.github.io/babelfont/Shape.html Property indicating whether the Shape is closed. ```APIDOC ## Shape.closed ### Description Indicates whether the shape is closed. If not provided, defaults to True. ### Type bool ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.