{"id":20828406,"url":"https://github.com/googlefonts/glyphslib","last_synced_at":"2025-04-13T04:59:56.787Z","repository":{"id":38862967,"uuid":"44563779","full_name":"googlefonts/glyphsLib","owner":"googlefonts","description":"A bridge from Glyphs source files (.glyphs) to UFOs","archived":false,"fork":false,"pushed_at":"2025-03-24T13:15:30.000Z","size":40168,"stargazers_count":186,"open_issues_count":192,"forks_count":52,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-04-13T04:59:37.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googlefonts.png","metadata":{"files":{"readme":"README.builder.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-19T21:00:22.000Z","updated_at":"2025-03-17T20:13:45.000Z","dependencies_parsed_at":"2023-10-05T16:30:28.116Z","dependency_job_id":"4da5b700-04c9-4e1f-90e3-c9667eabe263","html_url":"https://github.com/googlefonts/glyphsLib","commit_stats":{"total_commits":1899,"total_committers":42,"mean_commits":"45.214285714285715","dds":0.8746708794102159,"last_synced_commit":"cb8a4a914b0a33431f0a77f474bf57eec2f19bcc"},"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2FglyphsLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2FglyphsLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2FglyphsLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2FglyphsLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googlefonts","download_url":"https://codeload.github.com/googlefonts/glyphsLib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665756,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11-17T23:14:45.866Z","updated_at":"2025-04-13T04:59:51.759Z","avatar_url":"https://github.com/googlefonts.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glyphsLib.builder sketch\n\nHere is an of overview of how `glyphsLib.builder` converts a Glyphs `GSFont` object into a set of UFO and Designspace files.\n\n## To convert each master\n\n* Create base UFOs using the GSFont metadata and per-master metadata\n    * Also store names, user data, custom parameters, custom filters\n* Convert the main layer of each master; convert also bracket/brace layers. (See [To convert each layer](#To_convert_each_layer) below)\n* Propagate anchors. How we should do this is… disputed.\n    * [https://github.com/googlefonts/glyphsLib/issues/368#issuecomment-491939617](https://github.com/googlefonts/glyphsLib/issues/368#issuecomment-491939617)\n    * [https://github.com/googlefonts/fontmake/issues/682#issuecomment-658079871](https://github.com/googlefonts/fontmake/issues/682#issuecomment-658079871)\n    * We currently (but shouldn’t) find the component closest to the origin: [https://github.com/googlefonts/ufo2ft/pull/316#issuecomment-1178961730](https://github.com/googlefonts/ufo2ft/pull/316#issuecomment-1178961730)\n* Store font and master userData in “layerLib” (why?)\n* Convert color layer IDs into layer names if there is a mapping in com.github.googlei18n.ufo2ft.colorLayerMapping (how would there be one here at this point?)\n* Convert the features into a feature file\n* Apply any custom parameters to the lib, including:\n    * codePageRanges/openTypeOS2CodePageRanges/codePageRangesUnsupportedBits\n    * GASP table\n    * Color Palettes (converted and stored in a ufo2ft key)\n    * Name records\n    * Don't use Production Names\n    * disablesNiceNames/useNiceNames\n    * \"Use Typo Metrics\"/\"Has WWS Names\" /\"openTypeOS2SelectionUnsupportedBits\"\n    * glyphOrder\n    * Filters\n    * Replace Prefix / Replace Feature (modifies feature file)\n    * Reencode Glyphs\n* Fix up color layers:\n    * Create color palette layers of {glyphname}.color{i}, convert UFO glyphs for each\n    * Create COLRv1 layers, convert UFO glyphs for each and apply paint/stroke\n* Write out any skipExportGlyphs list gathered when converting glyphs\n* Convert feature groups and kerning groups\n* Convert kerning\n\n## To convert each layer\n\n* For each glyph, look at all its Glyphs layers and, for master layers only, create/select appropriate UFO layers. Then convert each glyph. (See [To convert each glyph](#To_convert_each_glyph) below)\n* For non-master layers, collect a list of Glyphs layers and glyphs associated with them.\n* Out of that list, discard those which have no master associated with them and no name; gather up bracket layers (which will be processed during designspace generation); discard other irrelevant layers; convert other glyphs to glyphs in appropriate UFO layers.\n\n## To convert each glyph\n\n* For color glyphs, create a mapping between layers and palette IDs; clone any layers with components shared between them; gather into a list of color layers.\n* Set unicodes\n* Add to skipExportGlyphs if not exported\n* Determine production name, category and subcategory; write production name into lib.\n* Use category to zero out width if it’s a mark glyph; otherwise, check if the width is determined from the “Link Metrics With Master”/Link Metrics With First Master custom parameters.\n* Convert hints.\n* Stash any user data (is this necessary?)\n* Resolve/decompose smart components (currently we just store this info - don’t do anything with it?)\n* Draw paths with a pen onto the UFO glyph\n* Convert any components to UFO\n* Convert any anchors to UFO\n* If the font is vertical, set the height and vertical origin in the UFO\n\n## To create the designspace file\n\n* Convert Glyphs axes to designspace axes (Looking carefully at the custom parameters “Axis Mappings”, “Axes” - for older Glyphs versions - “Axis Location”, and “Variable Font Origin”/”Variation Font Origin” (again for older Glyphs)\n* Convert Glyphs masters to designspace sources\n* Convert Glyphs instances to designspace instances\n* Copy userdata into the designspace lib, add feature writers unless there is a manual kern feature. (this may be a bug - [https://github.com/googlefonts/glyphsLib/issues/764](https://github.com/googlefonts/glyphsLib/issues/764) )\n* Extract bracket layers into free-standing UFO glyphs with Designspace substitution rules. Check the “Feature for Feature Variations” custom parameter to set the OT feature for the rule.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglefonts%2Fglyphslib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglefonts%2Fglyphslib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglefonts%2Fglyphslib/lists"}