Skip to content

Commit 286c404

Browse files
authored
removing the font object
1 parent f6e7cd8 commit 286c404

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/type/p5.Font.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,24 +169,20 @@ class Font {
169169
*
170170
* async function setup() {
171171
* createCanvas(200, 200, WEBGL);
172-
* fonts = {
173-
* Anton: await loadFont('https://fonts.gstatic.com/s/anton/v25/1Ptgg87LROyAm0K08i4gS7lu.ttf')
174-
* };
172+
* font = await loadFont('https://fonts.gstatic.com/s/anton/v25/1Ptgg87LROyAm0K08i4gS7lu.ttf');
175173
*
176-
* // Create 3D geometry from text using the Anton font
177-
* geom = fonts['Anton'].textToModel("Hello", 50, 0, { sampleFactor: 2 });
174+
* geom = font.textToModel("Hello", 50, 0, { sampleFactor: 2 });
178175
* geom.clearColors();
179176
* geom.normalize();
180177
* }
181178
*
182179
* function draw() {
183180
* background(255);
184-
* orbitControl(); // Enables mouse control to rotate the 3D text
181+
* orbitControl();
185182
* fill("red");
186183
* strokeWeight(4);
187184
* scale(min(width, height) / 300);
188185
* model(geom);
189-
*
190186
* describe('A red non-extruded "Hello" in Anton on white canvas, rotatable via mouse.');
191187
* }
192188
* </code>

0 commit comments

Comments
 (0)