{"action":"created","issue":{"url":"https://api.github.com/repos/ocornut/imgui/issues/1397","repository_url":"https://api.github.com/repos/ocornut/imgui","labels_url":"https://api.github.com/repos/ocornut/imgui/issues/1397/labels{/name}","comments_url":"https://api.github.com/repos/ocornut/imgui/issues/1397/comments","events_url":"https://api.github.com/repos/ocornut/imgui/issues/1397/events","html_url":"https://github.com/ocornut/imgui/issues/1397","id":269325974,"number":1397,"title":"Load font for ImGui::Begin","user":{"login":"ds-cs","id":33124939,"avatar_url":"https://avatars3.githubusercontent.com/u/33124939?v=4","gravatar_id":"","url":"https://api.github.com/users/ds-cs","html_url":"https://github.com/ds-cs","followers_url":"https://api.github.com/users/ds-cs/followers","following_url":"https://api.github.com/users/ds-cs/following{/other_user}","gists_url":"https://api.github.com/users/ds-cs/gists{/gist_id}","starred_url":"https://api.github.com/users/ds-cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ds-cs/subscriptions","organizations_url":"https://api.github.com/users/ds-cs/orgs","repos_url":"https://api.github.com/users/ds-cs/repos","events_url":"https://api.github.com/users/ds-cs/events{/privacy}","received_events_url":"https://api.github.com/users/ds-cs/received_events","type":"User","site_admin":false},"labels":[{"id":231641148,"url":"https://api.github.com/repos/ocornut/imgui/labels/font","name":"font","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-10-28T15:23:24Z","updated_at":"2018-02-20T10:33:29Z","closed_at":"2017-10-28T15:28:36Z","author_association":"NONE","body":"Dear Ocornut,\r\n\r\nI'm using your lib with DirectX9.\r\nI have the case, that I need to load a special font only for one window (ImGui::Begin)\r\n..\r\nWhat I did:\r\nImFont* pFont = io.Fonts->AddFontFromFileTTF(\"C:\\\\Windows\\\\Fonts\\\\Ruda-Bold.ttf\", 50);\r\nImGui::PushFont(pFont);\r\n\r\nI've load the font, location seems to be correct. If I try to push font.. I get some strange errors. How can I load a front for a window and change after this specific window back to default font?\r\n"},"comment":{"url":"https://api.github.com/repos/ocornut/imgui/issues/comments/366935463","html_url":"https://github.com/ocornut/imgui/issues/1397#issuecomment-366935463","issue_url":"https://api.github.com/repos/ocornut/imgui/issues/1397","id":366935463,"user":{"login":"Dazzid","id":230392,"avatar_url":"https://avatars2.githubusercontent.com/u/230392?v=4","gravatar_id":"","url":"https://api.github.com/users/Dazzid","html_url":"https://github.com/Dazzid","followers_url":"https://api.github.com/users/Dazzid/followers","following_url":"https://api.github.com/users/Dazzid/following{/other_user}","gists_url":"https://api.github.com/users/Dazzid/gists{/gist_id}","starred_url":"https://api.github.com/users/Dazzid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dazzid/subscriptions","organizations_url":"https://api.github.com/users/Dazzid/orgs","repos_url":"https://api.github.com/users/Dazzid/repos","events_url":"https://api.github.com/users/Dazzid/events{/privacy}","received_events_url":"https://api.github.com/users/Dazzid/received_events","type":"User","site_admin":false},"created_at":"2018-02-20T10:33:29Z","updated_at":"2018-02-20T10:33:29Z","author_association":"NONE","body":"I have a very simple example in openframeworks. It compiles well noe but the font is not yet placed. Looks I'm just missing the part that loads the font?\r\n\r\n`#include \"ofApp.h\"\r\n\r\n//--------------------------------------------------------------\r\nvoid ofApp::setup(){\r\ngui.setup();\r\n    //imageButtonSource.load(\"of.png\");\r\n    imageButtonID = gui.loadImage(imageButtonSource);\r\n    ImGuiIO& io = ImGui::GetIO();\r\n    \r\n   // font1 = io.Fonts->AddFontDefault();\r\n    font1 = io.Fonts->AddFontFromFileTTF(\"/Users/David/Openframeworks/apps/myApps/imGui/bin/data/fonts/Verdana.ttf\", 18.0f);\r\n   // ImGui::Fonts->GetTexDataAsRGBA32;\r\n    //ImGui::PushFont(font1);\r\n}\r\n\r\n//--------------------------------------------------------------\r\nvoid ofApp::update(){\r\n\r\n}\r\nImVec4 clear_color = ImVec4(0.99f, 0.55f, 0.10f, 1.00f);\r\n//--------------------------------------------------------------\r\nvoid ofApp::draw(){\r\n    //required to call this at beginning\r\n    gui.begin();\r\n\r\n    bool show_another_window = true;\r\n    ImGui::SetNextWindowSize(ofVec2f(400,400), ImGuiSetCond_FirstUseEver);\r\n    ImGui::SetNextWindowPos(ofVec2f(100,100));\r\n    ImGui::Begin(\"Final Result\", &show_another_window);\r\n    ImGui::BeginChild(\"Scrolling\");\r\n\r\n   // ImGui::PushFont(font1);\r\n    for (int n = 0; n < 50; n++)\r\n        ImGui::TextColored(clear_color, \"%04d: Some text\");\r\n    ImGui::EndChild();\r\n    //ImGui::PopFont();\r\n    \r\n    //ImGui::ImageButton((ImTextureID)(uintptr_t)imageButtonID, ImVec2(300, 300));\r\n    ImGui::End();\r\n    gui.end();\r\n}`"}}
{"actor":{"display_login":"Dazzid"}}