MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Init

Method Init

Source/Engine/Render2D/FontManager.cpp:66–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66bool FontManagerService::Init()
67{
68 ASSERT(Library == nullptr);
69
70 // Scale UI fonts to match the monitor DPI
71 FontManager::FontScale = (float)Platform::GetDpi() / (float)DefaultDPI; // TODO: Adjust this at runtime
72
73 // Init Free Type
74 FreeTypeMemory.user = nullptr;
75 FreeTypeMemory.alloc = &FreeTypeAlloc;
76 FreeTypeMemory.realloc = &FreeTypeRealloc;
77 FreeTypeMemory.free = &FreeTypeFree;
78 const FT_Error error = FT_New_Library(&FreeTypeMemory, &Library);
79 if (error)
80 {
81 LOG_FT_ERROR(error);
82 return true;
83 }
84 FT_Add_Default_Modules(Library);
85
86 // Log version info
87 FT_Int major, minor, patch;
88 FT_Library_Version(Library, &major, &minor, &patch);
89 LOG(Info, "FreeType initialized, version: {0}.{1}.{2}", major, minor, patch);
90
91 return false;
92}
93
94void FontManagerService::Dispose()
95{

Callers 1

AddNewEntryMethod · 0.45

Calls 1

GetDpiFunction · 0.85

Tested by

no test coverage detected