You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/type/p5.Font.js
+11-13Lines changed: 11 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -858,8 +858,7 @@ function font(p5, fn) {
858
858
*
859
859
* In 2D mode, `path` can take on a few other forms. It could be a path to a CSS file,
860
860
* such as one from <a href="https://fonts.google.com/">Google Fonts.</a> It could also
861
-
* be a string with a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face">CSS `@font-face` declaration.</a> It can also be an object containing key-value pairs with
862
-
* properties that you would find in an `@font-face` block.
861
+
* be a string with a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face">CSS `@font-face` declaration.</a>
863
862
*
864
863
* The second parameter, `successCallback`, is optional. If a function is
865
864
* passed, it will be called once the font has loaded. The callback function
@@ -876,8 +875,10 @@ function font(p5, fn) {
876
875
*
877
876
* @method loadFont
878
877
* @for p5
879
-
* @param {String|Object} path path of the font to be loaded, a CSS `@font-face` string, or an object with font face properties.
878
+
* @param {String} path path of the font or CSS file to be loaded, or a CSS `@font-face` string.
880
879
* @param {String} [name] An alias that can be used for this font in `textFont()`. Defaults to the name in the font's metadata.
880
+
* @param {Object} [options] An optional object with extra CSS font face descriptors, or p5.js font settings.
881
+
* @param {Number} [options.index] An optional index specifying which font from a CSS file to use. Defaults to the last one in the file.
881
882
* @param {Function} [successCallback] function called with the
0 commit comments