Blame | Last modification | View Log | RSS feed
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>SetFontGD</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="reference.html" title="PHPlot Function Reference" /><link rel="prev" href="SetFont.html" title="SetFont" /><link rel="next" href="SetFontTTF.html" title="SetFontTTF" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetFontGD</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetFont.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetFontTTF.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetFontGD"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetFontGD</span></h2><p>SetFontGD — Select a GD font to use for a plot element</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetFontGD(<em class="parameter"><code>$elem</code></em>, <em class="parameter"><code>$font</code></em>, [<span class="optional"><em class="parameter"><code>$line_spacing</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378135236"></a><h2>Description</h2><p><code class="function">SetFontGD</code> selects a GD font to use for one plotelement (for example, the title).This function supplements <a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a>, which selects a GD or TTFfont depending on the currently selected font type. SetFontGD always selectsa GD font, even if TrueType fonts are in use.</p></div><div class="refsect1"><a id="idp1378136772"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$elem</code></em></span></dt><dd><p>The name of the element to change the font for. Use one of the followingstrings: 'title', 'legend', 'generic', 'x_label', 'y_label', 'x_title',or 'y_title'.</p></dd><dt><span class="term"><em class="replaceable"><code>$font</code></em></span></dt><dd><p>Selects the GD font to use. This is a number between 1 and 5 which selectsone of the built-in GD fonts.Font 1 is the smallest, and font 5 is the largest.</p></dd><dt><span class="term"><em class="replaceable"><code>$line_spacing</code></em></span></dt><dd><p>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 <a class="xref" href="SetLineSpacing.html" title="SetLineSpacing"><span class="refentrytitle">SetLineSpacing</span></a> is used.</p></dd></dl></div></div><div class="refsect1"><a id="idp1378140804"></a><h2>Notes</h2><p>See <a class="xref" href="conc-text.html" title="3.8. Text Fonts">Section 3.8, “Text Fonts”</a>,<a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a> for more information about fonts, and<a class="xref" href="SetLineSpacing.html" title="SetLineSpacing"><span class="refentrytitle">SetLineSpacing</span></a> for more information about line spacing.</p><p>The <code class="literal">generic</code> font is used for pie chart segment labels,message image text (see <a class="xref" href="DrawMessage.html" title="DrawMessage"><span class="refentrytitle">DrawMessage</span></a>), error image text,and can be used from callbacks (see <a class="xref" href="callbacks.html#callbacks-drawing" title="4.4.5. Using Callbacks to Annotate Plots">Section 4.4.5, “Using Callbacks to Annotate Plots”</a>).However, changing this font has no effect on error image text, because thePHPlot error handler resets the font to the default before displaying the error.</p><p>Use <a class="xref" href="SetUseTTF.html" title="SetUseTTF"><span class="refentrytitle">SetUseTTF</span></a>(or <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a>, which calls it) to set the defaultfont type.Use <a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a> to specify the font to use for an elementusing the default font type.Use SetFontGD and <a class="xref" href="SetFontTTF.html" title="SetFontTTF"><span class="refentrytitle">SetFontTTF</span></a> tospecify the font of an element using the specific type of font.</p></div><div class="refsect1"><a id="idp1378145764"></a><h2>History</h2><p>This function was added at PHPlot-5.0.6, along with <a class="xref" href="SetFontTTF.html" title="SetFontTTF"><span class="refentrytitle">SetFontTTF</span></a>,to allow mixing GD and TrueType fonts in the same graph.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetFont.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="SetFontTTF.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetFont </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetFontTTF</td></tr></table></div></body></html>