altium monkey v2026.11.26 · gobblerito
On This Page (60)

Fonts, OLE & Contracts

Installed font discovery, compound-binary OLE helpers, and schema validators.

91 / 91 shown
class

AltiumAssetInventory

from altium_monkey import AltiumAssetInventory
class AltiumAssetInventory(source_kind: 'SourceKind', source_path: 'str | None', assets: 'tuple[AltiumAssetSummary, ...]') -> 'None'

Aggregate read-only inventory for user-selectable assets.

Members (2)
KindSignatureSummary
methodby_kind(self, kind: 'AssetKind') -> 'tuple[AltiumAssetSummary, ...]'Return inventory entries for one asset kind.
methodto_dict(self, *, include_schema: 'bool' = True) -> 'dict[str, object]'Return the stable downstream JSON-ready inventory shape.
class

AltiumAssetRef

from altium_monkey import AltiumAssetRef
class AltiumAssetRef(source_kind: 'SourceKind', source_path: 'str | None', kind: 'AssetKind', key: 'str', index: 'int | None' = None, name: 'str | None' = None, source_instance_id: 'str | None' = None) -> 'None'

Source-local reference for one extractable asset.

File-backed refs are durable through normalized source_path identity. Refs from unsaved/live containers carry a process-local source_instance_id and are only valid for that live container instance in the current process.

class

AltiumAssetSummary

from altium_monkey import AltiumAssetSummary
class AltiumAssetSummary(ref: 'AltiumAssetRef', kind: 'AssetKind', name: 'str', extraction_filename: 'str | None', native_extension: 'str | None', can_extract: 'bool', payload_available: 'bool', payload_sha256: 'str | None' = None, details: 'AltiumAssetDetails' = <factory>, extras: 'Mapping[str, object]' = <factory>) -> 'None'

Read-only summary for a user-selectable extractable asset.

class

AltiumExtractedAsset

from altium_monkey import AltiumExtractedAsset
class AltiumExtractedAsset(ref: 'AltiumAssetRef', filename: 'str', payload: 'bytes | None' = None, pcblib: 'object | None' = None, schlib: 'object | None' = None) -> 'None'

Result of extracting exactly one selected asset.

class

AltiumLauncher

from altium_monkey.altium_launcher import AltiumLauncher
class AltiumLauncher(altium_path: 'Path | None' = None, preferred_version: 'int | None' = None) -> 'None'

Launches Altium Designer on Windows and opens files programmatically.

Members (4)
KindSignatureSummary
methodkill(self) -> 'bool'Kill all running Altium Designer processes on this machine.
methodopen(self, file_path: 'str | Path') -> 'bool'Open a file in Altium Designer.
methodrun_script(self, script_project: 'str | Path', unit_name: 'str', procedure_name: 'str') -> 'int'Launch Altium and run a script procedure on startup.
staticmethodrunning_x2_processes() -> 'tuple[AltiumProcessInfo, ...]'Return running Altium X2.exe processes on this machine.
class

AltiumOleFile

from altium_monkey import AltiumOleFile
class AltiumOleFile(filename: 'OleFileSource | None' = None) -> 'None'

Unified OLE reader/writer for Altium files.

Usage (read): with AltiumOleFile("component.SchLib") as ole: for path in ole.listdir(): print(path) data = ole.openstream("FileHeader")

Usage (write/round-trip): with AltiumOleFile("input.SchLib") as ole: data = ole.openstream("Symbol/Data") # modify data... ole.modify_stream("Symbol/Data", modified_data) ole.write("output.SchLib")

Members (14)
KindSignatureSummary
methodclose(self) -> 'None'Close the OLE file.
methodentries(self) -> 'list[OleDirEntry]'Return every parsed directory entry in directory (SID) order.
methodexists(self, path: 'str | list[str]') -> 'bool'Check if a path exists.
methodget_size(self, path: 'str | list[str]') -> 'int'Get stream size.
methodget_type(self, path: 'str | list[str]') -> 'int'Get entry type (for olefile API compatibility).
methodlistdir(self, streams: 'bool' = True, storages: 'bool' = False) -> 'list[list[str]]'List directory entries.
propertyminisectorcutoff -> 'int'Get mini stream cutoff size.
methodmodify_stream(self, path: 'str | list[str]', data: 'bytes') -> 'None'Mark a stream for modification.
methodopen(self, filename: 'OleFileSource') -> 'AltiumOleFile'Open and parse an OLE file.
methodopenstream(self, path: 'str | list[str]') -> 'bytes'Read stream data.
methodopenstream_lossy(self, path: 'str | list[str]') -> 'tuple[bytes, str | None]'Read a stream as far as its sector chain can be followed.
propertyroot -> 'OleDirEntry | None'Get root directory entry.
propertysectorsize -> 'int'Get sector size.
methodwrite(self, filepath: 'str | Path') -> 'None'Write OLE file with modifications.
class

AltiumOleWriter

from altium_monkey import AltiumOleWriter
class AltiumOleWriter(clsid: 'bytes | None' = None) -> 'None'

Creates new OLE files for Altium formats.

Features: - Version 3 format (512-byte sectors) - Altium CLSID by default - Handles mini-stream for small data (<4096 bytes) - Automatic storage creation from paths

Members (5)
KindSignatureSummary
methodaddEntry(self, path: 'str', data: 'bytes | None' = None, storage: 'bool' = False) -> 'None'Compatibility method matching OleWriter API.
methodadd_stream(self, path: 'str', data: 'bytes') -> 'None'Add a stream to the file.
methodeditEntry(self, path: 'str | list[str]', data: 'bytes | None' = None) -> 'None'Edit an existing stream entry (for compatibility with OleWriter API).
methodfromOleFile(self, ole: 'Any') -> 'None'Copy all streams and storages from an existing OLE file.
methodwrite(self, filepath: 'str | Path') -> 'None'Write the OLE file to disk.
class

AltiumOutJob

from altium_monkey.altium_outjob import AltiumOutJob
class AltiumOutJob() -> 'None'

Parser and builder for Altium .OutJob output job files.

The OutJob file has three main sections: - [OutputGroup1]: Defines mediums (where output goes) and output types (what to generate) - [PublishSettings]: PDF/publish medium configuration (paths, filenames, options) - [GeneratedFilesSettings]: Generated files medium configuration (paths)

Each output type can be independently enabled/disabled per medium.

Members (25)
KindSignatureSummary
methodadd_bom_part_type(self, enabled_medium: 'int | None' = None, *, output_name: 'str' = 'CSV-BOM', batch_mode: 'int' = 0, view_type: 'int' = 1, general: 'str | None' = None) -> 'int'Add BOM report output type (BOM_PartType).
methodadd_export_step(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None) -> 'int'Add STEP 3D export output type.
methodadd_generated_files_medium(self, name: 'str', output_dir: 'str' = '') -> 'int'Add a GeneratedFiles output medium (for Gerber, Drill, ODB++, STEP, etc.).
methodadd_gerber(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None, *, units: 'str' = 'Imperial', decimals: 'int' = 5, embed_apertures: 'bool' = True, software_arcs: 'bool' = False, flash_pad_shapes: 'bool' = True, plot_layers: 'str' = '') -> 'int'Add Gerber (RS-274X) output type.
methodadd_gerber_x2(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None, *, units: 'str' = 'Metric', decimals: 'int' = 5, embed_apertures: 'bool' = True, software_arcs: 'bool' = False, flash_pad_shapes: 'bool' = True, plot_layers: 'str' = '') -> 'int'Add Gerber X2 output type (IPC-D-356 extended attributes).
methodadd_ipc2581(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None, *, version: 'str' = 'B', units: 'str' = 'Metric', precision: 'int' = 6, different_footprints: 'bool' = True) -> 'int'Add IPC-2581 output type.
methodadd_nc_drill(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None, *, units: 'str' = 'Imperial', decimals: 'int' = 5, separate_plated: 'bool' = False) -> 'int'Add NC Drill (Excellon) output type.
methodadd_odb(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None) -> 'int'Add ODB++ output type.
methodadd_output_spec(self, output: 'OutJobOutputSpec', enabled_medium: 'int | None' = None, *, use_output_index_enable_flag: 'bool' = False) -> 'int'Add an output from a typed OutJobOutputSpec object.
methodadd_pcb_drawing(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None, *, name: 'str' = 'PCB Drawing') -> 'int'Add PCB Drawing output type (for PDF export of PCB layers).
methodadd_pick_place(self, pcbdoc_path: 'str' = '', enabled_medium: 'int | None' = None, *, units: 'str' = 'Metric', csv_format: 'bool' = True) -> 'int'Add Pick & Place output type.
methodadd_publish_medium(self, name: 'str', output_dir: 'str' = '', output_filename: 'str' = '', *, path_media: 'str' = '', filename_multi: 'str' = '', filename_special: 'str' = '') -> 'int'Add a Publish output medium (for PDF export).
methodadd_schematic_print(self, schdoc_path: 'str' = '', enabled_medium: 'int | None' = None) -> 'int'Add Schematic Print output type (for PDF export).
classmethodcreate_minimal(cls, name: 'str' = 'job') -> 'AltiumOutJob'Create a minimal OutJob with empty sections ready for add_* calls.
classmethodcreate_pcb_fabrication(cls, pcbdoc_path: 'str', output_dir: 'str' = '../reference_output', name: 'str' = 'pcb_fab', *, gerber: 'bool' = True, nc_drill: 'bool' = True, odb: 'bool' = False) -> 'AltiumOutJob'Create an OutJob for PCB fabrication outputs (Gerber + Drill + optional ODB++).
classmethodcreate_schematic_pdf(cls, name: 'str', schdoc_path: 'str', output_dir: 'str' = '../reference_output', output_filename: 'str | None' = None) -> 'AltiumOutJob'Create an OutJob for schematic PDF export.
classmethodfrom_outjob(cls, filepath: 'Path | str') -> 'AltiumOutJob'Load an existing OutJob file.
methodget_output_mediums(self) -> 'list[dict[str, str | int]]'Get list of output mediums defined in this OutJob.
methodget_output_types(self) -> 'list[dict[str, str]]'Get list of output types defined in this OutJob.
propertymedium_count -> 'int'
propertyoutput_count -> 'int'
methodset_document_path(self, output_index: 'int', doc_path: 'str') -> 'None'Update the DocumentPath in an output type's configuration.
methodset_generated_files_path(self, medium_index: 'int', output_dir: 'str') -> 'None'Update the output directory for a GeneratedFiles medium.
methodset_publish_path(self, medium_index: 'int', output_dir: 'str' = '', filename: 'str' = '', *, path_media: 'str | None' = None, filename_multi: 'str | None' = None, filename_special: 'str | None' = None) -> 'None'Update path settings for a Publish medium.
methodto_outjob(self, filepath: 'Path | str', *, encoding: 'str' = 'latin-1') -> 'None'Write OutJob to file (CRLF line endings).
class

AltiumOutJobRunner

from altium_monkey.altium_outjob_runner import AltiumOutJobRunner
class AltiumOutJobRunner(preferred_version: 'int | None' = None, *, altium_path: 'Path | str | None' = None) -> 'None'

Runner for Altium OutJobs.

Members (2)
KindSignatureSummary
methodrun(self, project_path: 'Path | str', *, outjob_path: 'Path | str | None' = None, timeout_seconds: 'float' = 300.0, normalize_generated_paths: 'bool' = True, default_generated_output_path: 'str | None' = None, bind_pcbdoc_path: 'Path | str | None' = None, auto_bind_pcbdoc: 'bool' = False, stage_outjob_copy: 'bool' = True, script_directory: 'Path | str | None' = None, keep_script_artifacts: 'bool' = False, poll_interval_seconds: 'float' = 0.5, kill_after_run: 'bool' = False) -> 'OutJobRunResult'Run a single OutJob and wait for completion marker.
methodrun_many(self, requests: 'Iterable[OutJobRunRequest]', *, stop_on_error: 'bool' = False) -> 'list[OutJobRunResult]'Run multiple OutJobs sequentially.
class

AltiumPrjScr

from altium_monkey.altium_prjscr import AltiumPrjScr
class AltiumPrjScr() -> 'None'

Writer for Altium `.PrjScr` script project files.

Members (5)
KindSignatureSummary
methodadd_script(self, filename: 'str') -> 'None'Add one `.pas` file to the project.
classmethodcreate(cls, script_filename: 'str') -> 'AltiumPrjScr'Create a script project with one `.pas` document.
classmethodcreate_multi(cls, script_filenames: 'list[str]') -> 'AltiumPrjScr'Create a script project with multiple `.pas` documents.
methodsave(self, filepath: 'Path | str') -> 'None'Save the script project to disk.
methodto_string(self) -> 'str'Return the serialized project content.
class

AltiumProcessInfo

from altium_monkey.altium_launcher import AltiumProcessInfo
class AltiumProcessInfo(pid: 'int', executable: 'str') -> 'None'

Minimal process record for a running Altium X2.exe instance.

class

BarcodeRenderer

from altium_monkey.altium_text_to_polygon import BarcodeRenderer
class BarcodeRenderer(*, _altium_code39_table: 'bool' = False, font_policy: 'FontPolicy' = 'altium', installed_fonts: 'InstalledFonts | None' = None) -> 'None'

Renders barcode text records to filled polygon contours.

Converts Code 39 / Code 128 barcode data into rectangular bar polygons, laid out as Altium lays them out. Each bar is a filled rectangle; the result is a TextPolygonResult compatible with IPC-2581 output.

Sizing modes: ByMinWidth (0): Each module = barcode_min_width. Total width varies. ByFullWidth (1): Module = barcode_full_width / modules, rounded half to even to internal units.

Margins apply only to inverted barcodes; a caption sits on the text origin with the bars above it.

Members (1)
KindSignatureSummary
methodrender(self, text: 'str', barcode_kind: 'int' = 0, barcode_render_mode: 'int' = 0, barcode_full_width_mm: 'float' = 0.0, barcode_full_height_mm: 'float' = 0.0, barcode_x_margin_mm: 'float' = 0.0, barcode_y_margin_mm: 'float' = 0.0, barcode_min_width_mm: 'float' = 0.254, barcode_inverted: 'bool' = False, barcode_show_text: 'bool' = False, barcode_font_name: 'str' = 'Arial', x_mm: 'float' = 0.0, y_mm: 'float' = 0.0, height_mm: 'float' = 1.524, rotation: 'float' = 0.0, is_mirrored: 'bool' = False, margin_mm: 'float' = 0.0, font_resolver: 'FontPathResolver | None' = None, inv_rect_width_mm: 'float' = 0.0, inv_rect_height_mm: 'float' = 0.0) -> 'TextPolygonResult'Render a barcode to polygon contours.
class

BomPartTypeOutput

from altium_monkey.altium_outjob import BomPartTypeOutput
class BomPartTypeOutput(output_name: 'str' = 'CSV-BOM', variant_name: 'str' = '', page_options: 'str' = 'Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=Letter|PaperIndex=1', column_name_format: 'str' = 'CaptionAsName', general: 'str | None' = None, batch_mode: 'int' = 0, view_type: 'int' = 1, group_order: 'str' = '', sort_order: 'str' = 'Comment=Up', visible_order: 'str' = 'Comment=120|Description=120|LibRef=120|Quantity=120|Designator=100', visible_order_flat: 'str' = 'Comment=120|Description=120|LibRef=120|Quantity=120|Designator=100') -> 'None'

Typed BOM report output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

CaseInsensitiveDict

from altium_monkey import CaseInsensitiveDict
class CaseInsensitiveDict(data: 'dict[str, Any] | None' = None) -> 'None'

Case-insensitive dictionary for Altium record field lookups.

Field lookups are case-insensitive. This class preserves that behavior: - Lookups are case-insensitive: d['Location.X'] finds 'LOCATION.X' - Original keys are preserved for iteration and serialization - First key wins: if you set 'Foo' then 'FOO', 'Foo' is kept

This enables clean parsing code: value = record.get('OwnerIndex', 0) # finds 'OwnerIndex' or 'OWNERINDEX'

Instead of the verbose fallback pattern: value = r.get('OwnerIndex', 0)

Members (3)
KindSignatureSummary
methodcopy(self) -> 'CaseInsensitiveDict'Return a shallow copy.
methodget(self, key: 'str', default: 'Any' = None) -> 'Any'
methodpop(self, key: 'str', *args: 'Any') -> 'Any'
class

ColorValue

from altium_monkey import ColorValue
class ColorValue(_win32: 'int') -> 'None'

Public color helper for schematic and PCB APIs.

The public API should not require callers to know Altium's internal Win32 BGR integer encoding. `ColorValue` provides a small boundary type that can be created from RGB, hex, or an existing Win32 color integer.

Members (6)
KindSignatureSummary
classmethodfrom_hex(cls, color_hex: 'str') -> 'ColorValue'Create a color helper from a `#RRGGBB` or `RRGGBB` string.
classmethodfrom_rgb(cls, r: 'int', g: 'int', b: 'int') -> 'ColorValue'Create a color helper from RGB byte values.
classmethodfrom_win32(cls, color: 'int') -> 'ColorValue'Create a color helper from an Altium Win32 BGR integer.
propertyhex -> 'str'Color as a `#RRGGBB` string.
propertyrgb -> 'tuple[int, int, int]'Color as an `(r, g, b)` tuple.
propertywin32 -> 'int'Altium Win32 BGR integer form.
class

CoordPoint

from altium_monkey import CoordPoint
class CoordPoint(x: 'int' = 0, y: 'int' = 0, x_frac: 'int' = 0, y_frac: 'int' = 0) -> 'None'

Coordinate point with sub-mil precision.

Altium stores coordinates as integer + fractional parts: - Integer part: 10mil units (0.01 inch) - Fractional part: 1/10000 of integer unit (sub-mil precision)

Float inputs are automatically converted to int at assignment.

Members (7)
KindSignatureSummary
classmethodfrom_mils(cls, x_mils: 'float', y_mils: 'float') -> 'CoordPoint'Create from mil coordinates.
propertyx -> 'int'X coordinate integer part.
propertyx_frac -> 'int'X coordinate fractional part.
propertyx_mils -> 'float'Get X coordinate in mils.
propertyy -> 'int'Y coordinate integer part.
propertyy_frac -> 'int'Y coordinate fractional part.
propertyy_mils -> 'float'Get Y coordinate in mils.
class

EmbeddedAssetInventory

from altium_monkey import EmbeddedAssetInventory
class EmbeddedAssetInventory(source_kind: "Literal['pcbdoc', 'pcblib']", source_path: 'str | None', models: 'tuple[EmbeddedPcbModelSummary, ...]', fonts: 'tuple[EmbeddedPcbFontSummary, ...]', opaque_assets: 'tuple[EmbeddedOpaqueAssetSummary, ...]' = ()) -> 'None'

Aggregate read-only embedded PCB asset inventory.

Members (1)
KindSignatureSummary
methodto_dict(self, *, include_schema: 'bool' = True) -> 'dict[str, object]'Return the stable downstream JSON-ready inventory shape.
class

EmbeddedAssetReference

from altium_monkey import EmbeddedAssetReference
class EmbeddedAssetReference(source_object_kind: "Literal['component_body', 'footprint', 'pcb_component', 'unknown']", source_object_index: 'int | None', asset_kind: "Literal['model', 'font', 'opaque']", asset_index: 'int', asset_id: 'str | None' = None, role: 'str | None' = None) -> 'None'

Reference from a PCB object to an embedded asset inventory entry.

class

EmbeddedFont

from altium_monkey import EmbeddedFont
class EmbeddedFont(name: 'str', style: 'str', compressed_data: 'bytes', raw_data: 'bytes', face_name: 'str | None' = None, native_bold: 'bool | None' = None, native_italic: 'bool | None' = None, native_full_name: 'str | None' = None, native_style: 'str | None' = None, native_charset: 'int | None' = None) -> 'None'

Embedded TrueType font file.

Attributes: name: Font family name (e.g., "Bunny") style: Font style (e.g., "Regular", "Bold") filename: Reconstructed filename (e.g., "Bunny-Regular.ttf") compressed_data: Zlib-compressed TTF file data raw_data: Complete raw binary data

Members (4)
KindSignatureSummary
methoddecompress(self) -> 'bytes'Decompress the TTF file data.
methoddecompressed_payload(self) -> 'bytes'The decompressed font data (Rust
propertyfilename -> 'str'Get reconstructed filename.
methodsave_to_file(self, output_path: 'Path') -> 'None'Save decompressed TTF to file.
class

EmbeddedFontAssetDetails

from altium_monkey import EmbeddedFontAssetDetails
class EmbeddedFontAssetDetails(style: 'str' = '', compressed_size: 'int' = 0, decompressed_size: 'int' = 0, raw_size: 'int' = 0, support_status: 'str' = '') -> 'None'

Typed details for an embedded font extractable asset.

class

EmbeddedFontChoice

from altium_monkey.altium_embedded_font_helpers import EmbeddedFontChoice
class EmbeddedFontChoice(kind: "Literal['record', 'installed', 'replaced', 'default_face']", index: 'int | None' = None, replacement: 'AltiumFontAnswer | None' = None) -> 'None'

What a TrueType Text draws from (Rust ``EmbeddedFontChoice``; EmbeddedFontResolver.choose): the board's record of ``index`` (``record``), the installed font of the family (``installed``), Altium's substitution font, Arial, in the Text's style where Altium replaces the font for ``replacement`` (``replaced``), or Windows' default face, Arial, where Altium's cache accepts the family by a record Windows refused and no face of it is installed (``default_face``).

class

EmbeddedFontName

from altium_monkey.altium_embedded_files import EmbeddedFontName
class EmbeddedFontName(full_name: 'str', family: 'str') -> 'None'

An embedded font record's names as saved (Rust ``EmbeddedFontName``): its full name and its family (face name), either of which may be empty.

Members (2)
KindSignatureSummary
propertylabel -> 'str'The name a message gives the record: its full name, else its
methodnames(self, family: 'str') -> 'bool'Whether a Text's font ``family`` names this record, by its full
class

EmbeddedFontRecord

from altium_monkey.altium_embedded_font_helpers import EmbeddedFontRecord
class EmbeddedFontRecord(full_name: 'str', family: 'str', style_name: 'str', bold: 'bool', italic: 'bool', charset: 'int' = 1, path: 'str | None' = None, collection_shift: 'int' = 0) -> 'None'

One record of a board's embedded fonts (``EmbeddedFonts6``) as saved, with its copy as the view draws it (Rust ``EmbeddedFontRecord``).

``full_name``, ``family`` and ``style_name`` are the record's saved names; ``bold`` and ``italic`` its saved bytes; ``charset`` its saved Windows charset. ``path`` is the file the renderer draws the copy from, healed when it is a face copied out of a TrueType collection with the collection's offsets, or None when it cannot be read either way; ``collection_shift`` how many bytes earlier the healed copy's tables are read, 0 for a copy read as saved. ``from_saved`` makes one from a record's saved fields and payload, healing the copy.

Members (4)
KindSignatureSummary
methodaltium_full_name(self) -> 'str'The full name Altium keeps (Rust
classmethodfrom_saved(cls, full_name: 'str', family: 'str', style_name: 'str', bold: 'bool', italic: 'bool', charset: 'int', payload: 'bytes') -> 'EmbeddedFontRecord'A record as a board saves it, with its decompressed payload (empty
propertygdi_takes_copy -> 'bool'Whether GDI takes the copy as saved: readable without a heal (a
methodstyle(self) -> 'tuple[bool, bool]'The bold and italic Altium reads the record as: its saved byte, or
class

EmbeddedFontResolver

from altium_monkey.altium_embedded_font_helpers import EmbeddedFontResolver
class EmbeddedFontResolver(records: 'tuple[EmbeddedFontRecord, ...]' = (), installed_fonts: 'InstalledFonts | None' = None) -> 'None'

The face of a board's embedded fonts a TrueType Text draws from, under a font policy, and where Altium replaces the Text's font (Rust ``EmbeddedFontResolver``). Its installed fonts are ``installed_fonts``, ``InstalledFonts.this_machine()`` when none is given; a font alias the caller registered (register_font_alias) is an installed face of its family too. The policy is each question's own (``choose``). Read-only: its answers are computed once.

Calling it gives the file of the record a Text reads (``face``), the font resolver contract (``FontPathResolver``).

Members (5)
KindSignatureSummary
methodchoose(self, family: 'str', bold: 'bool', italic: 'bool', policy: 'FontPolicy' = 'altium') -> 'EmbeddedFontChoice'What a Text of this family and style draws from under ``policy``.
methoddrawn(self, family: 'str', bold: 'bool', italic: 'bool', policy: 'FontPolicy' = 'altium') -> 'EmbeddedFontChoice'What a Text of this family and style is drawn from under
methodface(self, family: 'str', bold: 'bool', italic: 'bool') -> 'int | None'The record a Text of this family and style reads, for notes about
methodinstalled_face(self, family: 'str', bold: 'bool', italic: 'bool', policy: 'FontPolicy' = 'altium') -> 'InstalledTrueTypeFace | None'The installed face a Text of this family and style draws from
methodregistered_records(self, family: 'str') -> 'tuple[int, ...]'The records of a family Altium registers with Windows, in record
class

EmbeddedFontsEnd

from altium_monkey.altium_embedded_files import EmbeddedFontsEnd
class EmbeddedFontsEnd(loaded: 'int', record: 'EmbeddedFontName | None', reason: 'EmbeddedFontsEndReason', unread: 'tuple[EmbeddedFontName, ...]' = ()) -> 'None'

Where Altium stops loading a board's embedded fonts (Rust ``EmbeddedFontsEnd``). Altium reads as many records as the section's Header counts and inflates each payload with zlib. Where the inflate fails, the section's load ends there ("The following exception occurred whilst loading section EmbeddedFonts6 / Class not registered"), and no record from it on gets an entry in Altium's font cache, so their fonts count as not embedded. On a payload cut short, ZDecompress never returns and Altium stops responding; the load is taken to end there too.

``loaded`` is how many of the board's ``embedded_fonts``, in order, Altium loads; ``record`` the record the load ends at (None for a record whose fields run past the stream and for records after the Header count); ``reason`` why; ``unread`` the later records, which Altium does not read (a record identical to an earlier one is the same font and is not repeated).

Members (1)
KindSignatureSummary
methodleaves_unread(self, family: 'str') -> 'bool'Whether a Text's font ``family`` names a font the end leaves
class

EmbeddedModel

from altium_monkey import EmbeddedModel
class EmbeddedModel(index: 'int', name: 'str', id: 'str', compressed_data: 'bytes', is_embedded: 'bool' = True, model_format: 'str' = 'unknown') -> 'None'

Embedded 3D model file.

Attributes: index: Model index (0, 1, 2, ...) name: Model filename from Models/Data properties (if available) id: Model ID/GUID from Models/Data compressed_data: Zlib-compressed model data is_embedded: True if model data is embedded model_format: Classified format from filename extension

Members (4)
KindSignatureSummary
methoddecompress(self) -> 'bytes'Decompress embedded model data.
propertyfilename -> 'str'Get filename (from name or generated).
propertyis_step -> 'bool'True when classified as STEP by extension.
methodsave_to_file(self, output_path: 'Path') -> 'None'Save decompressed model data to file.
class

EmbeddedModelAssetDetails

from altium_monkey import EmbeddedModelAssetDetails
class EmbeddedModelAssetDetails(model_format: 'str' = '', id: 'str' = '', compressed_size: 'int' = 0, decompressed_size: 'int' = 0, is_embedded: 'bool' = False, references: 'tuple[EmbeddedAssetReference, ...]' = ()) -> 'None'

Typed details for an embedded model extractable asset.

class

EmbeddedOpaqueAssetSummary

from altium_monkey import EmbeddedOpaqueAssetSummary
class EmbeddedOpaqueAssetSummary(kind: "Literal['opaque']", index: 'int', source_kind: "Literal['pcbdoc', 'pcblib']", source_path: 'str | None', stream_name: 'str', extraction_filename: 'str | None', raw_size: 'int | None', payload_available: 'bool', payload_sha256: 'str | None' = None, support_status: "Literal['opaque', 'unsupported']" = 'opaque', reason: 'str | None' = None) -> 'None'

Summary for preserved embedded bytes that are not parsed as typed assets.

class

FaceFile

from altium_monkey.altium_text_to_polygon import FaceFile
class FaceFile(drawn_from: 'FaceFileSource', path: 'str | None' = None, face_index: 'int' = 0, record: 'int | None' = None, stand_in: 'str | None' = None, metric_compatible: 'bool' = False, healed_shift: 'int' = 0, variation: 'Mapping[str, int] | None' = None, cell: 'WindowsCell | None' = None, weight: 'int | None' = None, italic: 'bool | None' = None) -> 'None'

The file a face's glyphs are read from, and why (Rust ``FaceFile``).

``drawn_from`` is ``record`` (a registered record's copy), ``installed_file`` (the face's installed file), ``embedded_copy`` (the board's copy of an installed face, healed by ``healed_shift`` bytes where it is a collection face copy), ``stand_in`` (the bundled ``stand_in``, ``metric_compatible`` or a class stand-in) or ``none`` (no file reads). ``path`` is the file drawn and ``face_index`` its face; ``record`` the board's record read; ``variation`` the named instance drawn (16.16 Fixed axis values); ``cell``, ``weight`` and ``italic`` the Windows face's, which a stand-in is drawn at and simulated as.

class

FileVersionChange

from altium_monkey.altium_file_version_info import FileVersionChange
class FileVersionChange(index: 'int', version_introduced: 'str', forward_message: 'str', backward_message: 'str', feature_guid: 'str | None', can_be_absent: 'bool') -> 'None'

One format change: the release that introduced it, the warnings an older (forward) or newer (backward) Altium shows for it, and its feature GUID when it is a feature entry rather than one of the fixed table.

class

FileVersionInfo

from altium_monkey.altium_file_version_info import FileVersionInfo
class FileVersionInfo(state: 'FileVersionInfoState', declared_count: 'int | None', changes: 'tuple[FileVersionChange, ...]', issues: 'tuple[FileVersionInfoIssue, ...]' = ()) -> 'None'

A document's ``FileVersionInfo/Data`` stream, decoded.

Members (4)
KindSignatureSummary
propertyfeature_changes -> 'tuple[FileVersionChange, ...]'The entries for newer features the document uses.
propertyfixed_changes -> 'tuple[FileVersionChange, ...]'The saving build's fixed table: the entries without a GUID.
propertyformat_generation -> 'int | None'How many fixed entries the saving build wrote: its file-format
propertyformat_generation_label -> 'str | None'The saving build's own label for its newest fixed entry (the text
class

FileVersionInfoIssue

from altium_monkey.altium_file_version_info import FileVersionInfoIssue
class FileVersionInfoIssue(code: 'FileVersionInfoIssueCode', detail: 'str') -> 'None'

Something in the stream that did not read as Altium writes it.

class

FontIDManager

from altium_monkey import FontIDManager
class FontIDManager(sheet: 'AltiumSchSheet | _FontStorageLike') -> 'None'

Document-level font table manager for SchDoc and SchLib files.

Provides: - Font lookup by name, size, and style - Automatic font creation when needed - Portable stored font ID allocation (1-999) - Font ID translation (file ID <-> internal ID)

Works with both document types: - SchDoc: Attach to AltiumSchSheet (fonts in Sheet record) - SchLib: Create with from_font_dict() (fonts in FileHeader)

Usage (SchDoc): schdoc = AltiumSchDoc("design.SchDoc") font_id = schdoc.font_manager.get_or_create_font("Arial", 10)

Members (19)
KindSignatureSummary
propertyfont_count -> 'int'Current number of fonts in table.
propertyfonts -> 'dict[int, _FontSpec]'Direct access to font table dict.
classmethodfrom_font_dict(cls, fonts: '_FontTableInput | None' = None) -> 'FontIDManager'Create FontIDManager from a font dictionary.
methodget_default_font_id(self) -> 'int'Get the default font ID (always 1).
methodget_export_font_table(self) -> 'list[_FontSpec]'Get font table for export (only flagged fonts, in output order).
methodget_font_info(self, font_id: 'int') -> '_FontSpec | None'Get font attributes for ID.
methodget_font_name(self, font_id: 'int') -> 'str'Get font name by ID. Returns 'Unknown(ID=N)' if not found.
methodget_font_size(self, font_id: 'int') -> 'int'Get font size by ID. Returns 0 if not found.
methodget_or_create_font(self, font_name: 'str' = 'Times New Roman', font_size: 'int' = 10, bold: 'bool' = False, italic: 'bool' = False, rotation: 'int' = 0, underline: 'bool' = False, strikeout: 'bool' = False) -> 'int'Find existing font or create new one.
methodis_bold(self, font_id: 'int') -> 'bool'Get whether font is bold.
methodis_italic(self, font_id: 'int') -> 'bool'Get whether font is italic.
classmethodload_from_ole_header(cls, ole: 'AltiumOleFile', header_section: 'str' = 'FileHeader') -> 'FontIDManager'Load FontIDManager from OLE FileHeader section.
classmethodload_from_record(cls, record: 'Mapping[str, object]') -> 'FontIDManager'Load FontIDManager from a parsed record dict.
methodmark_for_save(self, internal_font_id: 'int') -> 'None'Mark a font as used, ensuring it will be exported.
methodsetup_in_translator(self, file_fonts: '_FontTableInput') -> 'None'Set up input translation from file font table WITH DEDUPLICATION.
methodsetup_out_translator(self) -> 'None'Set up output translation for file writing.
propertysheet -> 'AltiumSchSheet | _FontStorageLike'Get the underlying live storage object.
methodtranslate_in(self, file_font_id: 'int') -> 'int'Translate file font ID to internal font ID.
methodtranslate_out(self, internal_font_id: 'int') -> 'int'Translate internal font ID to output file font ID.
class

FontReplacementRule

from altium_monkey import FontReplacementRule
class FontReplacementRule(requested_name: 'str', effective_name: 'str') -> 'None'

Explicit logical family replacement for portable rendering.

Members (1)
KindSignatureSummary
methodto_dict(self) -> 'dict[str, str]'Return the JSON-compatible replacement-rule shape used by WASM callers.
class

GdiFontPlacement

from altium_monkey.altium_text_to_polygon import GdiFontPlacement
class GdiFontPlacement(cell_units: 'int', origin_x_units: 'float', pixel_height: 'int | None' = None, pcb_units_per_pixel: 'int | None' = None, has_vdmx: 'bool' = False, bold: 'bool' = False, font_path: 'str | None' = None, italic: 'bool' = False, face_weight: 'int | None' = None, face_italic: 'bool | None' = None, face_index: 'int' = 0) -> 'None'

Windows font metrics and integer pixel advance placement, and the bold and italic GDI simulates for the request (Rust ``GdiFontPlacement``).

``simulated_bold`` (GDI emboldens a bold text whose face is lighter than bold, _gdi_embolden_points) and ``simulated_italic`` (GDI slants an italic text whose face it does not take as italic, _gdi_italic_shear) follow from the text's ``bold`` and ``italic`` and the drawn face's ``face_weight`` and ``face_italic``, which ``TrueTypeTextRenderer.gdi_font_placement`` records: they are derived on construction (``dataclasses.replace`` included), not constructor arguments, and a layout without the face's facts simulates neither.

class

GerberOutput

from altium_monkey.altium_outjob import GerberOutput
class GerberOutput(document_path: 'str' = '', output_name: 'str' = 'Gerber Files', units: 'str' = 'Imperial', decimals: 'int' = 5, embed_apertures: 'bool' = True, software_arcs: 'bool' = False, flash_pad_shapes: 'bool' = True, generate_drc_rules_file: 'bool' = True, generate_relief_shapes: 'bool' = True, generate_reports: 'bool' = True, optimize_change_location_commands: 'bool' = True, sorted_output: 'bool' = False, origin_position: 'str' = 'Relative', output_format: 'str' = 'Different', plot_layers: 'str' = '', plot_board_profile: 'bool' = False) -> 'None'

Typed Gerber (RS-274X) output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

GerberX2Output

from altium_monkey.altium_outjob import GerberX2Output
class GerberX2Output(document_path: 'str' = '', output_name: 'str' = 'Gerber X2 Files', units: 'str' = 'Metric', decimals: 'int' = 5, embed_apertures: 'bool' = True, software_arcs: 'bool' = False, flash_pad_shapes: 'bool' = True, generate_drc_rules_file: 'bool' = True, generate_relief_shapes: 'bool' = True, generate_reports: 'bool' = True, optimize_change_location_commands: 'bool' = True, sorted_output: 'bool' = False, origin_position: 'str' = 'Relative', output_format: 'str' = 'Different', plot_layers: 'str' = '') -> 'None'

Typed Gerber X2 output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

GlyphPolygon

from altium_monkey.altium_text_to_polygon import GlyphPolygon
class GlyphPolygon(outline: 'list[tuple[float, float]]', holes: 'list[list[tuple[float, float]]]' = <factory>) -> 'None'

A single glyph region: outer boundary + optional holes.

In IPC-2581, this maps to one <Contour> element with a <Polygon> for the outline and <Cutout> elements for holes.

class

InstalledCffFace

from altium_monkey.altium_installed_fonts import InstalledCffFace
class InstalledCffFace(family: 'str', full_name: 'str', weight: 'int', italic: 'bool', path: 'str | None' = None) -> 'None'

An installed OpenType PostScript (CFF) face (Rust ``InstalledCffFace``): its family (name ID 1, cut to 31 characters), full name, weight and italic, and ``path``, the caller's file it is in (None for a face of this machine). Altium's font check and Windows' font mapper count TrueType faces only, so it never counts as installed; it is kept so that a report can say one is installed.

class

InstalledFile

from altium_monkey.altium_installed_fonts import InstalledFile
class InstalledFile(path: 'str', face_index: 'int' = 0, variation: 'Variation | None' = None) -> 'None'

The file an installed face is drawn from (Rust ``InstalledFile``): its path, the face's index in a collection and a variable font's named instance, its axis values by tag as OpenType 16.16 Fixed integers (``Variation``). Rust draws a face of this machine whose data is outside the font folders from memory; Python, whose renderer reads files, from a copy in a folder of this process's, removed when it exits.

class

InstalledFonts

from altium_monkey import InstalledFonts
class InstalledFonts(kind: 'InstalledFontsKind', font_files: 'tuple[str, ...]' = (), font_folders: 'tuple[str, ...]' = (), _list: 'str' = '/home/runner/work/altium_monkey/altium_monkey/src/py/altium_monkey/data/fonts/standard_windows_11.json', _machine: 'bool' = False, _machine_files: 'bool' = False, _added: 'tuple[tuple[str, str], ...]' = ()) -> 'None'

The installed-font list Altium's font rule reads (Rust ``InstalledFonts``).

``standard_windows()`` is the standard Windows 11 list alone, with none of this machine's font files; ``this_machine()`` (the views' default) adds this machine's installed fonts on Windows; ``from_json(path)`` reads a recorded list in their place. ``with_font_files`` and ``with_font_folders`` add the caller's TrueType faces, which count as installed and are drawn from those files. ``kind`` names the list; the caller's files and folders are ``font_files`` and ``font_folders``.

Members (9)
KindSignatureSummary
methodfaces(self, family: 'str') -> 'tuple[InstalledTrueTypeFace, ...]'The installed TrueType faces of a family, each full name once
classmethodfrom_json(cls, path: 'str | os.PathLike[str]') -> 'InstalledFonts'A list read from an ``installed_fonts.a0`` file, in place of the
methodgives_file(self, path: 'str | os.PathLike[str]') -> 'bool'Whether a font file is one the caller gave (Rust
methodinstalled_cff_faces(self, family: 'str') -> 'tuple[InstalledCffFace, ...]'The installed OpenType PostScript (CFF) faces of a family, each
methodis_standard(self, full_name: 'str') -> 'bool'Whether a face of this full name is on the standard Windows list.
classmethodstandard_windows(cls) -> 'InstalledFonts'The standard Windows 11 list alone: the same answer and the same
classmethodthis_machine(cls) -> 'InstalledFonts'The standard list, plus this machine's installed fonts on Windows
methodwith_font_files(self, paths: 'Iterable[str | os.PathLike[str]]') -> 'InstalledFonts'This list, plus the TrueType faces of these font files, drawn from
methodwith_font_folders(self, paths: 'Iterable[str | os.PathLike[str]]') -> 'InstalledFonts'This list, plus the TrueType faces of the font files in these
class

InstalledTrueTypeFace

from altium_monkey.altium_installed_fonts import InstalledTrueTypeFace
class InstalledTrueTypeFace(family: 'str', full_name: 'str', weight: 'int', italic: 'bool', units_per_em: 'int | None' = None, win_ascent: 'int | None' = None, win_descent: 'int | None' = None, vdmx: 'bool' = False, stand_in: 'str | None' = None, metric_compatible: 'bool' = False, variation: 'Variation | None' = None, path: 'str | None' = None, face_index: 'int' = 0, _gdi: 'GdiFace | None' = None) -> 'None'

An installed TrueType face as GDI enumerates it (Rust ``InstalledTrueTypeFace``): its family, full name in the system's language, OS/2 weight and whether GDI takes it as italic; for a listed face its cell metrics (units per em, win ascent and descent, VDMX), its stand-in family and whether the stand-in has its metrics, and a variable font's named instance; ``path`` and ``face_index`` the file of a listed or given face, where this list knows one. ``installed_file()`` is the file the face is drawn from: for a face of this machine, read from the data GDI gives for it when a Text first draws from it.

Members (1)
KindSignatureSummary
methodinstalled_file(self) -> 'InstalledFile | None'The file this face is drawn from (Rust ``installed_file``): this
class

IPC2581Output

from altium_monkey.altium_outjob import IPC2581Output
class IPC2581Output(document_path: 'str' = '', output_name: 'str' = 'IPC-2581B', version: 'str' = 'B', units: 'str' = 'Metric', precision: 'int' = 6, wise_support: 'bool' = False, merge_net_tie_nets: 'bool' = False, oem_design_number_ref: 'str' = 'DesignItemID', different_footprints: 'bool' = True) -> 'None'

Typed IPC-2581 output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

NCDrillOutput

from altium_monkey.altium_outjob import NCDrillOutput
class NCDrillOutput(document_path: 'str' = '', output_name: 'str' = 'NC Drill Files', units: 'str' = 'Imperial', decimals: 'int' = 5, number_of_units: 'int' = 2, optimize_change_location_commands: 'bool' = True, origin_position: 'str' = 'Relative', zeroes_mode: 'str' = 'SuppressTrailingZeroes', generate_board_edge_rout: 'bool' = False, generate_drilled_slots_g85: 'bool' = False, generate_eia_drill_file: 'bool' = False, separate_plated: 'bool' = False, generate_separate_via_type_files: 'bool | None' = None, generate_tools_by_drill_symbols: 'bool | None' = None, board_edge_rout_tool_dia: 'int' = 2000000) -> 'None'

Typed NC Drill output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

ODBOutput

from altium_monkey.altium_outjob import ODBOutput
class ODBOutput(document_path: 'str' = '', output_name: 'str' = 'ODB++ Files') -> 'None'

Typed ODB++ output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

OleDirEntry

from altium_monkey import OleDirEntry
class OleDirEntry(sid: 'int', name: 'str', name_raw: 'bytes', entry_type: 'int', color: 'int', sid_left: 'int', sid_right: 'int', sid_child: 'int', clsid: 'bytes', user_flags: 'int', create_time: 'int', modify_time: 'int', start_sector: 'int', size: 'int', is_mini: 'bool' = False, path: 'str' = '') -> 'None'

Parsed directory entry.

Members (3)
KindSignatureSummary
propertyis_root -> 'bool'
propertyis_storage -> 'bool'
propertyis_stream -> 'bool'
class

OpaqueEmbeddedAssetDetails

from altium_monkey import OpaqueEmbeddedAssetDetails
class OpaqueEmbeddedAssetDetails(raw_size: 'int' = 0, support_status: 'str' = '', reason: 'str' = '') -> 'None'

Typed details for an opaque embedded extractable asset.

class

OutJobConfigRecord

from altium_monkey.altium_outjob import OutJobConfigRecord
class OutJobConfigRecord(record_name: 'str | None' = None, fields: 'tuple[tuple[str, str], ...]' = (), leading_separator: 'bool' = False) -> 'None'

Strongly typed representation of an OutJob config payload.

Members (1)
KindSignatureSummary
methodto_string(self) -> 'str'
class

OutJobNormalizationResult

from altium_monkey.altium_outjob_runner import OutJobNormalizationResult
class OutJobNormalizationResult(outjob_path: 'Path', changed: 'bool', generated_medium_indices: 'tuple[int, ...]', updated_fields: 'int', rebound_document_paths: 'int') -> 'None'

Summary of normalization work performed on an OutJob file.

class

OutJobOutputSpec

from altium_monkey.altium_outjob import OutJobOutputSpec
class OutJobOutputSpec(output_type: 'str', output_name: 'str', category: 'str', document_path: 'str' = '', variant_name: 'str' = '', page_options: 'str' = '', configuration_items: 'tuple[tuple[str, str], ...]' = ()) -> 'None'

Output specification consumed by AltiumOutJob.add_output_spec().

class

OutJobRunRequest

from altium_monkey.altium_outjob_runner import OutJobRunRequest
class OutJobRunRequest(project_path: 'Path | str', outjob_path: 'Path | str | None' = None, timeout_seconds: 'float' = 300.0, normalize_generated_paths: 'bool' = True, default_generated_output_path: 'str | None' = None, bind_pcbdoc_path: 'Path | str | None' = None, auto_bind_pcbdoc: 'bool' = False, stage_outjob_copy: 'bool' = True, script_directory: 'Path | str | None' = None, keep_script_artifacts: 'bool' = False, poll_interval_seconds: 'float' = 0.5, kill_after_run: 'bool' = False) -> 'None'

Input payload for running one OutJob.

class

OutJobRunResult

from altium_monkey.altium_outjob_runner import OutJobRunResult
class OutJobRunResult(project_path: 'Path', outjob_path: 'Path', success: 'bool', launch_code: 'int', timed_out: 'bool', error_count: 'int', marker_text: 'str', normalized_changed: 'bool', rebound_document_paths: 'int', marker_path: 'Path', log_path: 'Path', log_text: 'str') -> 'None'

Result of one OutJob run.

class

PickPlaceOutput

from altium_monkey.altium_outjob import PickPlaceOutput
class PickPlaceOutput(document_path: 'str' = '', output_name: 'str' = 'Pick and Place', units: 'str' = 'Metric', generate_csv_format: 'bool' = True, generate_text_format: 'bool' = False, show_units: 'bool' = False, separator: 'str' = '.', exclude_filter_param: 'bool | None' = None, include_variations: 'bool | None' = None, include_standard_no_bom: 'bool | None' = None, filter_text: 'str | None' = None, filter_active: 'bool | None' = None, y_flip: 'bool' = False, different_footprints: 'bool' = False, columns: 'tuple[str, ...]' = ()) -> 'None'

Typed Pick and Place output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

StrokeTextRenderer

from altium_monkey.altium_text_to_polygon import StrokeTextRenderer
class StrokeTextRenderer()

Renders Altium stroke font text to line segments.

Altium's stroke font uses simple vectorized characters defined as line segments. Each character shape is stored in a normalized coordinate space and scaled to the target height.

Members (1)
KindSignatureSummary
methodrender(self, text: 'str', height_mm: 'float' = 1.524, stroke_width_mm: 'float' = 0.254, x_mm: 'float' = 0.0, y_mm: 'float' = 0.0, rotation: 'float' = 0.0, is_mirrored: 'bool' = False, stroke_font_type: 'int' = 0, justification: 'int' = 3, frame_width_mm: 'float' = 0.0, frame_height_mm: 'float' = 0.0, stroke_advance_adjustments: 'dict[int, float] | None' = None, stroke_cursor_advances: 'list[float] | None' = None, target_ink_width_mm: 'float | None' = None, frame_margin_mm: 'float' = 0.0) -> 'StrokeTextResult'Render stroke text to line segments.
class

StrokeTextResult

from altium_monkey.altium_text_to_polygon import StrokeTextResult
class StrokeTextResult(lines: 'list[tuple[float, float, float, float]]' = <factory>, stroke_width_mm: 'float' = 0.254) -> 'None'

Result of stroke text conversion.

lines: List of (x1, y1, x2, y2) in mm, representing stroke centerlines. stroke_width_mm: Line width for rendering.

class

TextPolygonResult

from altium_monkey.altium_text_to_polygon import TextPolygonResult
class TextPolygonResult(characters: 'list[list[GlyphPolygon]]' = <factory>, font_sources: 'TextFontSources | None' = None, font: "'TrueTypeFontChoice | None'" = None) -> 'None'

Result of TrueType text-to-polygon conversion.

characters: One entry per visible character. Each character may have multiple polygons (e.g., 'i' has dot + body as separate regions).

Members (1)
KindSignatureSummary
propertytotal_contours -> 'int'
class

TrueTypeFontChoice

from altium_monkey.altium_text_to_polygon import TrueTypeFontChoice
class TrueTypeFontChoice(family: 'str', bold: 'bool', italic: 'bool', altium: 'EmbeddedFontChoice', altium_face: 'str', face: 'str', face_file: 'FaceFile | None', policy: 'FontPolicy' = 'altium') -> 'None'

A TrueType font as Altium answers it and as it is drawn here (Rust ``TrueTypeFontChoice``): the entry of one font, with the fields of a board's font report entry (``altium_monkey.fab.font_report.PcbFontUse``) that do not count the board's Texts.

``family``, ``bold`` and ``italic`` are the font asked for. ``altium`` is Altium's answer (``EmbeddedFontResolver.choose`` under Altium's rule: a registered record, the installed face, Arial in the font's place, with ``replaced_reason``, or Windows' default face) and ``altium_face`` the face it draws; ``face`` is the face drawn here under ``policy`` (``record`` where it is a board's record; ``differs_from_altium`` where the policy draws another face or record than Altium's rule), each by its full name. ``face_file`` is the file its glyphs are read from and why (``FaceFile``: ``drawn_from``, ``stand_in``, ``metric_compatible``, ``healed_shift``; ``path`` and ``face_index``), and ``simulated_bold`` and ``simulated_italic`` the bold and italic GDI simulates for the request on the face drawn (``GdiFontPlacement``).

Members (11)
KindSignatureSummary
propertydiffers_from_altium -> 'bool'Whether the policy draws another face or record than Altium's
propertydrawn_from -> 'FaceFileSource'Where the face's glyphs are read from (``FaceFile.drawn_from``).
propertyface_index -> 'int'The face's index in its file, a collection's.
propertyhealed_shift -> 'int'The collection shift of a healed copy drawn, else 0.
propertymetric_compatible -> 'bool'Whether the stand-in drawn has the face's character widths.
propertypath -> 'str | None'The font file the face is read from, where it reads.
propertyrecord -> 'int | None'The board's record drawn, where the face is one.
propertyreplaced_reason -> 'AltiumFontAnswer | None'Why Altium replaces the font with Arial, where it does.
propertysimulated_bold -> 'bool'Whether GDI emboldens the face drawn: a bold request whose face is
propertysimulated_italic -> 'bool'Whether GDI slants the face drawn: an italic request whose face it
propertystand_in -> 'str | None'The bundled stand-in drawn, where one is.
class

TrueTypeTextRenderer

from altium_monkey.altium_text_to_polygon import TrueTypeTextRenderer
class TrueTypeTextRenderer(*, font_policy: 'FontPolicy' = 'altium', installed_fonts: 'InstalledFonts | None' = None) -> 'None'

Renders TrueType text to filled polygon contours.

Uses FreeType for glyph outline extraction and HarfBuzz for text shaping (kerning, ligatures). Output polygons can be emitted as IPC-2581 Contour/Polygon/Cutout or SVG path elements.

Altium Sizing Model: PCB text Height = cell height (ascent + descent scaled) em_size = Height * factor factor = units_per_em / (usWinAscent + usWinDescent)

A text's font is chosen by ``choose_truetype_font`` under ``font_policy`` (Altium's rule, ``"altium"``, the default, or the opt-in ``"embedded_first"`` where a board's resolver is given; any other value is an error), against ``installed_fonts``, this machine's when none is given.

Members (3)
KindSignatureSummary
methodgdi_font_placement(self, font_name: 'str', height_units: 'int', *, is_bold: 'bool', is_italic: 'bool', font_resolver: 'FontPathResolver | None' = None) -> 'GdiFontPlacement | None'Return Altium's GDI layout of a PCB TrueType text, or None when the
methodobserve_nominal_render(self, text: 'str', font_name: 'str' = 'Arial', height_mm: 'float' = 1.524, x_mm: 'float' = 0.0, y_mm: 'float' = 0.0, rotation: 'float' = 0.0, is_mirrored: 'bool' = False, is_bold: 'bool' = False, is_italic: 'bool' = False, x_scale: 'float' = 1.0, flatten_tolerance: 'float' = 0.05, justification: 'int' = 3, frame_width_mm: 'float' = 0.0, frame_height_mm: 'float' = 0.0, is_inverted: 'bool' = False, inverted_margin_mm: 'float' = 0.0, anchor_to_ink_edge: 'bool | None' = None, font_resolver: 'FontPathResolver | None' = None, use_hb_positioning: 'bool' = False, gdi_placement: 'GdiFontPlacement | None' = None) -> 'tuple[TextPolygonResult, NominalRunObservation | None]'Inspect ONE actual render; absence is unsupported, never a pass.
methodrender(self, text: 'str', font_name: 'str' = 'Arial', height_mm: 'float' = 1.524, x_mm: 'float' = 0.0, y_mm: 'float' = 0.0, rotation: 'float' = 0.0, is_mirrored: 'bool' = False, is_bold: 'bool' = False, is_italic: 'bool' = False, x_scale: 'float' = 1.0, flatten_tolerance: 'float' = 0.05, justification: 'int' = 3, frame_width_mm: 'float' = 0.0, frame_height_mm: 'float' = 0.0, is_inverted: 'bool' = False, inverted_margin_mm: 'float' = 0.0, anchor_to_ink_edge: 'bool | None' = None, font_resolver: 'FontPathResolver | None' = None, use_hb_positioning: 'bool' = False, gdi_placement: 'GdiFontPlacement | None' = None) -> 'TextPolygonResult'Render TrueType text to polygon contours.
class

WindowsCell

from altium_monkey.altium_text_to_polygon import WindowsCell
class WindowsCell(units_per_em: 'int', win_ascent: 'int', win_descent: 'int', vdmx: 'bool') -> 'None'

A listed Windows face's cell (Rust ``WindowsCell``): its units per em, win ascent and descent, and whether it has a VDMX table.

constant

ALTIUM_CLSID

from altium_monkey import ALTIUM_CLSID
ALTIUM_CLSID: str
constant

ALTIUM_CLSID_BYTES

from altium_monkey import ALTIUM_CLSID_BYTES
ALTIUM_CLSID_BYTES: bytes
function

altium_expr

from altium_monkey.altium_outjob import altium_expr
def altium_expr(*parts: 'str') -> 'str'

Build an Altium project variable expression for path/filename fields.

In Altium OutJob files, values starting with ``=`` are evaluated as expressions at output generation time. This function combines variable names and quoted literals with ``+`` concatenation and prefixes the result with ``=``.

Bare strings are treated as project variable names. Use :func:`altium_literal` to wrap literal path segments.

Args: parts: Variable names (bare) and/or quoted literals from :func:`altium_literal`.

function

altium_literal

from altium_monkey.altium_outjob import altium_literal
def altium_literal(text: 'str') -> 'str'

Wrap a literal string for use in an Altium path expression.

Returns the text wrapped in single quotes, as required by Altium's expression evaluator.

Args: text: Literal text (e.g. a path separator or fixed prefix).

Returns: Single-quoted string, e.g. ``'\PCB'``.

enum

AltiumFontAnswer

from altium_monkey.altium_text_to_polygon import AltiumFontAnswer
enum AltiumFontAnswer

How Altium answers a TrueType Text's family and style (Rust ``truetype_text::AltiumFontAnswer``; EmbeddedFontResolver.choose): its font cache answers it (``EMBEDDED``), an installed TrueType face does (``INSTALLED``), or Altium's substitution font, Arial, replaces it, because no installed TrueType face of the family has the style and the family has more than one (``STYLE_NOT_INSTALLED``), because the board embeds the family only in records the cache does not take for the style and no TrueType face of it is installed (``STYLE_NOT_EMBEDDED``), or because the family is neither embedded nor installed as a TrueType face (``NOT_FOUND``).

Members (5)
KindSignatureSummary
memberEMBEDDED= 'embedded'
memberINSTALLED= 'installed'
memberSTYLE_NOT_INSTALLED= 'style_not_installed'
memberSTYLE_NOT_EMBEDDED= 'style_not_embedded'
memberNOT_FOUND= 'not_found'
function

canonicalize_stroke_font_type

from altium_monkey.altium_text_to_polygon import canonicalize_stroke_font_type
def canonicalize_stroke_font_type(stroke_font_type: 'int | None') -> 'int'

Normalize PCB TEXT stroke font ids to the canonical 1/2/3 range.

Native PCB TEXT records use: 1 -> Default 2 -> Sans Serif 3 -> Serif

Older tests and some helper callsites historically treated the field as 0-based. Keep 0/None/unknown values as a compatibility path to Default, but normalize them immediately so all downstream code sees one convention.

function

choose_truetype_font

from altium_monkey.altium_text_to_polygon import choose_truetype_font
def choose_truetype_font(font_name: 'str', bold: 'bool' = False, italic: 'bool' = False, font_resolver: 'FontPathResolver | None' = None, *, font_policy: 'FontPolicy' = 'altium', installed_fonts: 'InstalledFonts | None' = None) -> 'TrueTypeFontChoice'

Choose the font a TrueType text draws with, by Altium's font rule.

The installed fonts are ``installed_fonts`` (this machine's when none is given), or a board resolver's own. With a board's resolver (``EmbeddedFontResolver``), or with none, what ``EmbeddedFontResolver.choose`` chooses under ``font_policy``: Arial in the text's style, origin ``replaced``, drawn from Arial's own file, where Altium replaces the font with its substitution font (Arial itself is never replaced); else the board's record it draws; else the installed face Windows' font mapper draws; else Windows' default face, Arial. The policy is Altium's rule (``"altium"``) unless the caller opts in to ``"embedded_first"``, which draws the board's readable record of the text's style first; any other value is an error.

With another resolver, the files it gives for the family's four styles count as installed faces of the family, and Altium's rule runs on them as on any installed face (a CFF file does not count). A registered font alias (register_font_alias) is an installed face of its family too.

function

classify_embedded_model_format

from altium_monkey.altium_embedded_files import classify_embedded_model_format
def classify_embedded_model_format(filename: 'str') -> 'str'

Classify embedded 3D model format by file extension (case-insensitive).

Supported classes: - step: .step / .stp - solidworks: .sldprt / .sldasm - parasolid_text: .x_t - parasolid_binary: .x_b - unknown: everything else

function

component_kind_includes_in_bom

from altium_monkey.altium_component_kind import component_kind_includes_in_bom
def component_kind_includes_in_bom(kind: 'ComponentKind | int') -> 'bool'

Return whether this component kind participates in BOM generation.

enum

ComponentKind

from altium_monkey import ComponentKind
enum ComponentKind

Component kind classification used by BOM and netlist helpers.

Members (7)
KindSignatureSummary
memberSTANDARD= 0
memberMECHANICAL= 1
memberGRAPHICAL= 2
memberNET_TIE_BOM= 3
memberNET_TIE_NO_BOM= 4
memberSTANDARD_NO_BOM= 5
memberJUMPER= 6
function

decode_file_version_info

from altium_monkey.altium_file_version_info import decode_file_version_info
def decode_file_version_info(data: 'bytes | None') -> 'FileVersionInfo'

Decode a ``FileVersionInfo/Data`` stream as Altium imports it: entries 0 to COUNT-1, a missing key an empty field, keys in any case, values as comma-separated UTF-16 code units. Never raises.

constant

DIR_ENTRY_SIZE

from altium_monkey import DIR_ENTRY_SIZE
DIR_ENTRY_SIZE: int
constant

ENDOFCHAIN

from altium_monkey import ENDOFCHAIN
ENDOFCHAIN: int
function

face_advances_differ

from altium_monkey.altium_text_to_polygon import face_advances_differ
def face_advances_differ(first: 'str', second: 'str', *, first_index: 'int' = 0, second_index: 'int' = 0) -> 'bool'

Whether two font files' faces have other advance widths (Rust ``face_advances_differ``): for any character both map in a cmap subtable of the same platform and encoding, the advances differ at a common em (each advance times the other face's units per em, compared as integers). False where either face cannot be read.

constant

FREESECT

from altium_monkey import FREESECT
FREESECT: int
constant

HEADER_SIZE

from altium_monkey import HEADER_SIZE
HEADER_SIZE: int
enum

LineShape

from altium_monkey import LineShape
enum LineShape

Line ending shape enumeration for polylines.

Controls the shape drawn at the start/end of polylines. These are "decorations" like arrowheads, tails, circles, squares.

Stored as the schematic line-shape enum.

Members (7)
KindSignatureSummary
memberNONE= 0
memberARROW= 1
memberSOLID_ARROW= 2
memberTAIL= 3
memberSOLID_TAIL= 4
memberCIRCLE= 5
memberSQUARE= 6
enum

LineStyle

from altium_monkey import LineStyle
enum LineStyle

Line style enumeration for polylines and lines.

Members (4)
KindSignatureSummary
memberSOLID= 0
memberDASHED= 1
memberDOTTED= 2
memberDASH_DOT= 3
enum

LineWidth

from altium_monkey import LineWidth
enum LineWidth

Schematic line width enumeration.

Native Altium schematic size mapping: - 0 = Smallest - 1 = Small - 2 = Medium - 3 = Large

Members (4)
KindSignatureSummary
memberSMALLEST= 0
memberSMALL= 1
memberMEDIUM= 2
memberLARGE= 3
constant

MINI_SECTOR_SIZE

from altium_monkey import MINI_SECTOR_SIZE
MINI_SECTOR_SIZE: int
constant

MINI_STREAM_CUTOFF

from altium_monkey import MINI_STREAM_CUTOFF
MINI_STREAM_CUTOFF: int
function

normalize_outjob_generated_paths

from altium_monkey.altium_outjob_runner import normalize_outjob_generated_paths
def normalize_outjob_generated_paths(outjob_path: 'Path | str', *, default_generated_output_path: 'str | None' = None, bind_pcbdoc_path: 'Path | str | None' = None, normalize_generated_fields: 'bool' = True, dry_run: 'bool' = False) -> 'OutJobNormalizationResult'

Normalize GeneratedFiles medium paths in an OutJob.

For every `OutputMediumN_Type=GeneratedFiles`: - `PublishSettings.OutputFilePathN` is cleared. - `PublishSettings.OutputBasePathN` is normalized to a directory path. - `GeneratedFilesSettings.RelativeOutputPathN` is set from the normalized base path.

Args: outjob_path: Path to the .OutJob file. default_generated_output_path: Relative fallback path used when existing GeneratedFiles paths are absolute or empty. bind_pcbdoc_path: Optional .PcbDoc path to inject into embedded `ConfigurationN_ItemM` `DocumentPath=` tokens. normalize_generated_fields: If True, normalize GeneratedFiles output path fields; if False, keep those fields unchanged. dry_run: If True, report required changes without writing.

function

normalize_pnp_position_mode

from altium_monkey.altium_pnp_position import normalize_pnp_position_mode
def normalize_pnp_position_mode(position_mode: 'PnpPositionMode | str | None' = None) -> 'PnpPositionMode'

Normalize a public pick-and-place position mode name.

``altium-pick-place`` matches Altium's Pick Place export by using the center of the bounding box of component-owned pad anchor points, with a component-origin fallback when no pads exist. ``component-origin`` uses the footprint placement origin directly.

Args: position_mode: Public mode name or a small compatibility alias.

Returns: Canonical public mode name.

constant

OLE_MAGIC

from altium_monkey import OLE_MAGIC
OLE_MAGIC: bytes
function

parse_component_kind

from altium_monkey.altium_component_kind import parse_component_kind
def parse_component_kind(record: 'dict[str, str]') -> 'ComponentKind | int'

Parse component kind from the versioned record fields.

constant

PNP_POSITION_MODE_ALTIUM_PICK_PLACE

from altium_monkey.altium_pnp_position import PNP_POSITION_MODE_ALTIUM_PICK_PLACE
PNP_POSITION_MODE_ALTIUM_PICK_PLACE: str
constant

PNP_POSITION_MODE_COMPONENT_ORIGIN

from altium_monkey.altium_pnp_position import PNP_POSITION_MODE_COMPONENT_ORIGIN
PNP_POSITION_MODE_COMPONENT_ORIGIN: str
constant

PNP_POSITION_MODES

from altium_monkey.altium_pnp_position import PNP_POSITION_MODES
PNP_POSITION_MODES: tuple
function

PnpPositionMode

from altium_monkey.altium_pnp_position import PnpPositionMode
def PnpPositionMode(*args, **kwargs)
enum

ReadOnlyState

from altium_monkey import ReadOnlyState
enum ReadOnlyState

Read-only state for parameters and designators.

Controls which parts of the parameter/designator can be edited: - NONE: Fully editable - NAME: Name is read-only, value editable - VALUE: Value is read-only, name editable - NAME_AND_VALUE: Both name and value are read-only

Members (4)
KindSignatureSummary
memberNONE= 0
memberNAME= 1
memberVALUE= 2
memberNAME_AND_VALUE= 3
function

rgb_to_win32_color

from altium_monkey.altium_record_types import rgb_to_win32_color
def rgb_to_win32_color(r: 'int', g: 'int', b: 'int') -> 'int'

Convert RGB tuple to Win32 color (0x00BBGGRR).

Args: r, g, b: RGB values (0-255)

Returns: Win32 color integer

function

stroke_font_type_from_label

from altium_monkey.altium_text_to_polygon import stroke_font_type_from_label
def stroke_font_type_from_label(font_label: 'str') -> 'int'

Map a human-readable label to the canonical stroke-font id.

Matching is case-insensitive. A label containing ``sans`` maps to Sans Serif (2), even when it also contains ``serif``; otherwise a label containing ``serif`` maps to Serif (3). All other labels map to Default (1).

altium-monkey v2026.11.26 · gobblerito·Docs updated 2026.11.29 17:55 UTC (0665053)