{"id":15092291,"url":"https://github.com/denosaurs/font","last_synced_at":"2026-02-28T05:33:01.862Z","repository":{"id":62421852,"uuid":"327481854","full_name":"denosaurs/font","owner":"denosaurs","description":"🖌 A simple deno module for font rasterization","archived":false,"fork":false,"pushed_at":"2021-02-07T18:07:39.000Z","size":371,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-15T04:24:59.231Z","etag":null,"topics":["deno","font","opentype","truetype"],"latest_commit_sha":null,"homepage":"https://deno.land/x/font","language":"TypeScript","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/denosaurs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"open_collective":"denosaurs","github":"denosaurs"}},"created_at":"2021-01-07T02:29:28.000Z","updated_at":"2023-08-23T15:30:18.000Z","dependencies_parsed_at":"2022-11-01T17:32:17.156Z","dependency_job_id":null,"html_url":"https://github.com/denosaurs/font","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/denosaurs/font","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Ffont","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Ffont/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Ffont/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Ffont/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denosaurs","download_url":"https://codeload.github.com/denosaurs/font/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Ffont/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260766603,"owners_count":23059492,"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":["deno","font","opentype","truetype"],"created_at":"2024-09-25T11:01:18.445Z","updated_at":"2025-09-24T17:40:08.870Z","avatar_url":"https://github.com/denosaurs.png","language":"TypeScript","funding_links":["https://opencollective.com/denosaurs","https://github.com/sponsors/denosaurs"],"categories":[],"sub_categories":[],"readme":"# Font\n\n[![Tags](https://img.shields.io/github/release/denosaurs/font)](https://github.com/denosaurs/font/releases)\n[![CI Status](https://img.shields.io/github/workflow/status/denosaurs/font/check)](https://github.com/denosaurs/font/actions)\n[![Dependencies](https://img.shields.io/github/workflow/status/denosaurs/font/depsbot?label=dependencies)](https://github.com/denosaurs/depsbot)\n[![License](https://img.shields.io/github/license/denosaurs/font)](https://github.com/denosaurs/font/blob/master/LICENSE)\n\nThis is a simple deno module providing wasm bindings to the\n[fontdue](https://github.com/mooman219/fontdue) for font rasterization and\nlayout with support for TrueType (`.ttf/.ttc`) and OpenType (`.otf`).\n\n## Example\n\n### Rasterization\n\n```typescript\nimport { Font } from \"https://deno.land/x/font/mod.ts\";\n\n// Read the font data.\nconst data = await Deno.readFile(\"../Roboto-Regular.ttf\");\n// Parse it into the font type.\nconst font = new Font(font);\n// Rasterize and get the layout metrics for the letter 'g' at 17px.\nlet { metrics, bitmap } = font.rasterize(\"g\", 17.0);\n```\n\n## Prerequisites\n\n| prerequisite                                            | installation                                             |\n| ------------------------------------------------------- | -------------------------------------------------------- |\n| [deno](https://deno.land/)                              | [deno_install](https://github.com/denoland/deno_install) |\n| [rust](https://www.rust-lang.org/)                      | [rustup](https://www.rust-lang.org/tools/install)        |\n| [rustfmt](https://github.com/rust-lang/rustfmt)         | `rustup component add rustfmt`                           |\n| [rust-clippy](https://github.com/rust-lang/rust-clippy) | `rustup component add clippy`                            |\n| [wasm-pack](https://rustwasm.github.io/wasm-pack/)      | `cargo install wasm-pack`                                |\n\n## Development\n\n### build\n\n```bash\n$ deno run --unstable --allow-read --allow-write --allow-run scripts/build.ts\nbuilding rust                  (\"wasm-pack build --target web --release\")\nread wasm                      (size: 150856 bytes)\ncompressed wasm using lz4      (reduction: 58651 bytes, size: 92205 bytes)\nencoded wasm using base64      (increase: 30735 bytes, size: 122940 bytes)\nread js                        (size: 5895 bytes)\ninlined js and wasm            (size: 129016 bytes)\nminified js                    (size reduction: 3100 bytes, size: 125916 bytes)\nwriting output to file         (wasm.js)\nfinal size is: 125916 bytes\n```\n\n### clean\n\n```bash\n$ deno run --unstable --allow-read --allow-write --allow-run scripts/clean.ts\ncleaning cargo build           (\"cargo clean\")\nremoving pkg\n```\n\n### fmt\n\n```bash\n$ deno run --unstable --allow-run scripts/fmt.ts\nformatting typescript          (\"deno --unstable fmt scripts/ test_deps.ts test.ts mod.ts\")\nChecked 9 files\nformatting rust                (\"cargo fmt\")\n```\n\n### lint\n\n```bash\n$ deno run --unstable --allow-run scripts/lint.ts\nlinting typescript             (\"deno --unstable lint scripts test_deps.ts test.ts mod.ts\")\nChecked 9 files\nlinting rust                   (\"cargo clippy -q\")\n```\n\n## Testing\n\nRequires the `wasm.js` file to be [built](#build) first.\n\n```bash\n$ deno test\nrunning 1 tests\ntest add ... ok (2ms)\n\ntest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (2ms)\n```\n\n## Other\n\n### Contribution\n\nPull request, issues and feedback are very welcome. Code style is formatted with\n`deno fmt` and commit messages are done following\n[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec.\n\n### Licence\n\nCopyright 2021, Denosaurs. All rights reserved. MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenosaurs%2Ffont","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenosaurs%2Ffont","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenosaurs%2Ffont/lists"}