From a28ad4e2914acbffa9ade1a1d861e438dbb48cc5 Mon Sep 17 00:00:00 2001 From: Nick McIntyre Date: Tue, 24 Oct 2023 14:43:20 -0500 Subject: [PATCH] Add example for p5.Font --- src/typography/p5.Font.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/typography/p5.Font.js b/src/typography/p5.Font.js index 98ee4e98a4..c827964a82 100644 --- a/src/typography/p5.Font.js +++ b/src/typography/p5.Font.js @@ -15,6 +15,26 @@ import * as constants from '../core/constants'; * @class p5.Font * @constructor * @param {p5} [pInst] pointer to p5 instance. + * @example + *
+ * + * let font; + * + * function preload() { + * // Creates a p5.Font object. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
*/ p5.Font = class { constructor(p){