| 169 | |
| 170 | #ifndef MSDFGEN_DISABLE_VARIABLE_FONTS |
| 171 | static 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 | |