@@ -200,26 +200,27 @@ class Font {
200
200
*
201
201
* async function setup() {
202
202
* 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 });
211
213
* geom.clearColors();
212
214
* geom.normalize();
213
215
* }
214
216
*
215
217
* function draw() {
216
218
* background(255);
217
- * orbitControl(); // Enables mouse control to rotate the 3D text.
219
+ * orbitControl();
218
220
* fill("red");
219
221
* strokeWeight(4);
220
222
* scale(min(width, height) / 300);
221
223
* model(geom);
222
- *
223
224
* describe('3D red extruded "Hello" in Source Serif on white, rotatable via mouse.');
224
225
* }
225
226
* </code>
0 commit comments