{"id":29069406,"url":"https://github.com/tayoky/libttf","last_synced_at":"2026-05-12T23:38:37.667Z","repository":{"id":301113751,"uuid":"1008004422","full_name":"tayoky/libttf","owner":"tayoky","description":"a simple library to render ttf font","archived":false,"fork":false,"pushed_at":"2025-06-25T07:28:10.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T08:28:10.024Z","etag":null,"topics":["font","library","ttf","ttf-fonts"],"latest_commit_sha":null,"homepage":"","language":"C","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/tayoky.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-24T21:55:27.000Z","updated_at":"2025-06-25T08:04:37.000Z","dependencies_parsed_at":"2025-06-25T08:38:47.743Z","dependency_job_id":null,"html_url":"https://github.com/tayoky/libttf","commit_stats":null,"previous_names":["tayoky/libttf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tayoky/libttf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayoky%2Flibttf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayoky%2Flibttf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayoky%2Flibttf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayoky%2Flibttf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tayoky","download_url":"https://codeload.github.com/tayoky/libttf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayoky%2Flibttf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262253663,"owners_count":23282546,"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":["font","library","ttf","ttf-fonts"],"created_at":"2025-06-27T12:01:20.549Z","updated_at":"2025-10-29T06:32:47.929Z","avatar_url":"https://github.com/tayoky.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libttf\nthe objective of libttf is to be a simple and portable library to render `.ttf` font  \norignaly written for [the stanix operating system](https://github.com/tayoky/stanix) libttf is hopping to one day become a viable concurrent to libfreetype\n\n# build and install\nstart by launching the configure script\n```sh\n./configure\n```\n\u003e [!NOTE]\n\u003e you can use the options `--prefix` and `--host`\n\nthen run make\n```sh\nmake\n```\n\nand finally install\n```sh\nmake install\n```\n\u003e [!NOTE]\n\u003e this might require root permission if installing globally\n\n# api\nyou can get started with\n```c\n#include \u003cstdio.h\u003e\n#include \u003cttf.h\u003e\n\nint main(){\n    //open a ttf file\n    ttf_file *font = ttf_open(\"DejaVuSans.ttf\");\n    if(!font){\n        printf(\"libttf : %s\\n\",ttf_error());\n        return 1;\n    }\n\n    //get a glyph\n    ttf_glyph *glyph = ttf_getglyph(font,'A');\n\n    //generate a bitmap\n    ttf_bitmap *bitmap = ttf_render_glyph(glyph);\n\n    ttf_free_glyph(glyph);\n\n    ttf_close(font);\n    return 0;\n}\n```\n\nand then compile with\n```sh\ngcc test.c -lttf\n```\n\n## functions\n- `ttf_file *ttf_open(const char *path)`\n- `void ttf_close(ttf_file *font)`\n- `const char *ttf_error()`\n- `uint32_t ttf_char2glyf(ttf_file *font,wchar_t c)`\n- `ttf_glyph *ttf_getglyph(ttf_file *font,wchar_t c)`\n- `void ttf_free_glyph(ttf_glyph *glyph)`\n- `void ttf_set_font_size(ttf_font *font,int size)`\n- `void ttf_set_curves_seg(ttf_font *font,int count)`\n- `ttf_bitmap *ttf_render_glyph(ttf_glyph *glyph)`\n\n## bitmap\nbitmap generated by libttf are black and white bitmap composed of an array of `uint8_t` a value of `0` correspond to background color and a value of `255` correspond to foreground color value in between are a mix used for anti aliasing\n\n## support\ncurrently libttf support only font of type truetype outline\n\u003e [!NOTE]  \n\u003e combine char are currently very broken\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftayoky%2Flibttf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftayoky%2Flibttf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftayoky%2Flibttf/lists"}