MCPcopy Index your code
hub / github.com/processing/p5.js / textToPoints

Method textToPoints

src/type/p5.Font.js:265–277  ·  view source on GitHub ↗

* Returns an array of points outlining a string of text written using the * font. * * Each point object in the array has three properties that describe the * point's location and orientation, called its path angle. For example, * `{ x: 10, y: 20, alpha: 450 }`. * * The first par

(str, x, y, width, height, options)

Source from the content-addressed store, hash-verified

263 * }
264 */
265 textToPoints(str, x, y, width, height, options) {
266 // By segmenting per contour, pointAtLength becomes much faster
267 const contourPoints = this.textToContours(
268 str,
269 x, y,
270 width, height,
271 options
272 );
273 return contourPoints.reduce((acc, next) => {
274 acc.push(...next);
275 return acc;
276 }, []);
277 }
278
279 /**
280 * Returns an array of arrays of points outlining a string of text written using the

Callers 2

p5.Font.jsFile · 0.80
typography.jsFile · 0.80

Calls 2

textToContoursMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected