@@ -119,9 +119,6 @@ core::smart_refctd_ptr<ICPUImage> FontFace::generateGlyphMSDF(uint32_t baseMSDFP
119
119
// and we can't deep clone it
120
120
auto shape = generateGlyphShape (glyphId);
121
121
122
- // Empty shapes should've been filtered sooner
123
- assert (!shape.contours .empty ());
124
-
125
122
uint32_t mipW = textureExtents.x / (1 << i);
126
123
uint32_t mipH = textureExtents.y / (1 << i);
127
124
@@ -136,6 +133,12 @@ core::smart_refctd_ptr<ICPUImage> FontFace::generateGlyphMSDF(uint32_t baseMSDFP
136
133
region.imageOffset = { 0u ,0u ,0u };
137
134
region.imageExtent = { mipW, mipH, 1u };
138
135
136
+ if (shape.contours .empty ())
137
+ {
138
+ _NBL_DEBUG_BREAK_IF (true ); // glyph id has no contours in it's shape for this font
139
+ continue ;
140
+ }
141
+
139
142
auto shapeBounds = shape.getBounds ();
140
143
141
144
float32_t2 mipExtents = float32_t2 (float (mipW), float (mipH));
@@ -166,7 +169,7 @@ core::smart_refctd_ptr<ICPUImage> FontFace::generateGlyphMSDF(uint32_t baseMSDFP
166
169
assert (bufferOffset <= buffer->getCreationParams ().size );
167
170
image->setBufferAndRegions (std::move (buffer), std::move (regions));
168
171
169
- return std::move ( image) ;
172
+ return image;
170
173
}
171
174
172
175
float32_t2 FontFace::getUV (float32_t2 uv, float32_t2 glyphSize, uint32_t2 textureExtents, uint32_t msdfPixelRange)
0 commit comments