MCPcopy Create free account
hub / github.com/defold/defold / FontLoadFromPath

Function FontLoadFromPath

engine/font/src/font.cpp:85–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85HFont FontLoadFromPath(const char* path)
86{
87 uint32_t data_size;
88 void* data = FontReadFile(path, &data_size); // we pass the ownership to the font implementation
89 if (!data)
90 {
91 return 0;
92 }
93
94 Font* font = FontLoadFromMemory(path, data, data_size, true);
95 free(data);
96 if (!font)
97 {
98 return 0;
99 }
100 return font;
101}
102
103uint32_t FontGetResourceSize(HFont font)
104{

Callers 1

LoadFontMethod · 0.85

Calls 3

FontReadFileFunction · 0.85
FontLoadFromMemoryFunction · 0.85
freeFunction · 0.85

Tested by 1

LoadFontMethod · 0.68