{"id":13721649,"url":"https://github.com/robotools/compositor","last_synced_at":"2026-01-22T18:53:11.640Z","repository":{"id":9587005,"uuid":"11504592","full_name":"robotools/compositor","owner":"robotools","description":"A basic OpenType GSUB and GPOS layout engine.","archived":false,"fork":false,"pushed_at":"2023-05-30T14:36:42.000Z","size":351,"stargazers_count":30,"open_issues_count":6,"forks_count":12,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-12-01T18:54:52.876Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-07-18T14:16:17.000Z","updated_at":"2024-10-04T05:16:39.000Z","dependencies_parsed_at":"2023-01-11T17:39:03.031Z","dependency_job_id":"a7f10383-40bb-4b08-95ba-6f3fa0c9ac0d","html_url":"https://github.com/robotools/compositor","commit_stats":null,"previous_names":["typesupply/compositor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robotools/compositor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotools%2Fcompositor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotools%2Fcompositor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotools%2Fcompositor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotools%2Fcompositor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotools","download_url":"https://codeload.github.com/robotools/compositor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotools%2Fcompositor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:01:19.734Z","updated_at":"2026-01-22T18:53:11.608Z","avatar_url":"https://github.com/robotools.png","language":"Python","readme":"compositor\n==========\n\nA basic OpenType GSUB and GPOS layout engine written in Python.\n\n\nTable of Contents\n-----------------\n\n- [Usage Reference](#usage-reference)\n    - [Assumptions](#assumptions)\n    - [The Font Object](#the-font-object)\n     - [The GlyphRecord Object](#the-glyphrecord-object)\n     - [The Glyph Object](#the-glyph-object)\n     - [The Info Object](#the-info-object)\n- [Development](#development)\n- [Installation](#installation)\n\n\n- - -\n\n\nUsage Reference\n---------------\n\nThis document covers the basic usage of the compositor package. For more detailed information read the documentation strings in the source.\n\n### Assumptions\n\nSome assumptions about the OpenType fonts being used are made by the package:\n\n* The font is valid.\n* The font's `cmap` table contains Platform 3 Encoding 1.\n* The font does not contain `GSUB` or `GPOS` lookup types that are not supported by the GSUB or GPOS objects. If an unsupported lookup type is present, the lookup will simply be ignored. It will not raise an error.\n\n### The Font Object\n\n#### Importing\n\n```python\nfrom compositor import Font\n```\n\n#### Construction\n\n```python\nfont = Font(path)\n```\n\n\u003cdl\u003e\n  \u003cdt\u003epath\n  \u003cdd\u003eA path to an OpenType font.\n\u003c/dl\u003e\n\n#### Special Behavior\n\n```python\nglyph = font[\"aGlyphName\"]\n```\n\nReturns the glyph object named `aGlyphName`. This will raise a `KeyError` if `aGlyphName` is not in the font.\n\n```python\nisThere = \"aGlyphName\" in font\n```\n\nReturns a boolean representing if `aGlyphName` is in the font.\n\n#### Methods\n\n```python\nfont.keys()\n```\n\nA list of all glyph names in the font.\n\n```python\nglyphRecords = font.process(aString)\n```\n\nThis is the most important method. It takes a string (Unicode or plain ASCII) and processes it with the features defined in the font's `GSUB` and `GPOS` tables. A list of `GlyphRecord` objects will be returned.\n\n```python\nfeatureTags = font.getFeatureList()\n```\n\nA list of all available features in GSUB and GPOS.\n\n```python\nstate = font.getFeatureState(featureTag)\n```\n\nGet a boolean representing if a feature is on or not. This assumes that the feature state is consistent in both the GSUB and GPOS tables. A `CompositorError` will be raised if the feature is inconsistently applied. A `CompositorError` will be raised if featureTag is not defined in GSUB or GPOS.\n\n```python\nfont.setFeatureState(self, featureTag, state)\n```\n\nSet the application state of a feature.\n\n#### Attributes\n\n\u003cdl\u003e\n  \u003cdt\u003einfo\n  \u003cdd\u003eThe Info object for the font.\n\u003c/dl\u003e\n\n### The GlyphRecord Object\n\n#### Attributes\n\n\u003cdl\u003e\n\n  \u003cdt\u003eglyphName\n  \u003cdd\u003eThe name of the referenced glyph.\n\n  \u003cdt\u003exPlacement\n  \u003cdd\u003eHorizontal placement.\n\n  \u003cdt\u003eyPlacement\n  \u003cdd\u003eVertical placement.\n\n  \u003cdt\u003exAdvance\n  \u003cdd\u003eHorizontal adjustment for advance.\n\n  \u003cdt\u003eyAdvance\n  \u003cdd\u003eVertical adjustment for advance.\n\n  \u003cdt\u003ealternates\n  \u003cdd\u003eA list of `GlyphRecords` indicating alternates for the glyph.\n\n\u003c/dl\u003e\n\n### The Glyph Object\n\n#### Methods\n\n```python\nglyph.draw(pen)\n```\n\nDraws the glyph with a FontTools pen.\n\n#### Attributes\n\n\u003cdl\u003e\n\n  \u003cdt\u003ename\n  \u003cdd\u003eThe name of the glyph.\n\n  \u003cdt\u003eindex\n  \u003cdd\u003eThe glyph's index within the source font.\n\n  \u003cdt\u003ewidth\n  \u003cdd\u003eThe width of the glyph.\n\n  \u003cdt\u003ebounds\n  \u003cdd\u003eThe bounding box for the glyph. Formatted as `(xMin, yMin, xMax, yMax)`. If the glyph contains no outlines, this will return `None`.\n\n\u003c/dl\u003e\n\n### The Info Object\n\n#### Attributes\n\n- familyName\n- styleName\n- unitsPerEm\n- ascender\n- descender\n\n\nDevelopment\n-----------\n\n### Relationship to the GSUB and GPOS Specification\n\nThe Compositor GSUB and GPOS tables adhere as closely as possible to the GSUB and GPOS specification. Every effort has been made to keep terminology consistent. All known deviations from the spec are documented. (The deviations are generally trivial. For example, most the of the subtables don't implement the `Count` attributes. This is done because the Python iterator provides a more convenient and faster way to deal with iteration than creating a range. Therefore, the `Count` objects are not needed.)\n\n### Object Loading\n\nFor performance reasons, when a new font is loaded, all of the GSUB and GPOS data is extracted from the font with fontTools. The data is placed into compositor objects. These objects are then used to process text. This initial loading can be relatively expensive, but the processing speed of the objects is worth the initial expense.\n\n\nInstallation\n------------\n\nTo install this package, type the following in the command line:\n\n```\npython setup.py install\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotools%2Fcompositor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotools%2Fcompositor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotools%2Fcompositor/lists"}