Font/Text: layout should never be null in set_text

This commit is contained in:
Charles Dang 2025-03-13 01:21:59 -04:00
parent 01ecc04ac8
commit 4bbad94109

View File

@ -320,10 +320,6 @@ void pango_text::apply_attributes(const font::attribute_list& attrs)
bool pango_text::set_text(const std::string& text, const bool markedup)
{
if(markedup != markedup_text_ || text != text_) {
if(layout_ == nullptr) {
layout_.reset(pango_layout_new(context_.get()));
}
const std::u32string wide = unicode_cast<std::u32string>(text);
std::string narrow = unicode_cast<std::string>(wide);
if(text != narrow) {