| Name | textSize() |
||
|---|---|---|---|
| Processing.js Behavior | Font support for the Canvas element varies across browsers. FireFox currently has the best support, but still uses a pre-defined set of fonts. (Documentation to follow soon.) Good alternatives to the browser's Canvas-font functions are available: such as the Glyph method. See also: Canvas Text, BurntToys Bauhaus.
Please use the following demos to learn how fonts can be rendered in Firefox with Processing.js: Letters, Words, width() |
||
| Examples | ![]() PFont font;
// The font must be located in the sketch's
// "data" directory to load successfully
font = loadFont("FFScala.ttf");
textFont(font, 32);
text("word", 15, 50);
textSize(14);
text("word", 15, 70); |
||
| Description | Sets the current font size. This size will be used in all subsequent calls to the text() function. Font size is measured in units of pixels. |
||
| Syntax | textSize(size) |
||
| Parameters |
|
||
| Returns | None | ||
| Usage | Web & Application | ||
| Related |
loadFont() PFont text() textFont() |