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 a full pathname to the font file.

Notes

If given a filename, rather than a full path, the function expects to find the font file in the default TrueType font directory as set with SetTTFPath. This function selects TrueType fonts as the default font type as if SetUseTTF(True) was called.

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

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 function was changed at PHPlot-5.0rc3 to work as described above. We are not quite sure how it worked before.