This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name | ### textLeading()
Examples |
    // Text to display. The "\n" is a "new line" character
    String lines = "L1\nL2\nL3";
    textSize(12);
    fill(0);  // Set fill to black

    textLeading(10);  // Set leading to 10
    text(lines, 10, 25);

    textLeading(20);  // Set leading to 20
    text(lines, 40, 25);

    textLeading(30);  // Set leading to 30
    text(lines, 70, 25);
Description | Sets the spacing between lines of text in units of pixels. This setting will be used in all subsequent calls to the text() function. Note, however, that the leading is reset by textSize(). For example, if the leading is set to 20 with textLeading(20), then if textSize(48) is run at a later point, the leading will be reset to the default for the text size of 48.
Syntax |
    textLeading(leading)
Parameters |
leading | float: the size in pixels for spacing between lines
Returns | void
Related | loadFont() text() textFont()

Updated on May 19, 2014 05:30:01pm PDT