Skip to content

Commit c35445c

Browse files
authored
Merge pull request #8115 from Nitin2332/typography-error-message-fix
typography error message fixes
2 parents 57d8b3a + 1065155 commit c35445c

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

docs/parameterData.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,8 @@
20172017
[
20182018
"LEFT|CENTER|RIGHT",
20192019
"TOP|BOTTOM|CENTER|BASELINE?"
2020-
]
2020+
],
2021+
[]
20212022
]
20222023
},
20232024
"textAscent": {
@@ -2038,15 +2039,17 @@
20382039
"overloads": [
20392040
[
20402041
"Number"
2041-
]
2042+
],
2043+
[]
20422044
]
20432045
},
20442046
"textFont": {
20452047
"overloads": [
20462048
[
20472049
"p5.Font|String|Object",
20482050
"Number?"
2049-
]
2051+
],
2052+
[]
20502053
]
20512054
},
20522055
"textSize": {

src/type/textCore.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,13 @@ function textCore(p5, fn) {
224224
* accepts the following values for `vertAlign`: `TOP`, `BOTTOM`, `CENTER`,
225225
* or `BASELINE`.
226226
*
227+
* Calling `textAlign()` without arguments returns the current alignment settings.
228+
*
227229
* @method textAlign
228230
* @for p5
229-
* @param {LEFT|CENTER|RIGHT} horizAlign horizontal alignment
231+
* @param {LEFT|CENTER|RIGHT} [horizAlign] horizontal alignment
230232
* @param {TOP|BOTTOM|CENTER|BASELINE} [vertAlign] vertical alignment
233+
* @returns {Object} If no arguments are provided, returns an object with current horizontal and vertical alignment
231234
* @example
232235
* <div>
233236
* <code>
@@ -537,12 +540,15 @@ function textCore(p5, fn) {
537540
* The second parameter, `size`, is optional. It sets the font size in pixels.
538541
* This has the same effect as calling <a href="#/p5/textSize">textSize()</a>.
539542
*
543+
* Calling `textFont()` without arguments returns the current font.
544+
*
540545
* Note: `WEBGL` mode only supports fonts loaded with
541546
* <a href="#/p5/loadFont">loadFont()</a>.
542547
*
543548
* @method textFont
544-
* @param {p5.Font|String|Object} font The font to apply
549+
* @param {p5.Font|String|Object} [font] The font to apply
545550
* @param {Number} [size] An optional text size to apply.
551+
* @returns {String|p5.Font} If no arguments are provided, returns the current font
546552
* @for p5
547553
*
548554
* @example

0 commit comments

Comments
 (0)