SetTTFPath

SetTTFPath — Set the default TrueType font directory

Synopsis

$plot->SetTTFPath($path)

Description

SetTTFPath sets the directory where SetFont and SetFontTTF can find TrueType font files.

Parameters

$path

Full path to a directory containing TrueType fonts.

Notes

The default TrueType font directory is '.', meaning fonts will be loaded from the directory containing your main PHP script. PHPlot also attempts to load fonts without any path, which allows GD to try to locate the font using its own internal rules. This works on some platforms, but not on others.

SetTTFPath does not enable the use of TrueType fonts. See the note at the end of the reference for SetUseTTF on how to set up and use TrueType fonts.

The default TrueType font directory is also used to find an internally-set default font. This means that if you use SetTTFPath, but do not specify a font name (with SetDefaultTTFont, SetFont, or SetFontTTF), PHPlot will attempt to select a default font from its internal list, but using the directory you specify with SetTTFPath. This can be useful on platforms where you are willing to use a default font, but the internal GD rules on how to locate fonts do not work.

See Section 3.8.3, “TrueType Font Selection” for more information.

History

Use of the default TrueType font directory to locate the initial, default font was implemented in PHPlot-5.1.3. Also with this release, fonts are first searched for without a path, which allows GD to try to locate the font using its internal rules.

Starting with PHPlot-5.0rc3, the default TrueType font directory is used both for the default font set with SetDefaultTTFont and for fonts set with SetFont. Refer to those two functions for details.

SourceForge.net Logo

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.