diff --git a/Libraries/LibGfx/TextLayout.cpp b/Libraries/LibGfx/TextLayout.cpp index 0b49f8b4c16..26e4587d718 100644 --- a/Libraries/LibGfx/TextLayout.cpp +++ b/Libraries/LibGfx/TextLayout.cpp @@ -52,7 +52,7 @@ Vector> shape_text(FloatPoint baseline_start, Utf8View s return runs; } -RefPtr shape_text(FloatPoint baseline_start, float letter_spacing, Utf8View string, Gfx::Font const& font, GlyphRun::TextType text_type, ShapeFeatures const& features) +NonnullRefPtr shape_text(FloatPoint baseline_start, float letter_spacing, Utf8View string, Gfx::Font const& font, GlyphRun::TextType text_type, ShapeFeatures const& features) { static hb_buffer_t* buffer = hb_buffer_create(); hb_buffer_add_utf8(buffer, reinterpret_cast(string.bytes()), string.byte_length(), 0, -1); diff --git a/Libraries/LibGfx/TextLayout.h b/Libraries/LibGfx/TextLayout.h index 0cf8e7818f9..5239d7e65a8 100644 --- a/Libraries/LibGfx/TextLayout.h +++ b/Libraries/LibGfx/TextLayout.h @@ -70,7 +70,7 @@ private: float m_width { 0 }; }; -RefPtr shape_text(FloatPoint baseline_start, float letter_spacing, Utf8View string, Gfx::Font const& font, GlyphRun::TextType, ShapeFeatures const& features); +NonnullRefPtr shape_text(FloatPoint baseline_start, float letter_spacing, Utf8View string, Gfx::Font const& font, GlyphRun::TextType, ShapeFeatures const& features); Vector> shape_text(FloatPoint baseline_start, Utf8View string, FontCascadeList const&); float measure_text_width(Utf8View const& string, Gfx::Font const& font, ShapeFeatures const& features);