{"id":20264342,"url":"https://github.com/thi-ng/font","last_synced_at":"2025-04-11T02:10:39.984Z","repository":{"id":49673037,"uuid":"237689513","full_name":"thi-ng/font","owner":"thi-ng","description":"Generated, modular typeface based on thi.ng wordmark","archived":false,"fork":false,"pushed_at":"2025-04-09T12:01:32.000Z","size":945,"stargazers_count":21,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T13:21:34.504Z","etag":null,"topics":["fontforge","generative","modular","opentype","shape-grammar","typescript","typography"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/thi-ng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2020-02-01T22:55:56.000Z","updated_at":"2025-04-09T12:01:35.000Z","dependencies_parsed_at":"2024-07-16T21:24:47.277Z","dependency_job_id":"872eef3d-ad94-46a3-a444-cca2969b62c7","html_url":"https://github.com/thi-ng/font","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Ffont","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Ffont/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Ffont/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Ffont/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thi-ng","download_url":"https://codeload.github.com/thi-ng/font/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328160,"owners_count":21085261,"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":["fontforge","generative","modular","opentype","shape-grammar","typescript","typography"],"created_at":"2024-11-14T11:39:42.819Z","updated_at":"2025-04-11T02:10:39.972Z","avatar_url":"https://github.com/thi-ng.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![thi.ng/font](./assets/thing-font.svg)\n\n\u003c!-- TOC depthFrom:2 --\u003e\n\n- [About](#about)\n- [Status](#status)\n- [Download](#download)\n- [Contributing](#contributing)\n- [Building](#building)\n- [Glyph definition / configuration](#glyph-definition--configuration)\n    - [Shape grammar](#shape-grammar)\n    - [Glyph spec format](#glyph-spec-format)\n- [FontForge post-processing](#fontforge-post-processing)\n- [Licenses](#licenses)\n\n\u003c!-- /TOC --\u003e\n\n## About\n\nGenerated, modular font based on [thi.ng\nwordmark](https://github.com/thi-ng/branding/). Currently only includes\nlowercase ASCII characters (also mapped to uppercase), digits, some\npunctuation, but will be extended further...\n\n![screenshot](https://raw.githubusercontent.com/thi-ng/font/master/assets/0.0.7.png)\n\n## Status\n\nWIP / Alpha\n\nSee [project board](https://github.com/thi-ng/font/projects/1) for\nfuture ideas.\n\n## Download\n\n[Download font as OTF](./font/thing-regular-0.0.7.otf) (v0.0.7)\n\nBig shouts to the [opentype.js](https://opentype.js.org/) \u0026\n[FontForge](https://fontforge.org/) teams for simplifying OTF file\ngeneration!\n\n## Contributing\n\nYou're welcome to contribute customized and/or extended versions by\nadding new font spec JSON files (see section below). These different\nversions will be built and distributed as part of the same font family.\nThe shared use of the underlying (changeable) grid layout and shape\ngrammar would be the common lowest denominator of these variations.\n\n## Building\n\n```bash\ngit clone https://github.com/thi-ng/font.git\ncd font\nyarn install\n\n# generate all font variations\nyarn build:all\n\n# generate specific font variation(s) (globs supported)\nyarn build specs/*.json\n\n# generate SVG banners\nyarn build:banners\n\n# generate debug grid\nyarn debug\n```\n\n(All generated assets will be written to `/build`...)\n\n## Glyph definition / configuration\n\n![layout grid](https://raw.githubusercontent.com/thi-ng/font/master/assets/grid.png)\n\nAll glyphs are defined via a grid of N columns x M rows, a set of\nglobal parametric relationships defining dot radius, slant angle and\ngrid cell sizes, plus custom grammar strings for each individual glyph.\n\nAll of these are defined in JSON files like this:\n[base.json](https://github.com/thi-ng/font/blob/master/specs/base.json),\nwhich can/should be used as template for defining new variations.\n\nThe overall character aspect ratio, spacing and line width are\nadjustable via these global params (See\n[api.ts](https://github.com/thi-ng/font/blob/master/src/api.ts) for\nfurther details.):\n\n- `r`: Dot radius, the fundamental param on which everything else is\n  based on (`50`).\n- `gap`: Horizontal and vertical gaps to define grid cell size (`[30,\n  15]`).\n- `extent`: Descender/ascender limits in number of rows (`[-4, 11]`)\n- `slant`: Slant direction vector as columns \u0026 rows (`[1, 7]`)\n\nThe default slant angle (~16.5 deg) ensures that in the glyph sequence\n`i.` the two dots are horizontally aligned (as in the `thi.ng` wordmark\nand illustrated in the above diagram).\n\nThe default ascender/descender and grid configuration uses 15 rows with\nthese key row IDs:\n\n- row 0 (0x00) = max descender\n- row 4 (0x04) = baseline\n- row 10 (0x0a) = x-height\n- row 14 (0x0e) = max ascender\n\n### Shape grammar\n\nAll glyphs are based on these 4 basic shape types:\n\n- vertical lines\n- horizontal lines\n- diagonals\n- dots\n\n```text\nDIGIT = '0'..'9' | 'a'..'e' # All coords are 4-bit hex nibbles\nVLINE = DIGIT DIGIT\nHLINE = 'h' DIGIT DIGIT\nHLINE_SHIFT = 'H' DIGIT DIGIT\nDIAG = '/' DIGIT DIGIT\nDOT = '.' DIGIT\nADVANCE = '\u003e'\n\nSHAPE = (VLINE | HLINE | HLINE_SHIFT | DIAG | DOT | ADVANCE)*\n```\n\nExamples:\n\n- `0e` =\u003e vertical line from row 0x00 -\u003e row 0x0e\n- `hb3` =\u003e h bridge @ row 0x0b width = 3 (aka multiple of global `R`\n  param)\n- `Hb3` =\u003e same as `h`, but shifted right by `R`\n- `/4a` =\u003e diagonal from row 4 in curr column to row 0xa in next column\n- `.7` =\u003e dot @ row 0x07\n- `\u003e` =\u003e advance X (next column)\n\nFor example, the lowercase `a` glyph is encoded by this string:\n`58h44h94\u003e59` and translates to:\n\n- vertical line from row 5 -\u003e 8\n- horizontal bridge in row 4, w=4\n- horizontal bridge in row 9, w=4\n- advance to next column\n- vertical line from 5 -\u003e 9\n\nNote: The sub-shapes should be arranged/split in such a way as to\navoid/minimize overdraws...\n\n### Glyph spec format\n\nThe following snippet shows the spec for a single glyph (see\n[base.json](https://github.com/thi-ng/font/blob/master/specs/base.json)):\n\n```json\n{\n    \"name\": \"a\",\n    \"id\": 97,\n    \"g\": \"58h44h94\u003e59\",\n    \"x\": [0, 0],\n    \"width\": [2, 0]\n}\n```\n\n- Only the `name` **or** `id` attrib is required. The `id` field is only\n  needed if `name` is missing or longer than a single char. Likewise, if\n  `name` is missing, it will be derived from the given `id` (Unicode)\n  value.\n- The `x` offset is only needed if the glyph is not horizontally aligned\n  to 0. It's a two element array of `[a, b]` and will be translated to:\n  `a * columnWidth + b * r`.\n- The `width` is only needed for manual overriding of the computed\n  width. If given, the same logic as for `x` is used to compute the\n  final value.\n\n## FontForge post-processing\n\nSince [opentype.js](https://opentype.js.org/) doesn't support the\ncreation of GPOS/kern tables, those hints will need to be added to the\ngenerated font file(s) in a post-processing step, here using\n[FontForge](https://fontforge.org/).\n\nFurthermore, due to the modular design approach, most generated glyphs\nwill consist of multiple sub-paths, incl. possible overlaps. The\n[postprocess.py](https://github.com/thi-ng/font/blob/master/src/postprocess.py)\nscript will take care of that too.\n\n```bash\n# install fontforge (if needed)\nbrew cask install fontforge\n\n# build fonts for all available specs\nyarn build:all\n\n# pass a generated font and its JSON spec as input\nyarn postprocess -i build/thing-regular-0.0.6-1581258015.otf -k specs/base.json\n# processing font: build/thing-regular-0.0.6-1581258015.otf\n# cleaning glyphs...\n# add kern pair: ' t 80\n# add kern pair: \" t 80\n# add kern pair: / t 80\n# add kern pair: # t 80\n# add kern pair: ] t 80\n# add kern pair: d t 80\n# add kern pair: f t 80\n# add kern pair: l t 80\n# add kern pair: g j 50\n# add kern pair: j j 50\n# add kern pair: q j 50\n# add kern pair: y j 50\n# writing build/thing-regular-0.0.6-1581258015-kerned.otf\n```\n\nNote: the `yarn postprocess` script currently assumes OSX and that\nFontForge is installed in `/Applications/FontForge.app`. You might need\nto edit `package.json` to adapt for other environments...\n\n## Licenses\n\n- Source: Apache Software License 2.0\n- Font: SIL Open Font License 1.1\n\n\u0026copy; 2020 Karsten Schmidt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthi-ng%2Ffont","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthi-ng%2Ffont","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthi-ng%2Ffont/lists"}