| 308 | } |
| 309 | |
| 310 | void TextFieldEx::setTextFontName(std::string_view fontName) |
| 311 | { |
| 312 | if (FileUtils::getInstance()->isFileExist(fontName)) |
| 313 | { |
| 314 | TTFConfig config = _renderLabel->getTTFConfig(); |
| 315 | config.fontFilePath = fontName; |
| 316 | config.fontSize = _fontSize; |
| 317 | _renderLabel->setTTFConfig(config); |
| 318 | _systemFontUsed = false; |
| 319 | _fontType = 1; |
| 320 | } |
| 321 | else |
| 322 | { |
| 323 | _renderLabel->setSystemFontName(fontName); |
| 324 | if (!_systemFontUsed) |
| 325 | { |
| 326 | _renderLabel->requestSystemFontRefresh(); |
| 327 | } |
| 328 | _renderLabel->setSystemFontSize(_fontSize); |
| 329 | _systemFontUsed = true; |
| 330 | _fontType = 0; |
| 331 | } |
| 332 | _fontName = fontName; |
| 333 | |
| 334 | using namespace std::string_view_literals; |
| 335 | _asteriskWidth = internalCalcStringWidth("*"sv, _fontName, _fontSize); |
| 336 | } |
| 337 | |
| 338 | void TextFieldEx::setTextFontSize(float size) |
| 339 | { |
nothing calls this directly
no test coverage detected