{"id":16118530,"url":"https://github.com/duskmoon314/typst-fontawesome","last_synced_at":"2026-02-12T18:33:03.689Z","repository":{"id":178209834,"uuid":"657630175","full_name":"duskmoon314/typst-fontawesome","owner":"duskmoon314","description":"A Typst library for Font Awesome icons through the desktop fonts.","archived":false,"fork":false,"pushed_at":"2025-07-28T03:10:15.000Z","size":353,"stargazers_count":45,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T09:01:25.229Z","etag":null,"topics":["font-awesome","typst"],"latest_commit_sha":null,"homepage":"https://typst.app/universe/package/fontawesome","language":"Typst","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/duskmoon314.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,"zenodo":null}},"created_at":"2023-06-23T13:32:25.000Z","updated_at":"2025-09-30T07:27:05.000Z","dependencies_parsed_at":"2024-01-16T07:21:15.443Z","dependency_job_id":"c2fb22fd-193d-4950-b48a-cdb60fd5e36f","html_url":"https://github.com/duskmoon314/typst-fontawesome","commit_stats":null,"previous_names":["duskmoon314/typst-fontawesome"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/duskmoon314/typst-fontawesome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftypst-fontawesome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftypst-fontawesome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftypst-fontawesome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftypst-fontawesome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duskmoon314","download_url":"https://codeload.github.com/duskmoon314/typst-fontawesome/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftypst-fontawesome/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29376916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T18:17:34.915Z","status":"ssl_error","status_checked_at":"2026-02-12T18:17:34.495Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["font-awesome","typst"],"created_at":"2024-10-09T20:49:49.910Z","updated_at":"2026-02-12T18:33:03.671Z","avatar_url":"https://github.com/duskmoon314.png","language":"Typst","funding_links":[],"categories":["Customization"],"sub_categories":["YAML"],"readme":"# typst-fontawesome\n\nA Typst library for Font Awesome icons through the desktop fonts.\n\n- The library is based on the Font Awesome 7 desktop fonts (v7.0.0)\n- The v6.7.2 is also included to provide some backward compatibility. See [v6 support](#using-font-awesome-v6)\n\n## Usage\n\n### Install the fonts\n\nYou can download the fonts from the official website: https://fontawesome.com/download\n\nAfter downloading the zip file, you can install the fonts depending on your OS.\n\n#### Typst web app\n\nYou can simply upload the `otf` files to the web app and use them with this package.\n\n#### Mac\n\nYou can double click the `otf` files to install them.\n\n#### Windows\n\nYou can right-click the `otf` files and select `Install`.\n\n#### Some notes\n\nThis library is tested with the otf files of the Font Awesome Free set. TrueType fonts may not work as expected. (Though I am not sure whether Font Awesome provides TrueType fonts, some issue is reported with TrueType fonts.)\n\n### Import the library\n\n#### Using the typst packages\n\nYou can install the library using the typst packages:\n\n`#import \"@preview/fontawesome:0.6.0\": *`\n\n#### Manually install\n\nCopy all files start with `lib` to your project and import the library:\n\n`#import \"lib.typ\": *`\n\nThere are four files:\n\n- `lib.typ`: The main entrypoint of the library.\n- `lib-impl.typ`: The implementation of `fa-icon`.\n- `lib-gen-map.typ`: The generated icon maps.\n- `lib-gen-func.typ`: The generated icon functions.\n\nI recommend renaming these files to avoid conflicts with other libraries.\n\n### Use the icons\n\nYou can use the `fa-icon` function to create an icon with its name:\n\n`#fa-icon(\"chess-queen\")`\n\nOr you can use the `fa-` prefix to create an icon with its name:\n\n`#fa-chess-queen()` (This is equivalent to `#fa-icon().with(\"chess-queen\")`)\n\nYou can also set `solid` to `true` to use the solid version of the icon:\n\n`#fa-icon(\"chess-queen\", solid: true)`\n\nSome icons only have the solid version in the Free set, so you need to set `solid` to `true` to use them if you are using the Free set.\nOtherwise, you may not get the expected glyph.\n\n#### Full list of icons\n\nYou can find all icons on the [official website](https://fontawesome.com/search)\n\n#### Different sets\n\nBy default, the library supports `Free`, `Brands`, `Pro`, `Duotone` and `Sharp` sets.\n(See [Enable Pro sets](#enable-pro-sets) for enabling Pro sets.)\n\nBut only `Free` and `Brands` are tested by me.\nThat is, three font files are used to test:\n\n- Font Awesome 7 Free (Also named as _Font Awesome 7 Free Regular_)\n- Font Awesome 7 Free Solid\n- Font Awesome 7 Brands\n\nDue to some limitations of typst (0.13.1), the regular and solid versions are treated as different fonts.\nIn this library, `solid` is used to switch between the regular and solid versions.\n\nTo use other sets or specify one set, you can pass the `font` parameter to the inner `text` function: \\\n`fa-icon(\"github\", font: \"Font Awesome 7 Pro Solid\")`\n\nIf you have Font Awesome Pro, please help me test the library with the Pro set.\nAny feedback is appreciated.\n\n##### Enable Pro sets\n\nTypst 0.13.1 raise a warning when the font is not found.\nTo use the Pro set, `#fa-use-pro()` should be called before any `fa-*` functions.\n\n```typst\n#fa-use-pro()                 // Enable Pro sets\n\n#fa-icon(\"chess-queen-piece\") // Use icons from Pro sets\n```\n\n##### Using Font Awesome v6\n\nFont Awesome v7 remaps some icons' unicode. For example:\n\n|   Icon Name   |  v6   |  v7   |\n| :-----------: | :---: | :---: |\n|   user-alt    | f406  | f007  |\n| vector-square | f5cb  | f5ef  |\n\nWe split all icons into multiple maps:\n\n- `fa-icon-map-common`: Icons with same unicode or only in one version\n- `fa-icon-map-6`: Icons with different unicode, their v6 mapping\n- `fa-icon-map-7`: Icons with different unicode, their v7 mapping\n\nBy default, `fa-icon-map-common` and `fa-icon-map-7` is used, that means `fa-icon(\"user-alt\")` will get v7 unicode and render.\n\nTo change the version, `fa-version(\"6\")` can be used. It changes the icon map and font list for `fa-icon`.\n\nWe also provide some functions to use the v6 icons directly:\n\n```typst\n#fa-user-alt-6() // Get the v6 unicode and render the icon\n#fa-user-alt-7() // Get the v7 unicode and render the icon\n#fa-user-alt()   // The same as #fa-user-alt-7()\n```\n\n#### Customization\n\nThe `fa-icon` function passes args to `text`, so you can customize the icon by passing parameters to it:\n\n`#fa-icon(\"chess-queen\", fill: blue)`\n\n`#fa-chess-queen(size: 15pt)`\n\n#### Stacking icons\n\nThe `fa-stack` function can be used to create stacked icons:\n\n`#fa-stack(fa-icon-args: (solid: true), \"square\", (\"chess-queen\", (fill: white, size: 5.5pt)))`\n\nDeclaration is `fa-stack(box-args: (:), grid-args: (:), fa-icon-args: (:), ..icons)`\n\n- The order of the icons is from the bottom to the top.\n- `fa-icon-args` is used to set the default args for all icons.\n- You can also control the internal `box` and `grid` by passing the `box-args` and `grid-args` to the `fa-stack` function.\n- Currently, four types of icons are supported. The first three types leverage the `fa-icon` function, and the last type is just a content you want to put in the stack.\n  - `str`, e.g., `\"square\"`\n  - `array`, e.g., `(\"chess-queen\", (fill: white, size: 5.5pt))`\n  - `arguments`, e.g. `arguments(\"chess-queen\", solid: true, fill: white)`\n  - `content`, e.g. `fa-chess-queen(solid: true, fill: white)`\n\n#### Known Issues\n\n- [typst#2578](https://github.com/typst/typst/issues/2578) [typst-fontawesome#2](https://github.com/duskmoon314/typst-fontawesome/issues/2)\n\n  This is a known issue that the ligatures may not work in headings, list items, grid items, and other elements. You can use the Unicode from the [official website](https://fontawesome.com) to avoid this issue when using Pro sets.\n\n  For most icons, Unicode is used implicitly. So I assume we usually don't need to worry about this.\n\n  Any help on this issue is appreciated.\n\n## Example\n\nSee the [`example.typ`](https://typst.app/project/rQwGUWt5p33vrsb_uNPR9F) file for a complete example.\n\n## Contribution\n\nFeel free to open an issue or a pull request if you find any problems or have any suggestions.\n\n### Python helper\n\nThe `helper.py` script is used to get metadata via the GraphQL API and generate typst code. I aim only to use standard python libraries, so running it on any platform with python installed should be easy.\n\n### Repo structure\n\n- `helper.py`: The helper script to get metadata and generate typst code.\n- `lib.typ`: The main entrypoint of the library.\n- `lib-impl.typ`: The implementation of `fa-icon`.\n- `lib-gen.typ`: The generated functions of icons.\n- `example.typ`: An example file to show how to use the library.\n- `gallery.typ`: The generated gallery of icons. It is used in the example file.\n\n## License\n\nThis library is licensed under the MIT license. Feel free to use it in your project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduskmoon314%2Ftypst-fontawesome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduskmoon314%2Ftypst-fontawesome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduskmoon314%2Ftypst-fontawesome/lists"}