SetFontGD
Prev | PHPlot Function Reference | Next

## SetFontGD

SetFontGD — Select a GD font to use for a plot element

## Synopsis

    $plot->SetFontGD($elem, $font, [$line_spacing])

## Description

`SetFontGD` selects a GD font to use for one plot element (for example, the title). This function supplements SetFont, which selects a GD or TTF font depending on the currently selected font type. SetFontGD always selects a GD font, even if TrueType fonts are in use.

## Parameters

`$elem`

  The name of the element to change the font for. Use one of the following strings: 'title', 'legend', 'generic', 'x_label', 'y_label', 'x_title', or 'y_title'. (The 'generic' font is currently used for pie chart percentage labels and error message images.)

`$font`

  Selects the GD font to use. This is a number between 1 and 5 which selects one of the built-in GD fonts. Font 1 is the smallest, and font 5 is the largest.

`$line_spacing`

  Optional line spacing adjustment for this text element. For GD fonts, this is the number of pixels between lines. If not specified, the value set by SetLineSpacing is used.

## Notes

See SetFont for more information about fonts. See SetLineSpacing for more information about line spacing.

Use SetUseTTF (or SetDefaultTTFont, which calls it) to set the default font type. Use SetFont to specify the font to use for an element using the default font type. Use SetFontGD and SetFontTTF to specify the font of an element using the specific type of font.

## History

This function was added at PHPlot-5.0.6, along with SetFontTTF, to allow mixing GD and TrueType fonts in the same graph.

Prev | Up | Next
SetFont | Home | SetFontTTF