{"id":33918863,"url":"https://github.com/bearcove/woofwoof","last_synced_at":"2026-01-13T13:58:54.613Z","repository":{"id":327046883,"uuid":"1107586381","full_name":"bearcove/woofwoof","owner":"bearcove","description":"WOFF2 compression for Rust (some C++ inside)","archived":false,"fork":false,"pushed_at":"2026-01-02T16:27:35.000Z","size":896,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T11:42:09.154Z","etag":null,"topics":["compression","fonts","rust","ttf","woff2"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/bearcove.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"fasterthanlime","patreon":"fasterthanlime"}},"created_at":"2025-12-01T10:45:25.000Z","updated_at":"2026-01-09T15:51:23.000Z","dependencies_parsed_at":"2026-01-03T04:07:58.888Z","dependency_job_id":null,"html_url":"https://github.com/bearcove/woofwoof","commit_stats":null,"previous_names":["fasterthanlime/woofwoof"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bearcove/woofwoof","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fwoofwoof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fwoofwoof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fwoofwoof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fwoofwoof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bearcove","download_url":"https://codeload.github.com/bearcove/woofwoof/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Fwoofwoof/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28387596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T13:42:20.960Z","status":"ssl_error","status_checked_at":"2026-01-13T13:42:03.276Z","response_time":56,"last_error":"SSL_read: 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":["compression","fonts","rust","ttf","woff2"],"created_at":"2025-12-12T08:35:52.191Z","updated_at":"2026-01-13T13:58:54.591Z","avatar_url":"https://github.com/bearcove.png","language":"Rust","funding_links":["https://github.com/sponsors/fasterthanlime","https://patreon.com/fasterthanlime"],"categories":[],"sub_categories":[],"readme":"# woofwoof\n\n[![crates.io](https://img.shields.io/crates/v/woofwoof.svg)](https://crates.io/crates/woofwoof)\n[![documentation](https://docs.rs/woofwoof/badge.svg)](https://docs.rs/woofwoof)\n[![MIT/Apache-2.0 licensed](https://img.shields.io/crates/l/woofwoof.svg)](./LICENSE-MIT)\n![woof woof](https://img.shields.io/badge/woof-woof-blue)\n\nWOFF2 font compression and decompression for Rust.\n\nInspired by the [woff](https://github.com/bodoni/woff) crate, but with key differences:\n\n- **Pure Rust brotli**: Uses the [brotli](https://crates.io/crates/brotli) crate instead of linking to C brotli\n- **Windows support**: Compiles on Windows, Linux, and macOS\n- **WOFF2 only**: No WOFF1 support — [WOFF2 adoption](https://caniuse.com/?search=woff2) is now widespread enough that serving WOFF1 is unnecessary\n\nThis crate wraps Google's [woff2](https://github.com/google/woff2) C++ library for the font-specific table transformations that make WOFF2 compress so well, while using pure Rust for brotli compression.\n\n## Usage\n\n```rust\nuse woofwoof::{compress, decompress};\n\n// Compress TTF/OTF to WOFF2\nlet ttf_data = std::fs::read(\"font.ttf\")?;\nlet woff2_data = compress(\u0026ttf_data, \"\", 8, true)\n    .expect(\"compression failed\");\n\n// Decompress WOFF2 back to TTF/OTF\nlet roundtripped = decompress(\u0026woff2_data)\n    .expect(\"decompression failed\");\n```\n\n## API\n\n### `compress(data, metadata, quality, transform) -\u003e Option\u003cVec\u003cu8\u003e\u003e`\n\nCompress a TTF/OTF font to WOFF2 format.\n\n- `data`: The TTF or OTF font data\n- `metadata`: Optional extended metadata (XML string, usually empty `\"\"`)\n- `quality`: Brotli compression quality (0-11, recommended: 8-11)\n- `transform`: Whether to apply font-specific transforms (recommended: `true`)\n\n### `decompress(data) -\u003e Option\u003cVec\u003cu8\u003e\u003e`\n\nDecompress a WOFF2 font back to TTF/OTF format.\n\n## Why \"woofwoof\"? 🐕\n\nBecause it does WOFF2. Get it? WOFF... woof... woofwoof?\n\n## Architecture\n\n```\nRust API (compress/decompress)\n         │\n         ▼\n    C wrapper (extern \"C\")\n         │\n         ▼\n    Google woff2 C++ (font transforms)\n         │\n         ▼\n    Rust brotli shim (#[no_mangle])\n         │\n         ▼\n    brotli crate (pure Rust)\n```\n\nThe C++ woff2 library handles the complex font table transformations that make WOFF2 compress so well. Instead of linking to C brotli, we provide stub headers and implement the brotli functions in Rust, forwarding to the pure Rust brotli crate.\n\n## Testing\n\nThe test suite compresses a real font (Roboto) to WOFF2, verifies the WOFF2 signature, then decompresses it back. Note that roundtripped fonts are not byte-identical to the original due to WOFF2's font table transformations, but they are semantically equivalent.\n\n```bash\ncargo test\n```\n\nFor manual verification, the compressed and decompressed fonts can be inspected with tools like [FontGoggles](https://fontgoggles.org/).\n\n## Credits\n\nThis crate was inspired by [bodoni/woff](https://github.com/bodoni/woff), which pioneered the approach of wrapping Google's woff2 C++ library for Rust.\n\n## Sponsors\n\nThanks to all individual sponsors:\n\n\u003cp\u003e \u003ca href=\"https://github.com/sponsors/fasterthanlime\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/github-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/github-light.svg\" height=\"40\" alt=\"GitHub Sponsors\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003ca href=\"https://patreon.com/fasterthanlime\"\u003e\n    \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/patreon-dark.svg\"\u003e\n    \u003cimg src=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/patreon-light.svg\" height=\"40\" alt=\"Patreon\"\u003e\n    \u003c/picture\u003e\n\u003c/a\u003e \u003c/p\u003e\n\n...along with corporate sponsors:\n\n\u003cp\u003e \u003ca href=\"https://zed.dev\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/zed-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/zed-light.svg\" height=\"40\" alt=\"Zed\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003ca href=\"https://depot.dev?utm_source=woofwoof\"\u003e\n\u003cpicture\u003e\n\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/depot-dark.svg\"\u003e\n\u003cimg src=\"https://github.com/fasterthanlime/woofwoof/raw/main/static/sponsors/depot-light.svg\" height=\"40\" alt=\"Depot\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e \u003c/p\u003e\n\n...without whom this work could not exist.\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\nThe bundled [woff2](https://github.com/google/woff2) C++ library is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearcove%2Fwoofwoof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearcove%2Fwoofwoof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearcove%2Fwoofwoof/lists"}