Skip to content

Commit 1d2202d

Browse files
author
gourijain026@gmail.com
committed
fix(typography): correct textToContours and textToModel reference documentation (#8623)
1 parent fbeff34 commit 1d2202d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/type/p5.Font.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export class Font {
290290
* coordinates of the bounding box's bottom-left corner. See
291291
* <a href="#/p5/textAlign">textAlign()</a> for more ways to align text.
292292
*
293-
* The fourth parameter, `options`, is also optional. `font.textToPoints()`
293+
* The fourth parameter, `options`, is also optional. `font.textToContours()`
294294
* expects an object with the following properties:
295295
*
296296
* `sampleFactor` is the ratio of the text's path length to the number of
@@ -373,6 +373,15 @@ export class Font {
373373
*
374374
* The generated model (a Geometry object) can be manipulated further—rotated, scaled,
375375
* or styled with shaders—to create engaging, interactive visual art.
376+
*
377+
* The `options` parameter is also optional. `font.textToModel()` expects an object
378+
* with the following properties:
379+
*
380+
* `extrude` is the depth to extrude the text. It defaults to 0. A value of 0 produces
381+
* flat text; higher values create thicker, 3D models.
382+
*
383+
* `sampleFactor` is a factor controlling the level of detail for the text contours.
384+
* It defaults to 1. Higher values result in smoother curves.
376385
*
377386
* @param {String} str The text string to convert into a 3D model.
378387
* @param {Number} x The x-coordinate for the starting position of the text.

0 commit comments

Comments
 (0)