{"id":17038603,"url":"https://github.com/darky-lucera/fontrenderer","last_synced_at":"2026-05-05T03:34:11.229Z","repository":{"id":86247957,"uuid":"437396562","full_name":"Darky-Lucera/FontRenderer","owner":"Darky-Lucera","description":"Simple tool for rendering text from a font into a buffer.","archived":false,"fork":false,"pushed_at":"2022-01-13T21:18:44.000Z","size":327,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T23:28:48.979Z","etag":null,"topics":["fonts","framebuffer","render"],"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/Darky-Lucera.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}},"created_at":"2021-12-11T21:54:29.000Z","updated_at":"2022-01-08T17:45:02.000Z","dependencies_parsed_at":"2023-03-31T16:36:36.226Z","dependency_job_id":null,"html_url":"https://github.com/Darky-Lucera/FontRenderer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Darky-Lucera/FontRenderer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darky-Lucera%2FFontRenderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darky-Lucera%2FFontRenderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darky-Lucera%2FFontRenderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darky-Lucera%2FFontRenderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Darky-Lucera","download_url":"https://codeload.github.com/Darky-Lucera/FontRenderer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darky-Lucera%2FFontRenderer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32634402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fonts","framebuffer","render"],"created_at":"2024-10-14T08:57:15.787Z","updated_at":"2026-05-05T03:34:11.196Z","avatar_url":"https://github.com/Darky-Lucera.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FontRenderer\n\nFontRenderer is a simple tool for rendering text from a ttf font into a buffer (with clipping).\n\nAs an example I have used the Mini Frame Buffer (MiniFB) library to create a window and render some text inside.\n\n# API\n\nThe APi is simple:\n```cpp\nconst char text = \"Hello World!\";\nuint32_t   fontSize = 32;\nuint32_t   color32 = 0xff0000;\n\n// Load a font\nMindShake::FontSTB font(\"resources/Roboto-Regular.ttf\");\n\n// Set the clipping (optional)\nfont.SetClipping(left, top, right, bottom);\n\n// Enable antialias\nfont.SetAntialias(true);\nfont.SetAntialiasWeights(20, 4, 1); // Gausian\nfont.SetAntialiasWeights(1, 1, 1);  // Mean\n\n// Allow antialias to extend one border pixel per glyph\nfont.SetAntialiasAllowEx(true);\n\n// In case you need the dimensions of the future rendered text. For instance to horizontal align text...\nRect rect;\nfont.GetTextBox(text, fontSize, \u0026rect);\n\n// Draw a colored text of height fontSize in your buffer at pos (posX, posY)\nfont.DrawText(text, fontSize, color32, bufferDest, bufferDestStride, posX, posY);\n```\n\n**Note:** As we are rendering only once per glyph per fontSize, user must configure Antialias params at beginning.\n\n# Font Renderer external dependencies\n\nFor getting the font glyphs the following libraries are used:\n * [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) (.ttf) :ok:\n * [libschrift](https://github.com/tomolt/libschrift) (.ttf, .otf) :ok:\n * [FreeType](https://freetype.org/) (not yet) ❌\n\n# How to use it\n\nYou have two options:\n- Use CMake and add_subdirectory() where you put fontRenderer as an external dependency.\n  Then link against fontRenderer lib as exampleRender does.\n\n- Select the library you want to use into your project (stb_truetype, libschrift,  ~~FreeType~~) and drop the following files in your project:\n\n  - Font.h\n  - Font.cpp\n  - SkylineBinPack.h\n  - SkylineBinPack.cpp\n  - UTF8_Utils.h\n  ---\n  **If you choose to use libschrift**\n  - FontSFT.h\n  - FontSFT.cpp\n  - schrift.h\n  - schrift.c\n  ---\n  **If you choose to use stb_truetype**\n  - FontSTB.h\n  - FontSTB.cpp\n  - stb_truetype.h\n\n# Captures\n\n|Normal|AntiAlias|\n|---|---|\n|![](screenshots/capture.png)|NO|\n|![](screenshots/captureAAin.png)|AA Gausian|\n|![](screenshots/captureAA.png)|AA Gausian (allow font extension)|\n|![](screenshots/captureAAm.png)|AA Mean (allow font extension)|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky-lucera%2Ffontrenderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarky-lucera%2Ffontrenderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky-lucera%2Ffontrenderer/lists"}