{"id":13741305,"url":"https://github.com/ziglibs/fontaine","last_synced_at":"2025-04-30T23:30:57.849Z","repository":{"id":104373689,"uuid":"559997539","full_name":"ziglibs/fontaine","owner":"ziglibs","description":"A library to support text rendering in arbitrary contexts","archived":false,"fork":false,"pushed_at":"2022-10-31T14:40:21.000Z","size":1,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-04T04:07:37.909Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziglibs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"MasterQ32"}},"created_at":"2022-10-31T14:31:18.000Z","updated_at":"2024-06-28T14:22:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f589c70-2c63-4ddf-bee4-35d1737d8b08","html_url":"https://github.com/ziglibs/fontaine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Ffontaine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Ffontaine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Ffontaine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Ffontaine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziglibs","download_url":"https://codeload.github.com/ziglibs/fontaine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224225071,"owners_count":17276436,"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-08-03T04:00:57.669Z","updated_at":"2024-11-12T06:15:40.905Z","avatar_url":"https://github.com/ziglibs.png","language":"Zig","funding_links":["https://github.com/sponsors/MasterQ32"],"categories":["Libraries"],"sub_categories":[],"readme":"# Fontaine\n\n\u003e **WARNING: THIS LIBRARY IS NOT FUNCTIONAL YET!**\n\nThis library is meant to provide a solid base for font rendering. It's goals are:\n\n- Provide text layouting\n  - Create a sequence of positioned glyphs for a given input string\n  - High level text rendering, will handle word wrap, alignment, maximum width, ...\n- Provide string layouting\n  - Create a sequence of positioned glyphs for a given input string\n  - Bare bones function, will not handle lines or word wrap\n- Provide glyph information\n  - Beziers\n  - Alpha texture rendering\n\n## Example\n\n```zig\nconst fontaine = @import(\"fontaine\");\n\n// the font size is \"12 units\", renderer has to translate this later on\nvar font = try fontaine.Font.load(\"berkeley-mono.ttf\", 12.0);\ndefer font.deinit();\n\nconst text =\n  \\\\My name is Marquise and i'm from France!\n  \\\\എന്റെ പേര് മാർക്വിസ്, ഞാൻ ഫ്രാൻസിൽ നിന്നാണ്!\n  \\\\私の名前はマルキーズで、フランス出身です！\n  \\\\我的名字是侯爵夫人，我来自法国！\n\nvar iter = fontaine.layoutText(font, text, .{\n  .alignment = .justify,\n  .max_width = 200, // units\n  .max_height = 400, // units\n});\n\nwhile(iter.next()) |glyph_desc| {\n  const bitmap = try glyph_cache.getScaled(glyph_desc.glyph_index, font.size);\n \n  renderer.drawBitmap(glyph_desc.x, glyph_desc.y, bitmap);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziglibs%2Ffontaine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziglibs%2Ffontaine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziglibs%2Ffontaine/lists"}