Skip to main content

text()

Renders a text string as extrudable outline geometry inside the current sketch, at the sketch cursor.

Returns: Text

tip

See the guide for detailed usage examples.

Signatures

text(text: string): Text

Renders a text string as extrudable outline geometry inside the current sketch, at the sketch cursor.

ParameterTypeDescription
textstringThe string to render.

text(text: string, path: SceneObject): Text

Renders a text string following a planar curve. Each glyph is placed upright along the path's arc length; the text plane is the path's plane. Works inside a sketch (following a curve of that sketch) or standalone. The path is left in place — mark it .guide() to keep it out of extruded profiles.

ParameterTypeDescription
textstringThe string to render.
pathSceneObjectThe curve to follow: a sketch curve (line/arc/circle), a whole sketch, a planar primitive, or a selected edge/edge loop (e.g. select(edge().circle())).

Examples

// @screenshot waitForInput
import { sketch, text, extrude } from 'fluidcad/core';

sketch("xy", () => text("Multi\nLine").size(12).align("center"))
extrude(4)

text example

// @screenshot waitForInput
import { sketch, text, extrude } from 'fluidcad/core';

sketch("xy", () => text("Hello").size(20))
extrude(6)

text example

// @screenshot waitForInput
import { sketch, text, extrude } from 'fluidcad/core';

sketch("xy", () => text("Bold").size(20).font("Times New Roman").weight("bold"))
extrude(6)

text example

// @screenshot waitForInput
import { arc, extrude, sketch, text } from 'fluidcad/core';

sketch("xy", () => {
const path = arc([0, 0], [100, 0]).center([50, -120]).cw().guide();
text("CURVED TEXT", path).size(12).align("center");
});
extrude(4);

text example