### Guide Class Constructor Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Guide.html Creates a Guide object. Use the generic constructor for a guide with zero coordinates, or provide position and angle for specific initialization. A copy constructor is also available. ```python Guide() Guide(Guide) Guide(position) Guide(position, angle) ``` -------------------------------- ### flGuideLine.createPowerGuides Static Method Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flGuideLine.html Creates power guides for a font, layer, and specified orientations. Optional parameters control the use of glyph and font guides. This is a static method. ```python bool createPowerGuides(fgFont, flLayer, bool horizontal, bool vertical, bool diagonal[, bool use_glyph_guides=true[, bool use_font_guides = true]]) ``` -------------------------------- ### fgGuide p0 Descriptor Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgGuide.html Represents the starting point of the guide. The value is of type fgPoint. ```python (fgPoint) ``` -------------------------------- ### Guide Class Overview Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Guide.html Provides an overview of the Guide class, including its constructors, attributes, and methods. ```APIDOC ## Guide Class ### Description Represents a guideline within FontLab. This class is Multiple Master compatible. ### Constructors - `Guide()`: Generic constructor, creates a Guide with zero coordinates. - `Guide(Guide)`: Copy constructor. - `Guide(position)`: Creates a Guide and assigns position. - `Guide(position, angle)`: Creates a Guide and assigns position and width values. ### Attributes - `parent` (read-only) - Guide's parent object, Glyph. - `position` (integer) - Position of the guideline. - `width` (integer) - Width of the guideline. - `angle` (float) - Angle of the guide (degrees). - `positions` [(integer)] - List of positions for each master. - `widths` [(integer)] - List of widths for each master. ### Methods - `Transform(Matrix m)`: Applies Matrix transformation to the Guide. - `TransformLayer(Matrix m, layernum)`: Applies Matrix transformation to the selected layer of the Guide. - `__delattr__(name)`: Deletes an attribute. - `__getattribute__(name)`: Gets an attribute. - `__init__(...)`: Initializes the Guide object. - `__repr__()`: Returns a string representation of the Guide. - `__setattr__(name, value)`: Sets an attribute. ``` -------------------------------- ### FontLab Scripting Example Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flWorkspace.html An example demonstrating how to load a font, export its instances, and interact with the FontLab application using the Python API. ```APIDOC ## FontLab Scripting Example ### Description This script demonstrates loading a font file, exporting its instances as OTF, and interacting with the FontLab application. ### Method N/A (Script Execution) ### Endpoint N/A ### Parameters None ### Request Example ```python import os.path from fontlab import * from PythonQt import QtGui # Access the font-specific logic of FontLab 7 # Access the entire Qt application framework # Checks if a `.vfc` file with the same file name as this # script file exists in the same folder loc = [os.path.dirname(__file__)] + list(os.path.splitext(os.path.basename(__file__))) fontPath = os.path.join(loc[0], loc[1] + '.vfc') # If there is no such file, opens a file open dialog if not os.path.exists(fontPath): fontPath = QtGui.QFileDialog.getOpenFileName( None, 'Choose font', loc[0], '') # If there is a font file, export its instances as OTF if fontPath: # `fontlab.flWorkspace` instance is the FontLab 7 app ws = flWorkspace.instance() # `.mainWindow` is the graphical interface of FontLab 7 main = ws.mainWindow # `.loadFont` opens a file in the FontLab GUI main.loadFont(fontPath) # `.currentPackage` is the active `fontlab.flPackage`, which is a font fp = ws.currentPackage # `fontlab.flPreferences` has the FL7 preferences pref = flPreferences() # New `fontlab.ExportControl` class corresponds to the settings ec = ExportControl() ec.profileName = "OpenType PS" ec.destinationMode = pref.DestinationFolder ec.conflictMode = pref.ConflictOverwrite ec.contentMode = pref.ContentInstances ec.destinationFolder = os.path.dirname(fontPath) ec.groupProfiles = False ec.groupFamily = True # `flWorkspace.exportFont` exports the `flPackage` with `ExportControl` settings ws.exportFont(fp, ec) # `QtGui.QApplication` instance is the FontLab 7 app qapp = QtGui.QApplication.instance() # Quit the FontLab 7 app qapp.quit() ``` ### Response N/A (Script execution) ``` -------------------------------- ### Start Timer for QGridLayout Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.gui.widgets.html Starts a timer for the QGridLayout. Returns the timer ID. ```python X.startTimer(a, b, c) ``` -------------------------------- ### Get Smart Guides Preference Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flPreferences.html Retrieves the setting for smart guides. Expected type is bool. ```python fontlab.flPreferences.smartGuides ``` -------------------------------- ### Create New Project Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flWorkspace.html Initializes a new, empty project. ```python createNewProject() ``` -------------------------------- ### Initialization and Instance Management Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flItems.html Methods for initializing the environment and getting the application instance. ```APIDOC ## Static methods ### init #### Description Initializes the FontLab environment. ### Method init ### Request Example ```python init() ``` ### instance #### Description Returns the singleton instance of the FontLab items manager. ### Method instance ### Response #### Success Response (200) - **items_instance** (flItems) - The FontLab items instance. ### Request Example ```python items = instance() ``` ``` -------------------------------- ### Timer Function Example Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.core.func.transform.html Example usage of the timer function to get interpolation time for a stem value. ```python typerig.core.func.transform.timer = timer(sw_c, sw_0, sw_1, fix_boundry=False) ``` -------------------------------- ### Get Length Example Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Font.html Use `__len__` to get the number of items in a collection. This is equivalent to calling the `len()` function. ```python x.__len__() <==> len(x) ``` -------------------------------- ### Initialize fgPackages Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgPackages.html Instantiate fgPackages with default settings, a copy of another fgPackages object, or by providing a path to a font file or folder. ```python fgPackages() ``` ```python fgPackages(fgPackages) ``` ```python fgPackages('pathToFontFileOrFolder') ``` -------------------------------- ### Component.__init__ Method Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Component.html Initializes the component object. Use `help(type(x))` for signature details. ```python __init__(...) x.__init__(...) initializes x; see help(type(x)) for signature ``` -------------------------------- ### CurveEx p0 Descriptor Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.CurveEx.html Gets or sets the starting point of the curve. ```python QPointF p0 ``` -------------------------------- ### Get typerig.gui Version Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.gui.html Imports the current version from the proxy module. Use this to check the installed version of typerig.gui. ```python from proxy import __version__ as current_ver __version__ = current_ver ``` -------------------------------- ### Utility and Information Slots Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Slots for various utility functions like starting timers, getting window information, and translating strings. ```APIDOC ## POST /sharedPainter ### Description Returns a shared painter for the widget. ### Method POST ### Endpoint /sharedPainter ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **PythonQt.QtGui.QPainter** - Description not provided ## POST /signalsBlocked ### Description Checks if signals are blocked for the widget. ### Method POST ### Endpoint /signalsBlocked ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **bool** - Description not provided ## POST /stackUnder ### Description Stacks the widget under another widget. ### Method POST ### Endpoint /stackUnder ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided - **b** (any) - Description not provided ### Request Example ```json { "a": null, "b": null } ``` ### Response #### Success Response (200) None ## POST /startTimer ### Description Starts a timer for the widget. ### Method POST ### Endpoint /startTimer ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided - **b** (any) - Description not provided - **c** (any) - Description not provided ### Request Example ```json { "a": null, "b": null, "c": null } ``` ### Response #### Success Response (200) - **int** - Description not provided ## POST /styleSheet ### Description Sets or gets the stylesheet for the widget. ### Method POST ### Endpoint /styleSheet ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **None** - Description not provided ## POST /thread ### Description Gets the thread associated with the widget. ### Method POST ### Endpoint /thread ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /tr ### Description Translates a string using the widget's locale. ### Method POST ### Endpoint /tr ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided - **b** (any) - Description not provided - **c** (any) - Description not provided - **d** (any) - Description not provided ### Request Example ```json { "a": null, "b": null, "c": null, "d": null } ``` ### Response #### Success Response (200) - **str** - Description not provided ## POST /underMouse ### Description Checks if the mouse cursor is currently over the widget. ### Method POST ### Endpoint /underMouse ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **bool** - Description not provided ## POST /ungrabGesture ### Description Releases a grabbed gesture. ### Method POST ### Endpoint /ungrabGesture ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided - **b** (any) - Description not provided ### Request Example ```json { "a": null, "b": null } ``` ### Response #### Success Response (200) None ## POST /unsetCursor ### Description Unsets the cursor for the widget. ### Method POST ### Endpoint /unsetCursor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /unsetLocale ### Description Unsets the locale for the widget. ### Method POST ### Endpoint /unsetLocale ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /update ### Description Triggers an update for the widget's geometry. ### Method POST ### Endpoint /update ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided - **b** (any) - Description not provided - **c** (any) - Description not provided - **d** (any) - Description not provided - **e** (any) - Description not provided ### Request Example ```json { "a": null, "b": null, "c": null, "d": null, "e": null } ``` ### Response #### Success Response (200) None ## POST /updateGeometry ### Description Updates the geometry of the widget. ### Method POST ### Endpoint /updateGeometry ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /visibleRegion ### Description Gets the visible region of the widget. ### Method POST ### Endpoint /visibleRegion ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **PythonQt.QtGui.QRegion** - Description not provided ## POST /widthMM ### Description Gets the width of the widget in millimeters. ### Method POST ### Endpoint /widthMM ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **int** - Description not provided ## POST /winId ### Description Gets the window ID of the widget. ### Method POST ### Endpoint /winId ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /window ### Description Gets the parent window of the widget. ### Method POST ### Endpoint /window ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **PythonQt.QtGui.QWidget** - Description not provided ## POST /windowFlags ### Description Gets the window flags of the widget. ### Method POST ### Endpoint /windowFlags ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /windowHandle ### Description Gets the window handle of the widget. ### Method POST ### Endpoint /windowHandle ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **PythonQt.QtGui.QWindow** - Description not provided ## POST /windowRole ### Description Gets the window role of the widget. ### Method POST ### Endpoint /windowRole ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) - **str** - Description not provided ## POST /windowState ### Description Gets the window state of the widget. ### Method POST ### Endpoint /windowState ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ## POST /windowType ### Description Gets the window type of the widget. ### Method POST ### Endpoint /windowType ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **a** (any) - Description not provided ### Request Example ```json { "a": null } ``` ### Response #### Success Response (200) None ``` -------------------------------- ### Link.__init__() Method Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Link.html Standard Python method for initializing an object. Use 'help(type(x))' for specific signature details. ```python x.__init__(...) ``` -------------------------------- ### OutlinePen init Method Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.proxy.pens.outlinePen.html Initializes the OutlinePen with provided keyword arguments. ```python init(self, **kwargs) ``` -------------------------------- ### Get Item Example Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Font.html Use `__getitem__` to access an item from a collection using its index or key. This is equivalent to using square brackets for indexing. ```python x.__getitem__(y) <==> x[y] ``` -------------------------------- ### Remove Guides Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flLayer.html Removes horizontal and/or vertical guides from the object. Useful for cleaning up guides. ```python bool removeGuides(bool horizontal, bool vertical) ``` -------------------------------- ### Call backingStore Method Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Returns the backing store of the object, which is of type PythonQt.QtGui.QBackingStore. It takes one argument, 'a'. ```python X.backingStore(a) -> PythonQt.QtGui.QBackingStore ``` -------------------------------- ### QHBoxLayout Initialization Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.gui.QtGui.html Initializes a new instance of QHBoxLayout. Accepts variable arguments and keyword arguments. ```python self.init(*args, **kwargs) ``` -------------------------------- ### fgGuide position Descriptor Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgGuide.html Represents the position of the guide. For horizontal guides, it's the y-coordinate; for vertical guides, it's the x-coordinate. Returns None if the guide is neither horizontal nor vertical. ```python (int) y value of p0, p1 if guide is horizontal, x value - if vertical, none if guide nor horizontal/vertical ``` -------------------------------- ### Image Class Constructor Examples Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Image.html Demonstrates different ways to construct an Image object: generic, copy, and between node indices. ```python Image() ``` ```python Image(Image) ``` ```python Image(index1, index2) ``` -------------------------------- ### Access font guides list Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgFont.html The `guides` descriptor provides access to the font's guides, represented by an `fgGuides` object. ```python (fgGuides) guides list ``` -------------------------------- ### Get Layout Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Gets the layout of the widget. ```APIDOC ## layout /api/widgets ### Description Gets the layout of the widget. ### Method GET ### Endpoint /api/widgets/layout ### Parameters #### Path Parameters None #### Query Parameters - **a** (object) - Required - The widget whose layout to retrieve. ### Request Example ```json { "a": "widget_object" } ``` ### Response #### Success Response (200) - **return_value** (QLayout) - The layout of the widget. #### Response Example ```json { "return_value": "layout_object" } ``` ``` -------------------------------- ### Show Window Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Makes the widget visible to the user. Ensure the widget is properly initialized before calling this. ```python X.show() ``` -------------------------------- ### QHBoxLayout Constructor Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.gui.QtGui.html Information on how to initialize a QHBoxLayout object. ```APIDOC ## QHBoxLayout `typerig.gui.QtGui.QHBoxLayout` is a class that inherits from `PythonQt.QtGui.QHBoxLayout`. ### Methods #### `__init__` Initializes a new instance of the QHBoxLayout class. ##### Parameters - `*args`: Variable length argument list. - `**kwargs`: Arbitrary keyword arguments. ##### Returns A new QHBoxLayout object. ``` -------------------------------- ### Get Metric Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Gets a specific metric of the widget. ```APIDOC ## metric /api/widgets ### Description Gets a specific metric of the widget. ### Method GET ### Endpoint /api/widgets/metric ### Parameters #### Path Parameters None #### Query Parameters - **a** (object) - Required - The widget for which to get the metric. - **b** (int) - Required - The ID of the metric to retrieve. ### Request Example ```json { "a": "widget_object", "b": 1 } ``` ### Response #### Success Response (200) - **return_value** (int) - The value of the requested metric. #### Response Example ```json { "return_value": 100 } ``` ``` -------------------------------- ### fgCaret __init__ Method Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgCaret.html Initializes a `fgCaret` object. Use `help(type(x))` for detailed signature information specific to the initialization process. ```python x.__init__(...) initializes x; see help(type(x)) for signature ``` -------------------------------- ### Get Meta Object Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Gets the meta-object of the widget. ```APIDOC ## metaObject /api/widgets ### Description Gets the meta-object of the widget. ### Method GET ### Endpoint /api/widgets/metaObject ### Parameters #### Path Parameters None #### Query Parameters - **a** (object) - Required - The widget whose meta-object to retrieve. ### Request Example ```json { "a": "widget_object" } ``` ### Response #### Success Response (200) - **return_value** (QMetaObject) - The meta-object of the widget. #### Response Example ```json { "return_value": "meta_object_object" } ``` ``` -------------------------------- ### Get Mask Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.YPanelWidget.html Gets the widget's mask. ```APIDOC ## mask /api/widgets ### Description Gets the widget's mask. ### Method GET ### Endpoint /api/widgets/mask ### Parameters #### Path Parameters None #### Query Parameters - **a** (object) - Required - The widget whose mask to retrieve. ### Request Example ```json { "a": "widget_object" } ``` ### Response #### Success Response (200) - **return_value** (QRegion) - The widget's mask. #### Response Example ```json { "return_value": "region_object" } ``` ``` -------------------------------- ### KerningPair Constructor Examples Source: https://fontlabcom.github.io/fontlab-python-docs/FL.KerningPair.html Demonstrates various ways to construct a KerningPair object, including empty, copy, index-based, and index-with-value initialization. ```python KerningPair() ``` ```python KerningPair(KerningPair) ``` ```python KerningPair(index) ``` ```python KerningPair(index, value) ``` -------------------------------- ### Set Start Point Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.proxy.objects.glyph.html Sets the starting point for a contour on a given layer. The 'control' argument might influence the starting point's behavior. ```python setStart(self, layer=None, control=(0, 0)) ``` -------------------------------- ### Node Class Constructor Examples Source: https://fontlabcom.github.io/fontlab-python-docs/FL.Node.html Demonstrates different ways to construct a Node object, including a generic constructor, a copy constructor, and a constructor with type and point initialization. ```python Node() Node(Node) Node(integer type, Point p) ``` -------------------------------- ### Enumerate Sequence with Custom Start Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.core.func.collection.html Performs enumeration of a sequence with an added start functionality. This is an alternative to Python's built-in enumerate, useful for specific starting indices. ```python enumerateWithStart(sequence, start=0) ``` -------------------------------- ### FontLab Scripting Example Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flWorkspace.html A comprehensive example demonstrating how to load a font, configure export settings, and export font instances as OTF using the FontLab Python API and Qt framework. It includes file path handling and dialog interactions. ```python import os.path # Access the font-specific logic of FontLab 7 with # the `fontlab` package from fontlab import * # Access the entire Qt application framework that powers # FontLab 7 with the `PythonQt` package # `PythonQt.QtGui` exposes the full Qt GUI toolkit to build # simple and most complex UIs from PythonQt import QtGui # Checks if a `.vfc` file with the same file name as this # script file exists in the same folder loc = [os.path.dirname(__file__)] + list(os.path.splitext(os.path.basename(__file__))) fontPath = os.path.join(loc[0], loc[1] + '.vfc') # If there is no such file, opens a file open dialog with # `QtGui.QFileDialog`, so you can pick a font file or Cancel if not os.path.exists(fontPath): fontPath = QtGui.QFileDialog.getOpenFileName( None, 'Choose font', loc[0], '') # If there is a font file, export its instances as OTF if fontPath: # `fontlab.flWorkspace` instance is the FontLab 7 app # seen as the font editor ws = flWorkspace.instance() # `.mainWindow` is the graphical interface of FontLab 7 main = ws.mainWindow # `.loadFont` opens a file in the FontLab GUI main.loadFont(fontPath) # `.currentPackage` is the active `fontlab.flPackage`, # which is a font inside FontLab fp = ws.currentPackage # `fontlab.flPreferences` has the FL7 preferences # that hold numeric constants that represent values # in the Export Font As dialog settings pref = flPreferences() # New `fontlab.ExportControl` class corresponds to # the settings of File > Export Font As... ec = ExportControl() ec.profileName = "OpenType PS" ec.destinationMode = pref.DestinationFolder ec.conflictMode = pref.ConflictOverwrite ec.contentMode = pref.ContentInstances ec.destinationFolder = os.path.dirname(fontPath) ec.groupProfiles = False ec.groupFamily = True # `flWorkspace.exportFont` exports the `flPackage` # with `ExportControl` settings ws.exportFont(fp, ec) # `QtGui.QApplication` instance is the FontLab 7 app # seen as a graphical app that uses the Qt framework qapp = QtGui.QApplication.instance() # Quit the FontLab 7 app qapp.quit() ``` -------------------------------- ### fgComponent Class Overview Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgComponent.html Provides an overview of the fgComponent class, including its constructors and available methods. ```APIDOC ## `fgComponent` fontgate.fgComponent = class fgComponent(object) Component representation Constructors: fgComponent() - default fgComponent(fgComponent) - copy fgComponent('name', fgMatrix) - by 'name' and transformation matrix fgMatrix #### Methods __cmp__(...) x.__cmp__(y) <==> cmp(x,y) __delattr__(...) x.__delattr__('name') <==> del x.name __getattribute__(...) x.__getattribute__('name') <==> x.name __init__(...) x.__init__(...) initializes x; see help(type(x)) for signature __repr__(...) x.__repr__() <==> repr(x) __setattr__(...) x.__setattr__('name', value) <==> x.name = value __str__(...) x.__str__() <==> str(x) draw(...) draw(pen object) - draw the object with a segment pen drawPoints(...) drawPoints(pen object) - draw the object with a point pen move(...) move(dx, dy) - move by float dx, dy value #### Descriptors baseGlyph (string) name of base glyph box (fgRect) - bounding box hasFullMatrix index (int) component index in glyph's components list matrix (fgMatrix) - component transform matrix offset scale #### Attributes __new__ = T.__new__(S, ...) -> a new object with type S, a subtype of T ``` -------------------------------- ### fgLayer guides Descriptor Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgLayer.html Provides access to the guides associated with the layer. ```python (fgGuides) ``` -------------------------------- ### PaintBrush.init Method Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.PaintBrush.html Initializes the PaintBrush object. ```APIDOC ## init ### Description Initializes the `PaintBrush` object. ### Method `init` ### Endpoint N/A (This is a class method) ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **void**: This method does not return a value. ``` -------------------------------- ### Set Start Point API Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.proxy.objects.glyph.html Sets the starting point of a contour. ```APIDOC ## setStart ### Description Sets the starting point of a contour. ### Method Not specified (assumed to be a method of a FontLab object) ### Endpoint Not applicable ### Parameters #### Path Parameters None #### Query Parameters - **layer** (int or str) - Optional - Layer index or name, works with both. - **control** (tuple(int, int)) - Optional - Control point for setting the start. Defaults to (0, 0). #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **None** (None) - Returns None. #### Response Example ```json { "example": "None" } ``` ``` -------------------------------- ### Anchor and Guide Management Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.proxy.objects.glyph.html Methods for dropping anchors and guides within glyphs. ```APIDOC ## POST /api/anchors/drop ### Description Drop anchor at given layer. ### Method POST ### Endpoint /api/anchors/drop ### Parameters #### Request Body - **name** (str) - Required - Anchor Name - **layer** (int or str) - Required - Layer index or name, works with both - **coordTuple** (int, int) - Required - New anchor coordinates or auto aligment offsets - **alignTuple** (str,str) - Optional - New anchor aligment. Alignment rules: (width, height) - (None,None) Uses coordinates given; width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; height - (T) Top; (B) Bottom; (C) Center. - **tolerance** (int) - Optional - Outline feature auto detection tolerance - **italic** (bool) - Optional - Whether to apply italic angle ### Response #### Success Response (200) - **None** (None) - Operation successful ``` ```APIDOC ## POST /api/guides/drop ### Description Build guideline trough *any two* given points or the *first two of the current selection*. If *single point* is given will create a vertical guideline trough that point, with guideline inclined according to the font's Italic Angle. If process layers (pLayers) is None guideline will be created in all compatible layers. ### Method POST ### Endpoint /api/guides/drop ### Parameters #### Request Body - **nodes** (list) - Optional - List of points to build guideline through - **layers** (list) - Optional - List of layers to create guideline in - **name** (str) - Optional - Guideline name (default: '*DropGuideline') - **tag** (str) - Optional - Guideline tag - **color** (str) - Optional - Guideline color (default: 'darkMagenta') - **flip** (tuple(int, int)) - Optional - Flip tuple (default: (1, 1)) - **style** (str) - Optional - Guideline style (default: 'gsGlyphGuideline') ### Response #### Success Response (200) - **None** (None) - Operation successful ``` -------------------------------- ### flZone Class Overview Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flZone.html Provides an overview of the flZone class, including its constructors and a list of its methods and descriptors. ```APIDOC ## `flZone` ### Description Represents a zone within FontLab. ### Constructors - `flZone()` - `flZone(double p, double w[, QString _n = ])` - `flZone(flZone)` ### Methods - `__delattr__(...)` - `__getattribute__(...)` - `__init__(...)` - `__repr__(...)` - `__setattr__(...)` - `guaranteeName(bool top)` - `tagsSet()` - `toZone(fgZone, bool top)` ### Descriptors - `name` (string) - `position` (double) - `program` (QSet) - `programText` (QString) - `tags` (string) - `width` (double) ### Attributes - `__new__` ``` -------------------------------- ### flInstance Class Overview Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flInstance.html Provides an overview of the `flInstance` class, its constructors, and available methods and descriptors. ```APIDOC ## `flInstance` fontlab.flInstance = class flInstance(object) ``` flInstance representation Constructors: flInstance() flInstance(string name, string tsn, flLocation location) ``` #### Methods __delattr__(...) ``` x.__delattr__('name') <==> del x.name ``` __getattribute__(...) ``` x.__getattribute__('name') <==> x.name ``` __init__(...) ``` x.__init__(...) initializes x; see help(type(x)) for signature ``` __repr__(...) ``` x.__repr__() <==> repr(x) ``` __setattr__(...) ``` x.__setattr__('name', value) <==> x.name = value ``` autoSGN(...) ``` string autoSGN(const string &tfn) ``` autoSLV(...) ``` int autoSLV() ``` autoTSN(...) ``` string autoTSN() ``` setSLV(...) ``` setSLV(bool bold, bool italic) ``` #### Descriptors bold ``` bool ``` exportable ``` bool ``` italic ``` bool ``` location ``` flLocation ``` name ``` string ``` sgn ``` string ``` slv ``` int ``` tsn ``` string ``` weight ``` string ``` weightValue ``` double ``` width ``` string ``` #### Attributes __new__ = ``` T.__new__(S, ...) -> a new object with type S, a subtype of T ``` ``` -------------------------------- ### Set Start Point Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.proxy.objects.glyph.html Sets the starting point for a contour on a specified layer. ```APIDOC ## POST /api/contours/set_start ### Description Sets the starting point for a contour on a specified layer. ### Method POST ### Endpoint /api/contours/set_start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **layer** (int or str) - Optional - Layer index or name. Defaults to None (current layer). - **control** (tuple(int, int)) - Optional - Control point for setting the start. Defaults to (0, 0). ### Request Example ```json { "layer": 0, "control": [10, 20] } ``` ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### fgPointU Class Overview Source: https://fontlabcom.github.io/fontlab-python-docs/fontgate.fgPointU.html Provides an overview of the fgPointU class, its constructors, and supported mathematical operations. ```APIDOC ## `fgPointU` ### Description PointU representation ### Constructors - `fgPointU()` - default - `fgPointU(fgPoint)` - copy - `fgPointU(fgPointU)` - copy - `fgPointU(fgPoint, float u)` - `fgPointU(tuple(float x, float y, float u))` - `fgPointU(float x, float y, float u)` ### Math Operations - `fgPointU + fgPoint/fgPointU` - `fgPointU - fgPoint/fgPointU` - `fgPointU * fgPoint/fgPointU` - `fgPointU * float` - vector product - `fgPointU / float` - `fgPointU << fgPointU` - True if first point is less or equal to second - `fgPointU >> fgPointU` - True if first point is greater or equal to second - `fgPointU ^ fgPointU` - scalar product ``` -------------------------------- ### Specific Method Examples Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flVectorNode.html Examples for specific methods like angleTo and applyTransform. ```APIDOC ## angleTo / angleTo ### Description Calculates the angle to a given point. ### Method `double angleTo(QPointF p)` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **p** (QPointF) - Required - The target point. ### Request Example ```json { "example": "angle = node.angleTo(QPointF(50, 50))" } ``` ### Response - **return** (double) - The angle in degrees. ``` ```APIDOC ## applyTransform / applyTransform ### Description Applies a transformation to the object. ### Method `applyTransform(QTransform)` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tx** (QTransform) - Required - The transformation matrix to apply. ### Request Example ```json { "example": "node.applyTransform(QTransform.fromRotate(45))" } ``` ### Response None explicitly defined, likely modifies object state. ``` ```APIDOC ## canBeHobby / canBeHobby ### Description Checks if the node can be converted to a Hobby curve. ### Method `bool canBeHobby()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "can_hobby = node.canBeHobby()" } ``` ### Response - **return** (bool) - True if it can be a Hobby curve, False otherwise. ``` ```APIDOC ## canBeSmooth / canBeSmooth ### Description Checks if the node can be converted to a smooth curve. ### Method `bool canBeSmooth()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "can_smooth = node.canBeSmooth()" } ``` ### Response - **return** (bool) - True if it can be a smooth curve, False otherwise. ``` ```APIDOC ## canCollapse / canCollapse ### Description Checks if the node can be collapsed. ### Method `bool canCollapse()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "can_collapse = node.canCollapse()" } ``` ### Response - **return** (bool) - True if it can be collapsed, False otherwise. ``` ```APIDOC ## canImprove / canImprove ### Description Checks if the node can be improved. ### Method `bool canImprove()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "can_improve = node.canImprove()" } ``` ### Response - **return** (bool) - True if it can be improved, False otherwise. ``` ```APIDOC ## changed / changed ### Description Marks the node as changed. ### Method `changed()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "node.changed()" } ``` ### Response None explicitly defined, likely modifies object state. ``` ```APIDOC ## checkInitHistoryState / checkInitHistoryState ### Description Checks the initialization of a history state. ### Method `checkInitHistoryState(uint history_ix)` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **history_ix** (uint) - Required - The index of the history state. ### Request Example ```json { "example": "node.checkInitHistoryState(0)" } ``` ### Response None explicitly defined. ``` ```APIDOC ## checkVectors / checkVectors ### Description Checks the vectors of the object. ### Method `bool checkVectors()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "is_valid = node.checkVectors()" } ``` ### Response - **return** (bool) - True if vectors are valid, False otherwise. ``` ```APIDOC ## clearAboveHistory / clearAboveHistory ### Description Clears history states above a given index. ### Method `clearAboveHistory(uint history_ix)` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **history_ix** (uint) - Required - The index of the history state. ### Request Example ```json { "example": "node.clearAboveHistory(5)" } ``` ### Response None explicitly defined. ``` ```APIDOC ## clearFlag / clearFlag ### Description Clears a specific flag from the object. ### Method `clearFlag(uint f)` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **f** (uint) - Required - The flag to clear. ### Request Example ```json { "example": "node.clearFlag(flObjectFlags.ofChanged)" } ``` ### Response None explicitly defined. ``` ```APIDOC ## clearFlags / clearFlags ### Description Clears all flags from the object. ### Method `clearFlags()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "node.clearFlags()" } ``` ### Response None explicitly defined. ``` ```APIDOC ## clearStored / clearStored ### Description Clears stored information from the object. ### Method `clearStored()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "node.clearStored()" } ``` ### Response None explicitly defined. ``` ```APIDOC ## clone / clone ### Description Clones the object. ### Method `clone()` ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example ```json { "example": "cloned_node = node.clone()" } ``` ### Response - **return** (flNode) - A clone of the object. ``` ```APIDOC ## cloneMapped / cloneMapped ### Description Clones the object with a mapped transformation. ### Method `flNode cloneMapped(QTransform)` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tx** (QTransform) - Required - The transformation matrix for mapping. ### Request Example ```json { "example": "cloned_node = node.cloneMapped(QTransform.fromScale(1.5, 1.5))" } ``` ### Response - **return** (flNode) - A cloned node with the applied transformation. ``` -------------------------------- ### flZone Constructors Source: https://fontlabcom.github.io/fontlab-python-docs/fontlab.flZone.html Demonstrates the different ways to construct an flZone object. ```python flZone() ``` ```python flZone(double p, double w[, QString _n = ]) ``` ```python flZone(flZone) ``` -------------------------------- ### Vec Class Constructor Example Source: https://fontlabcom.github.io/fontlab-python-docs/typerig.core.objects.matrix.html Demonstrates the creation of a Vec object. The constructor takes a list of elements. ```python Vec([6,3,4]).polyval(5) evaluates to 6*x**2 + 3*x + 4 at x=5 ``` ```python Vec([10,20,30,40,50]).ratfit(5) evaluates to (10*x**2 + 20*x + 30) / (40*x**2 + 50*x + 1) at x=5. ```