Skip to content

docs(src/typography): Use describe() instead of @alt #5597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions src/typography/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import p5 from '../core/main';
* text('EFGH', 50, 50);
* textAlign(LEFT);
* text('IJKL', 50, 70);
* describe(`Letters ABCD displayed at top left, EFGH at center, and
* IJKL at bottom right.`);
* </code>
* </div>
*
Expand All @@ -62,12 +64,12 @@ import p5 from '../core/main';
* line(0, 87, width, 87);
* textAlign(CENTER, BOTTOM);
* text('BOTTOM', 0, 87, width);
*
* describe(`The names of the four vertical alignments (TOP, CENTER, BASELINE,
* and BOTTOM) rendered each showing that alignment's placement relative to a
* horizontal line.`);
* </code>
* </div>
*
* @alt
* Letters ABCD displayed at top left, EFGH at center and IJKL at bottom right.
* The names of the four vertical alignments (TOP, CENTER, BASELINE & BOTTOM) rendered each showing that alignment's placement relative to a horizontal line.
*/
/**
* @method textAlign
Expand Down Expand Up @@ -100,11 +102,11 @@ p5.prototype.textAlign = function(horizAlign, vertAlign) {
*
* textLeading(30);
* text(lines, 70, 25);
*
* describe(`A set of L1, L2, and L3, displayed vertically 3 times.
* Spacing increases for each set.`);
* </code>
* </div>
*
* @alt
* A set of L1 L2 & L3 displayed vertically 3 times. spacing increases for each set
*/
/**
* @method textLeading
Expand Down Expand Up @@ -132,11 +134,12 @@ p5.prototype.textLeading = function(theLeading) {
* text('Font Size 14', 10, 60);
* textSize(16);
* text('Font Size 16', 10, 90);
*
* describe(`'Font Size 12' displayed small,
* 'Font Size 14' medium, and
* 'Font Size 16' large`);
* </code>
* </div>
*
* @alt
* 'Font Size 12' displayed small, 'Font Size 14' medium & 'Font Size 16' large
*/
/**
* @method textSize
Expand Down Expand Up @@ -169,11 +172,12 @@ p5.prototype.textSize = function(theSize) {
* text('Font Style Bold', 10, 65);
* textStyle(BOLDITALIC);
* text('Font Style Bold Italic', 10, 90);
* describe(`The words “Font Style Normal” displayed normally,
* “Font Style Italic” in italic,
* “Font Style Bold” in bold, and
* “Font Style Bold Italic” in bold italics.`);
* </code>
* </div>
*
* @alt
* Words Font Style Normal displayed normally, Italic in italic, bold in bold and bold italic in bold italics.
*/
/**
* @method textStyle
Expand Down Expand Up @@ -204,11 +208,10 @@ p5.prototype.textStyle = function(theStyle) {
* let sWidth = textWidth(aString);
* text(aString, 0, 85);
* line(sWidth, 50, sWidth, 100);
*
* describe(`Letter P and p5.js are displayed with vertical lines at end.`);
* </code>
* </div>
*
* @alt
* Letter P and p5.js are displayed with vertical lines at end.
*/
p5.prototype.textWidth = function(...args) {
args[0] += '';
Expand Down
6 changes: 3 additions & 3 deletions src/typography/p5.Font.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ p5.Font = function(p) {
* textFont(font);
* textSize(12);
* text(textString, 10, 30);
*
* describe(`Words “Lorem ipsum dol” go off canvas and
* contained by white bounding box`);
* }
* </code>
* </div>
*
* @alt
*words Lorem ipsum dol go off canvas and contained by white bounding box
*/
p5.Font.prototype.textBounds = function(str, x = 0, y = 0, fontSize, opts) {
// Check cache for existing bounds. Take into consideration the text alignment
Expand Down