@@ -198,7 +198,7 @@ namespace FreeType
198198
199199 FT_Glyph glyph;
200200 if (FT_Error error = FT_Get_Glyph (face->glyph , &glyph))
201- LL_EXCEPTION (LLUtils::Exception::ErrorCode::RuntimeError, " FreeType error, unable to render glyph" );
201+ LL_EXCEPTION (LLUtils::Exception::ErrorCode::RuntimeError, std::format ( " FreeType error {0}, {1} " , error, GenerateFreeTypeErrorString ( " unable to render glyph" ,error)) );
202202
203203 if (glyph->format != FT_GLYPH_FORMAT_BITMAP)
204204 {
@@ -271,13 +271,13 @@ namespace FreeType
271271 template <typename source_type, typename dest_type>
272272 void FreeTypeConnector::ResolvePremultipoliedBUffer (LLUtils::Buffer& dest, const LLUtils::Buffer& source, uint32_t width, uint32_t height)
273273 {
274- std::span destPtr ( reinterpret_cast <dest_type*> (dest. data ()), width * height );
275- const std::span sourcePtr ( reinterpret_cast <const source_type*> (source. data ()), width * height );
274+ std::span<dest_type> destPtr (dest);
275+ const std::span<const source_type> sourcePtr (source);
276276
277277 for (auto y = 0u ; y < height;y++)
278278 for (auto x = 0u ; x < width; x++)
279279 destPtr[y * width + x] = static_cast <dest_type>(sourcePtr[y * width + x].DivideAlpha ());
280- }
280+ }
281281
282282
283283 void FreeTypeConnector::CreateBitmap (const TextCreateParams& textCreateParams
@@ -334,8 +334,7 @@ namespace FreeType
334334
335335 ColorF32 textBackgroundBuffer = renderOutline ? ColorF32 (0 .0f ,0 .0f ,0 .0f ,0 .0f ) : static_cast <ColorF32>(backgroundColor).MultiplyAlpha ();
336336
337- std::span textBufferColor (reinterpret_cast <ColorF32*>(textBuffer.data ()), totalTexels);
338-
337+ std::span<ColorF32> textBufferColor (textBuffer);
339338
340339 for (size_t i = 0 ; i < totalTexels; i++)
341340 textBufferColor[i] = textBackgroundBuffer;
@@ -345,7 +344,7 @@ namespace FreeType
345344 if (renderOutline)
346345 {
347346 outlineBuffer.Allocate (sizeOfDestBuffer);
348- std::span outlineBufferColor ( reinterpret_cast <ColorF32*> (outlineBuffer. data ()), totalTexels );
347+ std::span<ColorF32> outlineBufferColor (outlineBuffer);
349348
350349 // Reset outline buffer to background color.
351350 for (size_t i = 0 ; i < totalTexels; i++)
@@ -443,7 +442,7 @@ namespace FreeType
443442
444443 FT_Glyph glyph;
445444 if (FT_Error error = FT_Get_Glyph (face->glyph , &glyph))
446- LL_EXCEPTION (LLUtils::Exception::ErrorCode::RuntimeError, " FreeType error, unable to render glyph" );
445+ LL_EXCEPTION (LLUtils::Exception::ErrorCode::RuntimeError, std::format ( " FreeType error {0}, {1} " ,error, GenerateFreeTypeErrorString ( " unable to render glyph" , error)) );
447446
448447 if (glyph->format != FT_GLYPH_FORMAT_BITMAP)
449448 {
0 commit comments