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

Function GetFontType

engine/font/src/font.cpp:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static FontType GetFontType(const char* path)
36{
37 const char* ext = strrchr(path, '.');
38 if (!ext)
39 return FONT_TYPE_UNKNOWN;
40
41 if (strcmp(ext, ".ttf") == 0 || strcmp(ext, ".TTF") == 0)
42 return FONT_TYPE_STBTTF;
43 if (strcmp(ext, ".otf") == 0 || strcmp(ext, ".OTF") == 0)
44 return FONT_TYPE_STBOTF;
45
46 return FONT_TYPE_UNKNOWN;
47}
48
49void FontDestroy(HFont hfont)
50{

Callers 1

FontLoadFromMemoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected