Skip to content

Commit daac93f

Browse files
authored
Merge pull request #8429 from skyash-dev/fix-textToModel-empty-glyph
fix textToModel regression for space characters
2 parents 02cdcad + 32b42e3 commit daac93f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/type/p5.Font.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ export class Font {
545545
const extrude = options?.extrude || 0;
546546

547547
let contours = this.textToContours(str, x, y, width, height, options);
548+
if (!contours || contours.length === 0) {
549+
return new p5.Geometry();
550+
}
551+
548552
// Step 2: build base flat geometry - single shape
549553
const geom = this._pInst.buildGeometry(() => {
550554
const prevValidateFaces = this._pInst._renderer._validateFaces;

0 commit comments

Comments
 (0)