Skip to content

Commit

Permalink
Add example for p5.Font
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmcintyre committed Oct 24, 2023
1 parent 872594f commit a28ad4e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/typography/p5.Font.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ import * as constants from '../core/constants';
* @class p5.Font
* @constructor
* @param {p5} [pInst] pointer to p5 instance.
* @example
* <div>
* <code>
* 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.');
* }
* </code>
* </div>
*/
p5.Font = class {
constructor(p){
Expand Down

0 comments on commit a28ad4e

Please sign in to comment.