Tuesday, November 19, 2024
Google search engine
HomeLanguagesJavascriptp5.js Typography Complete Reference

p5.js Typography Complete Reference

p5.js Typography is used to do the draw or animation operation on the text. There are some specific attributes to do these kinds of operations and some functions to load or display the text, mentioned below.

Attributes

Description

textAlign() textAlign() function is used to set the alignment for the drawing the text.
textLeading() textAlign() function is used to set the spacing, in pixels, between lines of text.
textSize() textSize() function is used to set or return the font size of text.
textStyle() It is used to set or return the style of the text for system fonts to NORMAL, ITALIC, BOLD, or BOLDITALIC.
textWidth() textWidth() function is used to calculate the width of the text given as parameter.
textAscent() textAscent() function is used to find out the ascent of the current font at its current size.
textDescent() textDescent() function is used to find out the descent of the current font at its current size.

Loading & Displaying

Description

loadFont() loadFont() function is used to load a font from file or an URL, and return it as a PFont Object.
textFont() textFont() function is used to specify the font that will be used to draw text using the text() function.
textBounds() It returns a tight bounding box for the given string using the font it is used upon.
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments