{"action":"opened","issue":{"url":"https://api.github.com/repos/vurtun/nuklear/issues/680","repository_url":"https://api.github.com/repos/vurtun/nuklear","labels_url":"https://api.github.com/repos/vurtun/nuklear/issues/680/labels{/name}","comments_url":"https://api.github.com/repos/vurtun/nuklear/issues/680/comments","events_url":"https://api.github.com/repos/vurtun/nuklear/issues/680/events","html_url":"https://github.com/vurtun/nuklear/issues/680","id":318820898,"number":680,"title":"pre-baking font for embedded evice","user":{"login":"diggit","id":512025,"avatar_url":"https://avatars2.githubusercontent.com/u/512025?v=4","gravatar_id":"","url":"https://api.github.com/users/diggit","html_url":"https://github.com/diggit","followers_url":"https://api.github.com/users/diggit/followers","following_url":"https://api.github.com/users/diggit/following{/other_user}","gists_url":"https://api.github.com/users/diggit/gists{/gist_id}","starred_url":"https://api.github.com/users/diggit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diggit/subscriptions","organizations_url":"https://api.github.com/users/diggit/orgs","repos_url":"https://api.github.com/users/diggit/repos","events_url":"https://api.github.com/users/diggit/events{/privacy}","received_events_url":"https://api.github.com/users/diggit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-30T08:45:05Z","updated_at":"2018-04-30T08:45:05Z","closed_at":null,"author_association":"NONE","body":"Hi @vurtun, I want to use your library in embedded device. I'd like to use nuklear's font baking, but resources are limited and you mentioned separate font baking in #87.\r\n\r\n> ... (You could also bake the font separately)\r\n\r\nSo here is small program to generate bitmap  (not sure about terminology) on which `img` points. Can I somehow obtain individual characters positions and their dimensions in this bitmap?\r\n\r\nOr is this a wrong approach and there is better way?\r\n\r\n```\r\n#define NK_INCLUDE_FIXED_TYPES\r\n#define NK_INCLUDE_STANDARD_IO\r\n#define NK_INCLUDE_DEFAULT_ALLOCATOR\r\n#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT\r\n#define NK_INCLUDE_FONT_BAKING\r\n#define NK_INCLUDE_DEFAULT_FONT\r\n#define NK_IMPLEMENTATION\r\n\r\n#include \"../nuklear/nuklear.h\"\r\n\r\n\r\nint main(void)\r\n{\r\n\tint img_width;\r\n\tint img_height;\r\n\tstruct nk_font_atlas atlas;\r\n\tnk_font_atlas_init_default(&atlas);\r\n\tnk_font_atlas_begin(&atlas);\r\n\tstruct nk_font *font = nk_font_atlas_add_from_file(&atlas, \"../nuklear/extra_font/Roboto-Regular.ttf\", 20, 0);\r\n\tconst void* img = nk_font_atlas_bake(&atlas, &img_width, &img_height, NK_FONT_ATLAS_ALPHA8);\r\n\tnk_font_atlas_end(&atlas, nk_handle_id(0), 0);\r\n\r\n\t//save img contents somewhere else\r\n\r\n\tnk_font_atlas_clear(&atlas);\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"diggit"}}