Skip to content

Commit 004d7f2

Browse files
authored
Merge pull request #5597 from Zearin/issue-5139/typography
docs(src/typography): Use `describe()` instead of `@alt`
2 parents a852280 + 8f6e58a commit 004d7f2

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

src/typography/attributes.js

+19-16
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import p5 from '../core/main';
3939
* text('EFGH', 50, 50);
4040
* textAlign(LEFT);
4141
* text('IJKL', 50, 70);
42+
* describe(`Letters ABCD displayed at top left, EFGH at center, and
43+
* IJKL at bottom right.`);
4244
* </code>
4345
* </div>
4446
*
@@ -62,12 +64,12 @@ import p5 from '../core/main';
6264
* line(0, 87, width, 87);
6365
* textAlign(CENTER, BOTTOM);
6466
* text('BOTTOM', 0, 87, width);
67+
*
68+
* describe(`The names of the four vertical alignments (TOP, CENTER, BASELINE,
69+
* and BOTTOM) rendered each showing that alignment's placement relative to a
70+
* horizontal line.`);
6571
* </code>
6672
* </div>
67-
*
68-
* @alt
69-
* Letters ABCD displayed at top left, EFGH at center and IJKL at bottom right.
70-
* The names of the four vertical alignments (TOP, CENTER, BASELINE & BOTTOM) rendered each showing that alignment's placement relative to a horizontal line.
7173
*/
7274
/**
7375
* @method textAlign
@@ -100,11 +102,11 @@ p5.prototype.textAlign = function(horizAlign, vertAlign) {
100102
*
101103
* textLeading(30);
102104
* text(lines, 70, 25);
105+
*
106+
* describe(`A set of L1, L2, and L3, displayed vertically 3 times.
107+
* Spacing increases for each set.`);
103108
* </code>
104109
* </div>
105-
*
106-
* @alt
107-
* A set of L1 L2 & L3 displayed vertically 3 times. spacing increases for each set
108110
*/
109111
/**
110112
* @method textLeading
@@ -132,11 +134,12 @@ p5.prototype.textLeading = function(theLeading) {
132134
* text('Font Size 14', 10, 60);
133135
* textSize(16);
134136
* text('Font Size 16', 10, 90);
137+
*
138+
* describe(`'Font Size 12' displayed small,
139+
* 'Font Size 14' medium, and
140+
* 'Font Size 16' large`);
135141
* </code>
136142
* </div>
137-
*
138-
* @alt
139-
* 'Font Size 12' displayed small, 'Font Size 14' medium & 'Font Size 16' large
140143
*/
141144
/**
142145
* @method textSize
@@ -169,11 +172,12 @@ p5.prototype.textSize = function(theSize) {
169172
* text('Font Style Bold', 10, 65);
170173
* textStyle(BOLDITALIC);
171174
* text('Font Style Bold Italic', 10, 90);
175+
* describe(`The words “Font Style Normal” displayed normally,
176+
* “Font Style Italic” in italic,
177+
* “Font Style Bold” in bold, and
178+
* “Font Style Bold Italic” in bold italics.`);
172179
* </code>
173180
* </div>
174-
*
175-
* @alt
176-
* Words Font Style Normal displayed normally, Italic in italic, bold in bold and bold italic in bold italics.
177181
*/
178182
/**
179183
* @method textStyle
@@ -204,11 +208,10 @@ p5.prototype.textStyle = function(theStyle) {
204208
* let sWidth = textWidth(aString);
205209
* text(aString, 0, 85);
206210
* line(sWidth, 50, sWidth, 100);
211+
*
212+
* describe(`Letter P and p5.js are displayed with vertical lines at end.`);
207213
* </code>
208214
* </div>
209-
*
210-
* @alt
211-
* Letter P and p5.js are displayed with vertical lines at end.
212215
*/
213216
p5.prototype.textWidth = function(...args) {
214217
args[0] += '';

src/typography/p5.Font.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ p5.Font = function(p) {
6464
* textFont(font);
6565
* textSize(12);
6666
* text(textString, 10, 30);
67+
*
68+
* describe(`Words “Lorem ipsum dol” go off canvas and
69+
* contained by white bounding box`);
6770
* }
6871
* </code>
6972
* </div>
70-
*
71-
* @alt
72-
*words Lorem ipsum dol go off canvas and contained by white bounding box
7373
*/
7474
p5.Font.prototype.textBounds = function(str, x = 0, y = 0, fontSize, opts) {
7575
// Check cache for existing bounds. Take into consideration the text alignment

0 commit comments

Comments
 (0)