| 98 |
- |
1 |
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
|
|
|
2 |
<!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>
|
|
|
3 |
<code class="function">SetUseTTF</code> sets the default font type to TrueType fonts or
|
|
|
4 |
built-in GD fonts, and re-initializes all font settings.
|
|
|
5 |
</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>
|
|
|
6 |
True to use TrueType fonts by default, False to use built-in GD fonts
|
|
|
7 |
by default.
|
|
|
8 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378840780"></a><h2>Notes</h2><p>
|
|
|
9 |
Changing the font type re-initializes all the font settings to the PHPlot
|
|
|
10 |
defaults.
|
|
|
11 |
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
|
|
|
12 |
<code class="literal">SetUseTTF(FALSE)</code> resets all text elements to use the
|
|
|
13 |
built-in GD fonts in the default sizes, and sets GD fonts as the default.
|
|
|
14 |
</p></li><li class="listitem"><p>
|
|
|
15 |
<code class="literal">SetUseTTF(TRUE)</code> resets all text elements to use TrueType
|
|
|
16 |
fonts, in the default point sizes, but without changing the default font
|
|
|
17 |
name (if one was set). It sets TrueType fonts as the default.
|
|
|
18 |
</p></li><li class="listitem"><p>
|
|
|
19 |
<code class="literal">SetDefaultTTFont(NULL)</code> or
|
|
|
20 |
<code class="literal">SetDefaultTTFont()</code> resets all text elements to use
|
|
|
21 |
TrueType fonts, in the default point sizes, and also erases any default
|
|
|
22 |
font name. See <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a> for details.
|
|
|
23 |
</p></li></ul></div><p>
|
|
|
24 |
</p><p>
|
|
|
25 |
By default, built-in GD fonts are used.
|
|
|
26 |
</p><p>
|
|
|
27 |
When you enable TrueType fonts with SetUseTTF, there must be a valid
|
|
|
28 |
default font. You can use <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a> to
|
|
|
29 |
establish a default font, but since this also enables TrueType fonts
|
|
|
30 |
as the default, you need not use SetUseTTF in that case.
|
|
|
31 |
On some platforms, PHPlot can find a valid default font on its own.
|
|
|
32 |
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 default
|
|
|
33 |
font.
|
|
|
34 |
</p><p>
|
|
|
35 |
After enabling TrueType fonts, you can use
|
|
|
36 |
<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>
|
|
|
37 |
to select fonts and sizes for individual text elements in the plot.
|
|
|
38 |
You can also use <a class="xref" href="SetFontGD.html" title="SetFontGD"><span class="refentrytitle">SetFontGD</span></a> to use GD fonts for one or
|
|
|
39 |
more elements, overriding the default font type.
|
|
|
40 |
</p></div><div class="refsect1"><a id="idp1378847964"></a><h2>History</h2><p>
|
|
|
41 |
Through PHPlot-5.1.2, there was a fixed default font called
|
|
|
42 |
<code class="filename">benjamingothic.ttf</code>, which used to be included with PHPlot,
|
|
|
43 |
but was removed in 2006. (It was not generally suitable for plotting anyway.)
|
|
|
44 |
As a result, you had to use <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a> to set a
|
|
|
45 |
valid default font before enabling TrueType fonts with SetUseTTF().
|
|
|
46 |
But since SetDefaultTTFont() itself turned on TrueType fonts, SetUseTTF() was
|
|
|
47 |
rarely useful.
|
|
|
48 |
Starting with PHPlot-5.1.3, PHPlot will try a number of sans-serif font
|
|
|
49 |
names, trying to find a valid font to use as the default. On platforms
|
|
|
50 |
where this works, SetUseTTF(True) can be used without any other font setup
|
|
|
51 |
in order to use the default TrueType font for all text.
|
|
|
52 |
</p><p>
|
|
|
53 |
Through PHPlot-5.0.5, this function enabled or disabled the use of TrueType
|
|
|
54 |
font text, since all text on a graph had to be either TrueType or all GD.
|
|
|
55 |
Starting with PHPlot-5.0.6, this function selects the default font type (and
|
|
|
56 |
still re-initializes all fonts). Both GD and TrueType font text can now be
|
|
|
57 |
used on a graph.
|
|
|
58 |
</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>
|