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>SetUseTTF</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="SetTTFPath.html" title="SetTTFPath" /><link rel="next" href="SetXAxisPosition.html" title="SetXAxisPosition" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetUseTTF</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetTTFPath.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetXAxisPosition.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetUseTTF"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetUseTTF</span></h2><p>SetUseTTF — Set the default font type</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetUseTTF(<em class="parameter"><code>$ttf</code></em>)</pre></div><div class="refsect1"><a id="idp1378838180"></a><h2>Description</h2><p><code class="function">SetUseTTF</code> sets the default font type to TrueType fonts orbuilt-in GD fonts, and re-initializes all font settings.</p></div><div class="refsect1"><a id="idp1378839236"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$ttf</code></em></span></dt><dd><p>True to use TrueType fonts by default, False to use built-in GD fontsby default.</p></dd></dl></div></div><div class="refsect1"><a id="idp1378840780"></a><h2>Notes</h2><p>Changing the font type re-initializes all the font settings to the PHPlotdefaults.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="literal">SetUseTTF(FALSE)</code> resets all text elements to use thebuilt-in GD fonts in the default sizes, and sets GD fonts as the default.</p></li><li class="listitem"><p><code class="literal">SetUseTTF(TRUE)</code> resets all text elements to use TrueTypefonts, in the default point sizes, but without changing the default fontname (if one was set). It sets TrueType fonts as the default.</p></li><li class="listitem"><p><code class="literal">SetDefaultTTFont(NULL)</code> or<code class="literal">SetDefaultTTFont()</code> resets all text elements to useTrueType fonts, in the default point sizes, and also erases any defaultfont name. See <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a> for details.</p></li></ul></div><p></p><p>By default, built-in GD fonts are used.</p><p>When you enable TrueType fonts with SetUseTTF, there must be a validdefault font. You can use <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a> toestablish a default font, but since this also enables TrueType fontsas the default, you need not use SetUseTTF in that case.On some platforms, PHPlot can find a valid default font on its own.See <a class="xref" href="conc-text.html#conc-text-fonts" title="3.8.3. TrueType Font Selection">Section 3.8.3, “TrueType Font Selection”</a> for more information on the defaultfont.</p><p>After enabling TrueType fonts, you can use<a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a> or <a class="xref" href="SetFontTTF.html" title="SetFontTTF"><span class="refentrytitle">SetFontTTF</span></a>to select fonts and sizes for individual text elements in the plot.You can also use <a class="xref" href="SetFontGD.html" title="SetFontGD"><span class="refentrytitle">SetFontGD</span></a> to use GD fonts for one ormore elements, overriding the default font type.</p></div><div class="refsect1"><a id="idp1378847964"></a><h2>History</h2><p>Through PHPlot-5.1.2, there was a fixed default font called<code class="filename">benjamingothic.ttf</code>, which used to be included with PHPlot,but was removed in 2006. (It was not generally suitable for plotting anyway.)As a result, you had to use <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a> to set avalid default font before enabling TrueType fonts with SetUseTTF().But since SetDefaultTTFont() itself turned on TrueType fonts, SetUseTTF() wasrarely useful.Starting with PHPlot-5.1.3, PHPlot will try a number of sans-serif fontnames, trying to find a valid font to use as the default. On platformswhere this works, SetUseTTF(True) can be used without any other font setupin order to use the default TrueType font for all text.</p><p>Through PHPlot-5.0.5, this function enabled or disabled the use of TrueTypefont text, since all text on a graph had to be either TrueType or all GD.Starting with PHPlot-5.0.6, this function selects the default font type (andstill re-initializes all fonts). Both GD and TrueType font text can now beused on a graph.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetTTFPath.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="SetXAxisPosition.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetTTFPath </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetXAxisPosition</td></tr></table></div></body></html>