Skip to content

Commit 02c7eb1

Browse files
committed
adding note about textFont return type closes #4926
1 parent 7fda84a commit 02c7eb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/typography/loading_displaying.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,14 @@ p5.prototype.text = function(str, x, y, maxWidth, maxHeight) {
228228

229229
/**
230230
* Sets the current font that will be drawn with the <a href="#/p5/text">text()</a> function.
231+
* If textFont() is called without any argument, it will return the current font if one has
232+
* been loaded already. If not, it will return the name of the default font as a string.
233+
* If textFont() is called with a font to load, it will return the p5 object.
231234
*
232235
* <b>WEBGL</b>: Only fonts loaded via <a href="#/p5/loadFont">loadFont()</a> are supported.
233236
*
234237
* @method textFont
235-
* @return {Object} the current font
238+
* @return {Object} the current font / p5 Object
236239
*
237240
* @example
238241
* <div>

0 commit comments

Comments
 (0)