MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / init

Function init

TheForceEngine/TFE_Ui/markdown.cpp:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 static ImGui::MarkdownConfig s_mdConfig{ linkCallback, imageCallback, nullptr, { { NULL, true }, { NULL, true }, { NULL, false } } };
33
34 bool init(f32 baseFontSize)
35 {
36 char fp[TFE_MAX_PATH];
37
38 ImGuiIO& io = ImGui::GetIO();
39
40 sprintf(fp, "Fonts/DroidSans.ttf");
41 TFE_Paths::mapSystemPath(fp);
42 s_baseFont = io.Fonts->AddFontFromFileTTF(fp, baseFontSize);
43
44
45 sprintf(fp, "Fonts/DroidSans-Bold.ttf");
46 TFE_Paths::mapSystemPath(fp);
47 // Bold
48 s_mdConfig.boldFont = io.Fonts->AddFontFromFileTTF(fp, baseFontSize);
49 // Heading H1
50 s_mdConfig.headingFormats[0].font = io.Fonts->AddFontFromFileTTF(fp, baseFontSize * 2);
51 // Heading H2
52 s_mdConfig.headingFormats[1].font = io.Fonts->AddFontFromFileTTF(fp, baseFontSize * 5/3);
53 // Heading H3
54 s_mdConfig.headingFormats[2].font = io.Fonts->AddFontFromFileTTF(fp, baseFontSize * 4/3);
55
56 return true;
57 }
58
59 void shutdown()
60 {

Callers

nothing calls this directly

Calls 2

AddFontFromFileTTFMethod · 0.80
mapSystemPathFunction · 0.50

Tested by

no test coverage detected