diff --git a/src/type/p5.Font.js b/src/type/p5.Font.js index 87123456f9..3029df76a9 100644 --- a/src/type/p5.Font.js +++ b/src/type/p5.Font.js @@ -545,6 +545,10 @@ export class Font { const extrude = options?.extrude || 0; let contours = this.textToContours(str, x, y, width, height, options); + if (!contours || contours.length === 0) { + return new p5.Geometry(); + } + // Step 2: build base flat geometry - single shape const geom = this._pInst.buildGeometry(() => { const prevValidateFaces = this._pInst._renderer._validateFaces;