MCPcopy Create free account
hub / github.com/MyGUI/mygui / loadVarFont

Function loadVarFont

MyGUIEngine/src/msdfgen/main.cpp:171–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170#ifndef MSDFGEN_DISABLE_VARIABLE_FONTS
171static FontHandle *loadVarFont(FreetypeHandle *library, const char *filename) {
172 std::string buffer;
173 while (*filename && *filename != '?')
174 buffer.push_back(*filename++);
175 FontHandle *font = loadFont(library, buffer.c_str());
176 if (font && *filename++ == '?') {
177 do {
178 buffer.clear();
179 while (*filename && *filename != '=')
180 buffer.push_back(*filename++);
181 if (*filename == '=') {
182 char *end = NULL;
183 double value = strtod(++filename, &end);
184 if (end > filename) {
185 filename = end;
186 setFontVariationAxis(library, font, buffer.c_str(), value);
187 }
188 }
189 } while (*filename++ == '&');
190 }
191 return font;
192}
193#endif
194#endif
195

Callers 1

mainFunction · 0.85

Calls 5

loadFontFunction · 0.85
setFontVariationAxisFunction · 0.85
push_backMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected