p5 2.2.1-rc.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accessibility/color_namer.js +5 -6
- package/dist/accessibility/describe.js +4 -26
- package/dist/accessibility/index.js +5 -6
- package/dist/accessibility/outputs.js +6 -38
- package/dist/app.js +5 -6
- package/dist/color/color_conversion.js +5 -6
- package/dist/color/creating_reading.js +1 -1
- package/dist/color/index.js +2 -2
- package/dist/color/p5.Color.js +1 -1
- package/dist/color/setting.js +59 -357
- package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
- package/dist/core/constants.js +1 -1
- package/dist/core/environment.js +26 -158
- package/dist/core/filterShaders.js +1 -1
- package/dist/core/friendly_errors/fes_core.js +1 -1
- package/dist/core/friendly_errors/file_errors.js +1 -1
- package/dist/core/friendly_errors/index.js +1 -1
- package/dist/core/friendly_errors/param_validator.js +1 -1
- package/dist/core/friendly_errors/sketch_verifier.js +1 -1
- package/dist/core/helpers.js +1 -1
- package/dist/core/init.js +5 -6
- package/dist/core/internationalization.js +1 -1
- package/dist/core/legacy.js +5 -6
- package/dist/core/main.js +5 -6
- package/dist/core/p5.Graphics.js +4 -5
- package/dist/core/p5.Renderer.js +3 -4
- package/dist/core/p5.Renderer2D.js +5 -6
- package/dist/core/p5.Renderer3D.js +4 -5
- package/dist/core/rendering.js +4 -5
- package/dist/core/structure.js +13 -52
- package/dist/core/transform.js +32 -176
- package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
- package/dist/data/local_storage.js +4 -30
- package/dist/dom/dom.js +24 -159
- package/dist/dom/index.js +2 -2
- package/dist/dom/p5.Element.js +31 -208
- package/dist/dom/p5.File.js +1 -32
- package/dist/dom/p5.MediaElement.js +10 -113
- package/dist/events/acceleration.js +11 -64
- package/dist/events/keyboard.js +13 -81
- package/dist/events/pointer.js +18 -160
- package/dist/image/const.js +1 -1
- package/dist/image/filterRenderer2D.js +4 -5
- package/dist/image/image.js +4 -5
- package/dist/image/index.js +4 -5
- package/dist/image/loading_displaying.js +4 -5
- package/dist/image/p5.Image.js +3 -4
- package/dist/image/pixels.js +17 -100
- package/dist/io/files.js +4 -5
- package/dist/io/index.js +4 -5
- package/dist/io/p5.Table.js +66 -158
- package/dist/io/p5.TableRow.js +48 -71
- package/dist/io/p5.XML.js +6 -99
- package/dist/io/utilities.js +8 -3
- package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
- package/dist/math/Matrices/Matrix.js +87 -126
- package/dist/math/Matrices/MatrixNumjs.js +1 -5
- package/dist/math/calculation.js +10 -112
- package/dist/math/index.js +1 -1
- package/dist/math/math.js +2 -12
- package/dist/math/noise.js +5 -32
- package/dist/math/p5.Matrix.js +3 -3
- package/dist/math/p5.Vector.js +104 -345
- package/dist/math/random.js +5 -32
- package/dist/math/trigonometry.js +15 -105
- package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
- package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
- package/dist/shape/2d_primitives.js +33 -194
- package/dist/shape/attributes.js +12 -73
- package/dist/shape/curves.js +30 -95
- package/dist/shape/custom_shapes.js +63 -144
- package/dist/shape/index.js +2 -2
- package/dist/shape/vertex.js +21 -106
- package/dist/strands/p5.strands.js +248 -46
- package/dist/type/index.js +3 -4
- package/dist/type/p5.Font.js +4 -49
- package/dist/type/textCore.js +5 -158
- package/dist/utilities/conversion.js +17 -104
- package/dist/utilities/time_date.js +3 -40
- package/dist/utilities/utility_functions.js +6 -48
- package/dist/webgl/3d_primitives.js +4 -5
- package/dist/webgl/GeometryBuilder.js +1 -2
- package/dist/webgl/ShapeBuilder.js +22 -2
- package/dist/webgl/enums.js +1 -1
- package/dist/webgl/index.js +4 -5
- package/dist/webgl/interaction.js +6 -33
- package/dist/webgl/light.js +4 -5
- package/dist/webgl/loading.js +12 -46
- package/dist/webgl/material.js +4 -5
- package/dist/webgl/p5.Camera.js +4 -5
- package/dist/webgl/p5.DataArray.js +0 -4
- package/dist/webgl/p5.Framebuffer.js +4 -5
- package/dist/webgl/p5.Geometry.js +12 -106
- package/dist/webgl/p5.Quat.js +1 -1
- package/dist/webgl/p5.RendererGL.js +7 -18
- package/dist/webgl/p5.Shader.js +12 -36
- package/dist/webgl/p5.Texture.js +4 -5
- package/dist/webgl/text.js +4 -5
- package/dist/webgl/utils.js +4 -5
- package/dist/webgpu/index.js +1 -1
- package/dist/webgpu/p5.RendererWebGPU.js +529 -208
- package/dist/webgpu/shaders/color.js +32 -17
- package/dist/webgpu/shaders/filters/base.js +18 -7
- package/dist/webgpu/shaders/font.js +52 -40
- package/dist/webgpu/shaders/line.js +50 -36
- package/dist/webgpu/shaders/material.js +90 -83
- package/dist/webgpu/strands_wgslBackend.js +5 -2
- package/lib/p5.esm.js +5576 -7811
- package/lib/p5.esm.min.js +1 -1
- package/lib/p5.js +5576 -7811
- package/lib/p5.min.js +1 -1
- package/lib/p5.webgpu.esm.js +786 -453
- package/lib/p5.webgpu.js +786 -453
- package/lib/p5.webgpu.min.js +1 -1
- package/package.json +13 -13
- package/types/global.d.ts +16905 -16783
- package/types/p5.d.ts +11142 -11081
package/dist/type/textCore.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { R as Renderer } from '../p5.Renderer-
|
|
2
|
-
import '../creating_reading-
|
|
1
|
+
import { R as Renderer } from '../p5.Renderer-D-5LdCRz.js';
|
|
2
|
+
import '../creating_reading-ZXzcZEsb.js';
|
|
3
3
|
import 'colorjs.io/fn';
|
|
4
4
|
import '../color/color_spaces/hsb.js';
|
|
5
|
-
import '../constants-
|
|
5
|
+
import '../constants-DQyACdzq.js';
|
|
6
6
|
import '../image/filters.js';
|
|
7
7
|
import '../math/p5.Vector.js';
|
|
8
8
|
import '../shape/custom_shapes.js';
|
|
9
9
|
import '../core/States.js';
|
|
10
10
|
import '../io/utilities.js';
|
|
11
|
-
import 'file-saver';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* @module Typography
|
|
@@ -105,8 +104,6 @@ function textCore(p5, fn) {
|
|
|
105
104
|
*
|
|
106
105
|
* @for p5
|
|
107
106
|
* @example
|
|
108
|
-
* <div>
|
|
109
|
-
* <code>
|
|
110
107
|
* function setup() {
|
|
111
108
|
* createCanvas(100, 100);
|
|
112
109
|
* background(200);
|
|
@@ -114,11 +111,8 @@ function textCore(p5, fn) {
|
|
|
114
111
|
*
|
|
115
112
|
* describe('The text "hi" written in black in the middle of a gray square.');
|
|
116
113
|
* }
|
|
117
|
-
* </code>
|
|
118
|
-
* </div>
|
|
119
114
|
*
|
|
120
|
-
*
|
|
121
|
-
* <code>
|
|
115
|
+
* @example
|
|
122
116
|
* function setup() {
|
|
123
117
|
* createCanvas(100, 100);
|
|
124
118
|
* background('skyblue');
|
|
@@ -127,12 +121,8 @@ function textCore(p5, fn) {
|
|
|
127
121
|
*
|
|
128
122
|
* describe('A rainbow in a blue sky.');
|
|
129
123
|
* }
|
|
130
|
-
* </code>
|
|
131
|
-
* </div>
|
|
132
124
|
*
|
|
133
125
|
* @example
|
|
134
|
-
* <div>
|
|
135
|
-
* <code>
|
|
136
126
|
* function setup() {
|
|
137
127
|
* createCanvas(100, 100);
|
|
138
128
|
* textSize(32);
|
|
@@ -143,12 +133,8 @@ function textCore(p5, fn) {
|
|
|
143
133
|
*
|
|
144
134
|
* describe('The text "hi" written in white with a black outline.');
|
|
145
135
|
* }
|
|
146
|
-
* </code>
|
|
147
|
-
* </div>
|
|
148
136
|
*
|
|
149
137
|
* @example
|
|
150
|
-
* <div>
|
|
151
|
-
* <code>
|
|
152
138
|
* function setup() {
|
|
153
139
|
* createCanvas(100, 100);
|
|
154
140
|
* background('black');
|
|
@@ -164,12 +150,8 @@ function textCore(p5, fn) {
|
|
|
164
150
|
*
|
|
165
151
|
* describe('The text "rainbows" written on several lines, each in a different color.');
|
|
166
152
|
* }
|
|
167
|
-
* </code>
|
|
168
|
-
* </div>
|
|
169
153
|
*
|
|
170
154
|
* @example
|
|
171
|
-
* <div>
|
|
172
|
-
* <code>
|
|
173
155
|
* function setup() {
|
|
174
156
|
* createCanvas(100, 100);
|
|
175
157
|
* background(200);
|
|
@@ -178,12 +160,8 @@ function textCore(p5, fn) {
|
|
|
178
160
|
*
|
|
179
161
|
* describe('The sample text "The quick brown fox..." written in black across several lines.');
|
|
180
162
|
* }
|
|
181
|
-
* </code>
|
|
182
|
-
* </div>
|
|
183
163
|
*
|
|
184
164
|
* @example
|
|
185
|
-
* <div>
|
|
186
|
-
* <code>
|
|
187
165
|
* function setup() {
|
|
188
166
|
* createCanvas(100, 100);
|
|
189
167
|
* background(200);
|
|
@@ -193,12 +171,8 @@ function textCore(p5, fn) {
|
|
|
193
171
|
*
|
|
194
172
|
* describe('The sample text "The quick brown fox..." written in black across several lines.');
|
|
195
173
|
* }
|
|
196
|
-
* </code>
|
|
197
|
-
* </div>
|
|
198
174
|
*
|
|
199
175
|
* @example
|
|
200
|
-
* <div modernizr='webgl'>
|
|
201
|
-
* <code>
|
|
202
176
|
* let font;
|
|
203
177
|
*
|
|
204
178
|
* async function setup() {
|
|
@@ -216,8 +190,6 @@ function textCore(p5, fn) {
|
|
|
216
190
|
*
|
|
217
191
|
* describe('The text "p5*js" written in white and spinning in 3D.');
|
|
218
192
|
* }
|
|
219
|
-
* </code>
|
|
220
|
-
* </div>
|
|
221
193
|
*/
|
|
222
194
|
|
|
223
195
|
/**
|
|
@@ -245,8 +217,6 @@ function textCore(p5, fn) {
|
|
|
245
217
|
* @param {TOP|BOTTOM|CENTER|BASELINE} [vertAlign] vertical alignment
|
|
246
218
|
* @returns {Object} If no arguments are provided, returns an object with current horizontal and vertical alignment
|
|
247
219
|
* @example
|
|
248
|
-
* <div>
|
|
249
|
-
* <code>
|
|
250
220
|
* function setup() {
|
|
251
221
|
* createCanvas(100, 100);
|
|
252
222
|
*
|
|
@@ -271,12 +241,8 @@ function textCore(p5, fn) {
|
|
|
271
241
|
*
|
|
272
242
|
* describe('The letters ABCD displayed at top-left, EFGH at center, and IJKL at bottom-right. A vertical line divides the canvas in half.');
|
|
273
243
|
* }
|
|
274
|
-
* </code>
|
|
275
|
-
* </div>
|
|
276
244
|
*
|
|
277
245
|
* @example
|
|
278
|
-
* <div>
|
|
279
|
-
* <code>
|
|
280
246
|
* function setup() {
|
|
281
247
|
* createCanvas(100, 100);
|
|
282
248
|
*
|
|
@@ -306,8 +272,6 @@ function textCore(p5, fn) {
|
|
|
306
272
|
*
|
|
307
273
|
* describe('The words "TOP", "CENTER", "BASELINE", and "BOTTOM" each drawn relative to a horizontal line. Their positions demonstrate different vertical alignments.');
|
|
308
274
|
* }
|
|
309
|
-
* </code>
|
|
310
|
-
* </div>
|
|
311
275
|
*/
|
|
312
276
|
|
|
313
277
|
/**
|
|
@@ -327,8 +291,6 @@ function textCore(p5, fn) {
|
|
|
327
291
|
* @returns {Number} The ascent value in pixels.
|
|
328
292
|
*
|
|
329
293
|
* @example
|
|
330
|
-
* <div>
|
|
331
|
-
* <code>
|
|
332
294
|
* function setup() {
|
|
333
295
|
* createCanvas(400, 300);
|
|
334
296
|
* background(220);
|
|
@@ -357,13 +319,8 @@ function textCore(p5, fn) {
|
|
|
357
319
|
* textSize(16);
|
|
358
320
|
* text("textAscent: " + asc.toFixed(2) + " pixels", x, y - asc - 10);
|
|
359
321
|
* }
|
|
360
|
-
* </code>
|
|
361
|
-
* </div>
|
|
362
|
-
*
|
|
363
322
|
*
|
|
364
323
|
* @example
|
|
365
|
-
* <div>
|
|
366
|
-
* <code>
|
|
367
324
|
* let font;
|
|
368
325
|
*
|
|
369
326
|
* async function setup() {
|
|
@@ -402,11 +359,8 @@ function textCore(p5, fn) {
|
|
|
402
359
|
*
|
|
403
360
|
* describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends upward from each baseline to the top of the "d".');
|
|
404
361
|
* }
|
|
405
|
-
* </code>
|
|
406
|
-
* </div>
|
|
407
362
|
*/
|
|
408
363
|
|
|
409
|
-
|
|
410
364
|
/**
|
|
411
365
|
* Returns the descent of the text.
|
|
412
366
|
*
|
|
@@ -424,8 +378,6 @@ function textCore(p5, fn) {
|
|
|
424
378
|
* @returns {Number} The descent value in pixels.
|
|
425
379
|
*
|
|
426
380
|
* @example
|
|
427
|
-
* <div>
|
|
428
|
-
* <code>
|
|
429
381
|
* function setup() {
|
|
430
382
|
* createCanvas(400, 300);
|
|
431
383
|
* background(220);
|
|
@@ -454,12 +406,8 @@ function textCore(p5, fn) {
|
|
|
454
406
|
* textSize(16);
|
|
455
407
|
* text("textDescent: " + desc.toFixed(2) + " pixels", x, y + desc + 20);
|
|
456
408
|
* }
|
|
457
|
-
* </code>
|
|
458
|
-
* </div>
|
|
459
409
|
*
|
|
460
410
|
* @example
|
|
461
|
-
* <div>
|
|
462
|
-
* <code>
|
|
463
411
|
* let font;
|
|
464
412
|
*
|
|
465
413
|
* async function setup() {
|
|
@@ -498,8 +446,6 @@ function textCore(p5, fn) {
|
|
|
498
446
|
*
|
|
499
447
|
* describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends downward from each baseline to the bottom of the "p".');
|
|
500
448
|
* }
|
|
501
|
-
* </code>
|
|
502
|
-
* </div>
|
|
503
449
|
*/
|
|
504
450
|
|
|
505
451
|
/**
|
|
@@ -516,8 +462,6 @@ function textCore(p5, fn) {
|
|
|
516
462
|
* @returns {Number} If no arguments are provided, the current text leading
|
|
517
463
|
*
|
|
518
464
|
* @example
|
|
519
|
-
* <div>
|
|
520
|
-
* <code>
|
|
521
465
|
* function setup() {
|
|
522
466
|
* createCanvas(100, 100);
|
|
523
467
|
*
|
|
@@ -535,8 +479,6 @@ function textCore(p5, fn) {
|
|
|
535
479
|
*
|
|
536
480
|
* describe('The words "one" and "two" written on separate lines twice. The words on the left have less vertical spacing than the words on the right.');
|
|
537
481
|
* }
|
|
538
|
-
* </code>
|
|
539
|
-
* </div>
|
|
540
482
|
*/
|
|
541
483
|
|
|
542
484
|
/**
|
|
@@ -561,8 +503,6 @@ function textCore(p5, fn) {
|
|
|
561
503
|
* @for p5
|
|
562
504
|
*
|
|
563
505
|
* @example
|
|
564
|
-
* <div>
|
|
565
|
-
* <code>
|
|
566
506
|
* function setup() {
|
|
567
507
|
* createCanvas(100, 100);
|
|
568
508
|
* background(200);
|
|
@@ -572,12 +512,8 @@ function textCore(p5, fn) {
|
|
|
572
512
|
*
|
|
573
513
|
* describe('The text "hi" written in a black, monospace font on a gray background.');
|
|
574
514
|
* }
|
|
575
|
-
* </code>
|
|
576
|
-
* </div>
|
|
577
515
|
*
|
|
578
516
|
* @example
|
|
579
|
-
* <div>
|
|
580
|
-
* <code>
|
|
581
517
|
* function setup() {
|
|
582
518
|
* createCanvas(100, 100);
|
|
583
519
|
* background('black');
|
|
@@ -588,12 +524,8 @@ function textCore(p5, fn) {
|
|
|
588
524
|
*
|
|
589
525
|
* describe('A text prompt from a game is written in a green, monospace font on a black background.');
|
|
590
526
|
* }
|
|
591
|
-
* </code>
|
|
592
|
-
* </div>
|
|
593
527
|
*
|
|
594
528
|
* @example
|
|
595
|
-
* <div>
|
|
596
|
-
* <code>
|
|
597
529
|
* function setup() {
|
|
598
530
|
* createCanvas(100, 100);
|
|
599
531
|
* background(200);
|
|
@@ -603,12 +535,8 @@ function textCore(p5, fn) {
|
|
|
603
535
|
*
|
|
604
536
|
* describe('The text "Verdana" written in a black, sans-serif font on a gray background.');
|
|
605
537
|
* }
|
|
606
|
-
* </code>
|
|
607
|
-
* </div>
|
|
608
538
|
*
|
|
609
539
|
* @example
|
|
610
|
-
* <div>
|
|
611
|
-
* <code>
|
|
612
540
|
* let fontRegular;
|
|
613
541
|
* let fontItalic;
|
|
614
542
|
* let fontBold;
|
|
@@ -629,8 +557,6 @@ function textCore(p5, fn) {
|
|
|
629
557
|
*
|
|
630
558
|
* describe('The statements "I am Normal", "I am Italic", and "I am Bold" written in black on separate lines. The statements have normal, italic, and bold fonts, respectively.');
|
|
631
559
|
* }
|
|
632
|
-
* </code>
|
|
633
|
-
* </div>
|
|
634
560
|
*/
|
|
635
561
|
|
|
636
562
|
/**
|
|
@@ -649,8 +575,6 @@ function textCore(p5, fn) {
|
|
|
649
575
|
* @returns {Number} If no arguments are provided, the current text size in pixels.
|
|
650
576
|
*
|
|
651
577
|
* @example
|
|
652
|
-
* <div>
|
|
653
|
-
* <code>
|
|
654
578
|
* function setup() {
|
|
655
579
|
* createCanvas(600, 200);
|
|
656
580
|
* background(240);
|
|
@@ -670,12 +594,8 @@ function textCore(p5, fn) {
|
|
|
670
594
|
* textSize(16);
|
|
671
595
|
* text("Current text size: " + currentSize, width / 2, height - 20);
|
|
672
596
|
* }
|
|
673
|
-
* </code>
|
|
674
|
-
* </div>
|
|
675
597
|
*
|
|
676
598
|
* @example
|
|
677
|
-
* <div>
|
|
678
|
-
* <code>
|
|
679
599
|
* function setup() {
|
|
680
600
|
* createCanvas(100, 100);
|
|
681
601
|
*
|
|
@@ -695,8 +615,6 @@ function textCore(p5, fn) {
|
|
|
695
615
|
*
|
|
696
616
|
* describe('The text "Font Size 12" drawn small, "Font Size 14" drawn medium, and "Font Size 16" drawn large.');
|
|
697
617
|
* }
|
|
698
|
-
* </code>
|
|
699
|
-
* </div>
|
|
700
618
|
*/
|
|
701
619
|
/**
|
|
702
620
|
* @method textSize
|
|
@@ -720,8 +638,6 @@ function textCore(p5, fn) {
|
|
|
720
638
|
* @returns {NORMAL|ITALIC|BOLD|BOLDITALIC} If no arguments are provided, the current style
|
|
721
639
|
*
|
|
722
640
|
* @example
|
|
723
|
-
* <div>
|
|
724
|
-
* <code>
|
|
725
641
|
* function setup() {
|
|
726
642
|
* createCanvas(100, 100);
|
|
727
643
|
*
|
|
@@ -749,8 +665,6 @@ function textCore(p5, fn) {
|
|
|
749
665
|
*
|
|
750
666
|
* describe('The words "Normal" displayed normally, "Italic" in italic, "Bold" in bold, and "Bold Italic" in bold italics.');
|
|
751
667
|
* }
|
|
752
|
-
* </code>
|
|
753
|
-
* </div>
|
|
754
668
|
*/
|
|
755
669
|
/**
|
|
756
670
|
* @method textStyle
|
|
@@ -780,8 +694,6 @@ function textCore(p5, fn) {
|
|
|
780
694
|
* @returns {Number} The width of the text
|
|
781
695
|
*
|
|
782
696
|
* @example
|
|
783
|
-
* <div>
|
|
784
|
-
* <code>
|
|
785
697
|
* function setup() {
|
|
786
698
|
* createCanvas(200, 200);
|
|
787
699
|
* background(220);
|
|
@@ -805,12 +717,8 @@ function textCore(p5, fn) {
|
|
|
805
717
|
* textSize(20);
|
|
806
718
|
* text("Text width: " + tw, 10, 150);
|
|
807
719
|
* }
|
|
808
|
-
* </code>
|
|
809
|
-
* </div>
|
|
810
720
|
*
|
|
811
721
|
* @example
|
|
812
|
-
* <div>
|
|
813
|
-
* <code>
|
|
814
722
|
* function setup() {
|
|
815
723
|
* createCanvas(100, 100);
|
|
816
724
|
*
|
|
@@ -832,12 +740,8 @@ function textCore(p5, fn) {
|
|
|
832
740
|
*
|
|
833
741
|
* describe('The word "yoyo" underlined.');
|
|
834
742
|
* }
|
|
835
|
-
* </code>
|
|
836
|
-
* </div>
|
|
837
743
|
*
|
|
838
744
|
* @example
|
|
839
|
-
* <div>
|
|
840
|
-
* <code>
|
|
841
745
|
* function setup() {
|
|
842
746
|
* createCanvas(200, 160);
|
|
843
747
|
* background(235);
|
|
@@ -874,12 +778,8 @@ function textCore(p5, fn) {
|
|
|
874
778
|
*
|
|
875
779
|
* describe('Three lines: Hello with 0, 2, and many trailing spaces. Red boxes use textWidth and are identical. Captions show spaces as dots.');
|
|
876
780
|
* }
|
|
877
|
-
* </code>
|
|
878
|
-
* </div>
|
|
879
781
|
*
|
|
880
782
|
* @example
|
|
881
|
-
* <div>
|
|
882
|
-
* <code>
|
|
883
783
|
* function setup() {
|
|
884
784
|
* createCanvas(100, 100);
|
|
885
785
|
*
|
|
@@ -902,8 +802,6 @@ function textCore(p5, fn) {
|
|
|
902
802
|
*
|
|
903
803
|
* describe('The word "yo" written twice, one copy beneath the other. The words are divided by a horizontal line.');
|
|
904
804
|
* }
|
|
905
|
-
* </code>
|
|
906
|
-
* </div>
|
|
907
805
|
*/
|
|
908
806
|
|
|
909
807
|
/**
|
|
@@ -931,8 +829,6 @@ function textCore(p5, fn) {
|
|
|
931
829
|
* @returns {CHAR|WORD} If no arguments are provided, the current wrapping style
|
|
932
830
|
*
|
|
933
831
|
* @example
|
|
934
|
-
* <div>
|
|
935
|
-
* <code>
|
|
936
832
|
* function setup() {
|
|
937
833
|
* createCanvas(100, 100);
|
|
938
834
|
*
|
|
@@ -947,12 +843,8 @@ function textCore(p5, fn) {
|
|
|
947
843
|
*
|
|
948
844
|
* describe('The text "Have a wonderful day" written across three lines.');
|
|
949
845
|
* }
|
|
950
|
-
* </code>
|
|
951
|
-
* </div>
|
|
952
846
|
*
|
|
953
847
|
* @example
|
|
954
|
-
* <div>
|
|
955
|
-
* <code>
|
|
956
848
|
* function setup() {
|
|
957
849
|
* createCanvas(100, 100);
|
|
958
850
|
*
|
|
@@ -967,12 +859,8 @@ function textCore(p5, fn) {
|
|
|
967
859
|
*
|
|
968
860
|
* describe('The text "Have a wonderful day" written across two lines.');
|
|
969
861
|
* }
|
|
970
|
-
* </code>
|
|
971
|
-
* </div>
|
|
972
862
|
*
|
|
973
863
|
* @example
|
|
974
|
-
* <div>
|
|
975
|
-
* <code>
|
|
976
864
|
* function setup() {
|
|
977
865
|
* createCanvas(100, 100);
|
|
978
866
|
*
|
|
@@ -987,8 +875,6 @@ function textCore(p5, fn) {
|
|
|
987
875
|
*
|
|
988
876
|
* describe('The text "祝你有美好的一天" written across two lines.');
|
|
989
877
|
* }
|
|
990
|
-
* </code>
|
|
991
|
-
* </div>
|
|
992
878
|
*/
|
|
993
879
|
/**
|
|
994
880
|
* @method textWrap
|
|
@@ -996,7 +882,6 @@ function textCore(p5, fn) {
|
|
|
996
882
|
* @returns {CHAR|WORD} The current wrapping style
|
|
997
883
|
*/
|
|
998
884
|
|
|
999
|
-
|
|
1000
885
|
/**
|
|
1001
886
|
* Computes the tight bounding box for a block of text.
|
|
1002
887
|
*
|
|
@@ -1021,8 +906,6 @@ function textCore(p5, fn) {
|
|
|
1021
906
|
* bounding box of the rendered text.
|
|
1022
907
|
*
|
|
1023
908
|
* @example
|
|
1024
|
-
* <div>
|
|
1025
|
-
* <code>
|
|
1026
909
|
* function setup() {
|
|
1027
910
|
* createCanvas(300, 200);
|
|
1028
911
|
* background(220);
|
|
@@ -1044,11 +927,8 @@ function textCore(p5, fn) {
|
|
|
1044
927
|
* stroke('red');
|
|
1045
928
|
* rect(bounds.x, bounds.y, bounds.w, bounds.h);
|
|
1046
929
|
* }
|
|
1047
|
-
* </code>
|
|
1048
|
-
* </div>
|
|
1049
930
|
*/
|
|
1050
931
|
|
|
1051
|
-
|
|
1052
932
|
/**
|
|
1053
933
|
* Sets or gets the text drawing direction.
|
|
1054
934
|
*
|
|
@@ -1066,8 +946,6 @@ function textCore(p5, fn) {
|
|
|
1066
946
|
* @returns {String} If no arguments are provided, the current text direction, either "ltr", "rtl", or "inherit"
|
|
1067
947
|
*
|
|
1068
948
|
* @example
|
|
1069
|
-
* <div>
|
|
1070
|
-
* <code>
|
|
1071
949
|
* function setup() {
|
|
1072
950
|
* createCanvas(300, 300);
|
|
1073
951
|
* background(240);
|
|
@@ -1091,8 +969,6 @@ function textCore(p5, fn) {
|
|
|
1091
969
|
* textAlign(LEFT, TOP);
|
|
1092
970
|
* text("Current textDirection: " + textDirection(), 50, 250);
|
|
1093
971
|
* }
|
|
1094
|
-
* </code>
|
|
1095
|
-
* </div>
|
|
1096
972
|
*/
|
|
1097
973
|
/**
|
|
1098
974
|
* @method textDirection
|
|
@@ -1121,8 +997,6 @@ function textCore(p5, fn) {
|
|
|
1121
997
|
* @returns If no arguments are provided, the current value of the specified text property
|
|
1122
998
|
*
|
|
1123
999
|
* @example
|
|
1124
|
-
* <div>
|
|
1125
|
-
* <code>
|
|
1126
1000
|
* function setup() {
|
|
1127
1001
|
* createCanvas(300, 300);
|
|
1128
1002
|
* background(240);
|
|
@@ -1147,8 +1021,6 @@ function textCore(p5, fn) {
|
|
|
1147
1021
|
* text("Current textAlign: " + currentAlign, 50, 150);
|
|
1148
1022
|
* text("Current textBaseline: " + currentBaseline, 50, 170);
|
|
1149
1023
|
* }
|
|
1150
|
-
* </code>
|
|
1151
|
-
* </div>
|
|
1152
1024
|
*/
|
|
1153
1025
|
/**
|
|
1154
1026
|
* @method textProperty
|
|
@@ -1202,8 +1074,6 @@ function textCore(p5, fn) {
|
|
|
1202
1074
|
* bounding box of the text based on the font's intrinsic metrics.
|
|
1203
1075
|
*
|
|
1204
1076
|
* @example
|
|
1205
|
-
* <div>
|
|
1206
|
-
* <code>
|
|
1207
1077
|
* function setup() {
|
|
1208
1078
|
* createCanvas(300, 200);
|
|
1209
1079
|
* background(240);
|
|
@@ -1229,11 +1099,8 @@ function textCore(p5, fn) {
|
|
|
1229
1099
|
* text("Font Bounds: x=" + bounds.x.toFixed(1) + ", y=" + bounds.y.toFixed(1) +
|
|
1230
1100
|
* ", w=" + bounds.w.toFixed(1) + ", h=" + bounds.h.toFixed(1), 8, 100);
|
|
1231
1101
|
* }
|
|
1232
|
-
* </code>
|
|
1233
|
-
* </div>
|
|
1234
1102
|
*/
|
|
1235
1103
|
|
|
1236
|
-
|
|
1237
1104
|
/**
|
|
1238
1105
|
* Returns the loose width of a text string based on the current font.
|
|
1239
1106
|
*
|
|
@@ -1251,8 +1118,6 @@ function textCore(p5, fn) {
|
|
|
1251
1118
|
* @returns {Number} The loose width of the text in pixels.
|
|
1252
1119
|
*
|
|
1253
1120
|
* @example
|
|
1254
|
-
* <div>
|
|
1255
|
-
* <code>
|
|
1256
1121
|
* function setup() {
|
|
1257
1122
|
* createCanvas(300, 200);
|
|
1258
1123
|
* background(240);
|
|
@@ -1275,11 +1140,8 @@ function textCore(p5, fn) {
|
|
|
1275
1140
|
* textSize(16);
|
|
1276
1141
|
* text("Font width: " + fw.toFixed(2) + " pixels", 50, 100);
|
|
1277
1142
|
* }
|
|
1278
|
-
* </code>
|
|
1279
|
-
* </div>
|
|
1280
1143
|
*/
|
|
1281
1144
|
|
|
1282
|
-
|
|
1283
1145
|
/**
|
|
1284
1146
|
* Returns the loose ascent of the text based on the font's intrinsic metrics.
|
|
1285
1147
|
*
|
|
@@ -1294,8 +1156,6 @@ function textCore(p5, fn) {
|
|
|
1294
1156
|
* @returns {Number} The loose ascent value in pixels.
|
|
1295
1157
|
*
|
|
1296
1158
|
* @example
|
|
1297
|
-
* <div>
|
|
1298
|
-
* <code>
|
|
1299
1159
|
* function setup() {
|
|
1300
1160
|
* createCanvas(300, 300);
|
|
1301
1161
|
* background(220);
|
|
@@ -1324,8 +1184,6 @@ function textCore(p5, fn) {
|
|
|
1324
1184
|
* textSize(16);
|
|
1325
1185
|
* text("fontAscent: " + fasc.toFixed(2) + " pixels", x, y + fdesc + 20);
|
|
1326
1186
|
* }
|
|
1327
|
-
* </code>
|
|
1328
|
-
* </div>
|
|
1329
1187
|
*/
|
|
1330
1188
|
|
|
1331
1189
|
/**
|
|
@@ -1342,8 +1200,6 @@ function textCore(p5, fn) {
|
|
|
1342
1200
|
* @returns {Number} The loose descent value in pixels.
|
|
1343
1201
|
*
|
|
1344
1202
|
* @example
|
|
1345
|
-
* <div>
|
|
1346
|
-
* <code>
|
|
1347
1203
|
* function setup() {
|
|
1348
1204
|
* createCanvas(300, 300);
|
|
1349
1205
|
* background(220);
|
|
@@ -1372,8 +1228,6 @@ function textCore(p5, fn) {
|
|
|
1372
1228
|
* textSize(16);
|
|
1373
1229
|
* text("fontDescent: " + fdesc.toFixed(2) + " pixels", x, y + fdesc + 20);
|
|
1374
1230
|
* }
|
|
1375
|
-
* </code>
|
|
1376
|
-
* </div>
|
|
1377
1231
|
*/
|
|
1378
1232
|
|
|
1379
1233
|
/**
|
|
@@ -1392,8 +1246,6 @@ function textCore(p5, fn) {
|
|
|
1392
1246
|
* @returns {Number} If no arguments are provided, the current font weight
|
|
1393
1247
|
*
|
|
1394
1248
|
* @example
|
|
1395
|
-
* <div>
|
|
1396
|
-
* <code>
|
|
1397
1249
|
* function setup() {
|
|
1398
1250
|
* createCanvas(300, 200);
|
|
1399
1251
|
* background(240);
|
|
@@ -1425,11 +1277,8 @@ function textCore(p5, fn) {
|
|
|
1425
1277
|
* text("Normal Weight: " + normalWeight, 150, 52);
|
|
1426
1278
|
* text("Bold Weight: " + boldWeight, 150, 100);
|
|
1427
1279
|
* }
|
|
1428
|
-
* </code>
|
|
1429
|
-
* </div>
|
|
1430
1280
|
*
|
|
1431
|
-
*
|
|
1432
|
-
* <code>
|
|
1281
|
+
* @example
|
|
1433
1282
|
* let font;
|
|
1434
1283
|
*
|
|
1435
1284
|
* async function setup() {
|
|
@@ -1448,8 +1297,6 @@ function textCore(p5, fn) {
|
|
|
1448
1297
|
* text('p5*js', 0, 10);
|
|
1449
1298
|
* describe('The text p5*js pulsing its weight over time');
|
|
1450
1299
|
* }
|
|
1451
|
-
* </code>
|
|
1452
|
-
* </div>
|
|
1453
1300
|
*/
|
|
1454
1301
|
/**
|
|
1455
1302
|
* @method textWeight
|