{"action":"opened","issue":{"url":"https://api.github.com/repos/ocornut/imgui/issues/735","repository_url":"https://api.github.com/repos/ocornut/imgui","labels_url":"https://api.github.com/repos/ocornut/imgui/issues/735/labels{/name}","comments_url":"https://api.github.com/repos/ocornut/imgui/issues/735/comments","events_url":"https://api.github.com/repos/ocornut/imgui/issues/735/events","html_url":"https://github.com/ocornut/imgui/issues/735","id":165591003,"number":735,"title":"Icon can not be centered using IconFont","user":{"login":"zhouxs1023","id":905931,"avatar_url":"https://avatars.githubusercontent.com/u/905931?v=3","gravatar_id":"","url":"https://api.github.com/users/zhouxs1023","html_url":"https://github.com/zhouxs1023","followers_url":"https://api.github.com/users/zhouxs1023/followers","following_url":"https://api.github.com/users/zhouxs1023/following{/other_user}","gists_url":"https://api.github.com/users/zhouxs1023/gists{/gist_id}","starred_url":"https://api.github.com/users/zhouxs1023/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhouxs1023/subscriptions","organizations_url":"https://api.github.com/users/zhouxs1023/orgs","repos_url":"https://api.github.com/users/zhouxs1023/repos","events_url":"https://api.github.com/users/zhouxs1023/events{/privacy}","received_events_url":"https://api.github.com/users/zhouxs1023/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-14T15:34:37Z","updated_at":"2016-07-14T15:34:37Z","closed_at":null,"body":"I used Iconfont for Icon, but compile turn on that Icon can not be centered \r\nCode as below:\r\n\r\n#include \"IconsFontAwesome.h\"\r\n\r\nImGuiIO& io = ImGui::GetIO();\r\n io.Fonts->AddFontDefault();\r\n\r\n // merge in icons from Font Awesome\r\nstatic const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };\r\nImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;\r\nio.Fonts->AddFontFromFileTTF( fontFile.c_str(), 16.0f, &icons_config, icons_ranges);\r\n\r\n// in an imgui window somewhere...\r\nImGui::Button(ICON_FA_FILE_O, ImVec2(24, 24));\r\n\r\n![default](https://cloud.githubusercontent.com/assets/905931/16845395/5600be34-4a1b-11e6-8fdb-c42114d82413.PNG)\r\n"}}
{"actor":{"display_login":"zhouxs1023"}}