SetDefaultTTFont
Prev | PHPlot Function Reference | Next

## SetDefaultTTFont

SetDefaultTTFont — Set the default TrueType font

## Synopsis

    $plot->SetDefaultTTFont($font)

## Description

`SetDefaultTTFont` sets the default TrueType font, resets all text elements to use that font, and makes TrueType fonts the default font type.

## Parameters

`$font`

  Name of the TrueType font file to use as default. Specify either a filename in the default TrueType font directory (or one that can be found by GD using its own rules), or the full pathname to a font file.

## Notes

This function selects TrueType fonts as the default font type as if SetUseTTF(True) was called.

The supplied font name is first checked as given. If that does not work, it is checked prefixed with the default TrueType font directory as set with SetTTFPath. If that does not work either, a fatal error results. See Section 3.8.2, “TrueType Font Selection” for more information.

This function resets all elements to use the named font and default sizes, so it undoes all prior SetFont, SetFontGD, and SetFontTTF calls.

Change the font used by individual text elements with SetFont, SetFontGD, and SetFontTTF after using SetDefaultTTFont.

## History

Starting with PHPlot-5.1.3, TrueType fonts are validated using GD. This allows GD to apply its own rules to try to locate a font file. On at least some platforms, this allows fonts to be specified by filename only, without having to set the PHPlot default font directory. (Through PHPlot-5.1.2, the existence of the font file was checked, which did not allow GD to try to find the font using its own rules.)

Through PHPlot-5.0.5, setting a default TrueType font with this function also forced all text on the graph to use TrueType text. Starting with PHPlot-5.0.6, it just sets the default font type. Set SetUseTTF for more information on this change.

This behavior of this function was changed significantly at PHPlot-5.0rc3.

Prev | Up | Next
SetDefaultDashedStyle | Home | SetDrawBrokenLines