Skip to content

Commit fb6b124

Browse files
authored
minor fixes
1 parent 0a347f9 commit fb6b124

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/type/p5.Font.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,26 +200,27 @@ class Font {
200200
*
201201
* async function setup() {
202202
* createCanvas(200, 200, WEBGL);
203-
* fonts = {
204-
* Anton: await loadFont('https://fonts.gstatic.com/s/anton/v25/1Ptgg87LROyAm0K08i4gS7lu.ttf'),
205-
* Montserrat: await loadFont('https://fonts.gstatic.com/s/montserrat/v29/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew-Y3tcoqK5.ttf'),
206-
* 'Source Serif': await loadFont('https://fonts.gstatic.com/s/sourceserif4/v8/vEFy2_tTDB4M7-auWDN0ahZJW3IX2ih5nk3AucvUHf6OAVIJmeUDygwjihdqrhxXD-wGvjU.ttf'),
207-
* };
208-
*
209-
* // You can change fonts from here.
210-
* geom = fonts['Source Serif'].textToModel("Hello", 50, 0, { sampleFactor: 2, extrude: 5 });
203+
*
204+
* // Alternative fonts:
205+
* // Anton: 'https://fonts.gstatic.com/s/anton/v25/1Ptgg87LROyAm0K08i4gS7lu.ttf'
206+
* // Montserrat: 'https://fonts.gstatic.com/s/montserrat/v29/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew-Y3tcoqK5.ttf'
207+
* // Source Serif: 'https://fonts.gstatic.com/s/sourceserif4/v8/vEFy2_tTDB4M7-auWDN0ahZJW3IX2ih5nk3AucvUHf6OAVIJmeUDygwjihdqrhxXD-wGvjU.ttf'
208+
*
209+
* // Using Source Serif for this example:
210+
* font = await loadFont('https://fonts.gstatic.com/s/sourceserif4/v8/vEFy2_tTDB4M7-auWDN0ahZJW3IX2ih5nk3AucvUHf6OAVIJmeUDygwjihdqrhxXD-wGvjU.ttf');
211+
*
212+
* geom = font.textToModel("Hello", 50, 0, { sampleFactor: 2, extrude: 5 });
211213
* geom.clearColors();
212214
* geom.normalize();
213215
* }
214216
*
215217
* function draw() {
216218
* background(255);
217-
* orbitControl(); // Enables mouse control to rotate the 3D text.
219+
* orbitControl();
218220
* fill("red");
219221
* strokeWeight(4);
220222
* scale(min(width, height) / 300);
221223
* model(geom);
222-
*
223224
* describe('3D red extruded "Hello" in Source Serif on white, rotatable via mouse.');
224225
* }
225226
* </code>

0 commit comments

Comments
 (0)