From 5670e2cc8f524b96c0d937b154952fa1eef35aa9 Mon Sep 17 00:00:00 2001 From: skyash-dev Date: Tue, 20 Jan 2026 23:18:00 +0530 Subject: [PATCH] fix textToModel to return empty geometry for space characters --- src/type/p5.Font.js | 4 ++++ 1 file changed, 4 insertions(+) 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;