SetLineSpacing — Set spacing between lines of multi-line text elements
$plot->SetLineSpacing($spc
)
SetLineSpacing
sets the default spacing between lines
of a multi-line text element. Multiple lines can be specified in titles,
for example, by placing a newline between lines (for example: "Line 1\nLine
2"). Line spacing also affects the legend.
You can override the default line spacing for individual text elements
(such as the X title) using SetFont,
SetFontGD, and SetFontTTF.
$spc
Desired default line spacing factor. For the built-in GD fonts, this is the number of pixels between lines. For TrueType fonts, this is an adjustment factor for the font's built-in line spacing (see notes).
The default line spacing value is 4. For GD fonts, this is the number of pixels between text lines, and is independent of the font size.
TrueType fonts have a built-in line spacing amount, which is the distance between the baseline of one text line and the top of the next text line. With TrueType text, PHPlot uses the line spacing value (set with SetLineSpacing or one of the SetFont functions) as an adjustment factor for this built-in line spacing. A value of 4 produces the built-in line spacing, lower values reduce the spacing and larger values increase the spacing. A value of 0 for line spacing would result in the baseline of one line nearly touching the top of the next line.
The interpretation of the line spacing as an adjustment factor for TrueType text, rather than a value in pixels, began with PHPlot-5.0.6. This is also when the line spacing could be adjusted for each text element.
At PHPlot-5.0.5, line spacing was the number of pixels between lines of text, for both GD or TrueType fonts. Before PHPlot-5.0.5, line spacing did not affect TrueType font text at all, except in the legend.
Before PHPlot-5.0.5, the line spacing had to be set before setting titles, because the title height was calculated when setting the title. This restriction was removed in PHPlot-5.0.5, so line spacing and titles can be set in either order.
This version of the manual was produced for the
PHPlot Sourceforge project web service site, which requires the logo on each
page.
To download a logo-free copy of the manual, see the
PHPlot project downloads
area.