| 208 | } |
| 209 | |
| 210 | void EditText::setFontName(std::string_view _value) |
| 211 | { |
| 212 | mTexture = nullptr; |
| 213 | mFont = FontManager::getInstance().getByName(_value); |
| 214 | if (mFont != nullptr) |
| 215 | { |
| 216 | mTexture = mFont->getTextureFont(); |
| 217 | |
| 218 | // set default font height |
| 219 | if (mFont->getDefaultHeight() != 0 && !mCustomFontHeight) |
| 220 | { |
| 221 | mFontHeight = mFont->getDefaultHeight(); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | mTextOutDate = true; |
| 226 | |
| 227 | // если мы были приаттаченны, то удаляем себя |
| 228 | if (nullptr != mRenderItem) |
| 229 | { |
| 230 | mRenderItem->removeDrawItem(this); |
| 231 | mRenderItem = nullptr; |
| 232 | } |
| 233 | |
| 234 | // если есть текстура, то приаттачиваемся |
| 235 | if (nullptr != mTexture && nullptr != mNode) |
| 236 | { |
| 237 | mRenderItem = mNode->addToRenderItem(mTexture, false, false); |
| 238 | mRenderItem->addDrawItem(this, mCountVertex); |
| 239 | } |
| 240 | |
| 241 | if (nullptr != mNode) |
| 242 | mNode->outOfDate(mRenderItem); |
| 243 | } |
| 244 | |
| 245 | std::string_view EditText::getFontName() const |
| 246 | { |
nothing calls this directly
no test coverage detected