Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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>SetDefaultTTFont</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="SetDefaultDashedStyle.html" title="SetDefaultDashedStyle" /><link rel="next" href="SetDrawBrokenLines.html" title="SetDrawBrokenLines" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetDefaultTTFont</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetDefaultDashedStyle.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetDrawBrokenLines.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetDefaultTTFont"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetDefaultTTFont</span></h2><p>SetDefaultTTFont &#8212; Set the default TrueType font</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot-&gt;SetDefaultTTFont([<span class="optional"><em class="parameter"><code>$font</code></em></span>])</pre></div><div class="refsect1"><a id="idp1377936204"></a><h2>Description</h2><p>
3
<code class="function">SetDefaultTTFont</code> sets the default TrueType font,
4
resets all text elements to use that font, and makes TrueType fonts the
5
default font type.
6
    </p></div><div class="refsect1"><a id="idp1377937284"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$font</code></em></span></dt><dd><p>
7
Name of the TrueType font file to use as default. Specify either a
8
filename in the default TrueType font directory (or one that can be
9
found by GD using its own rules), or the full pathname to a font file.
10
If this parameter is omitted or NULL, the default TrueType font is cleared.
11
          </p></dd></dl></div></div><div class="refsect1"><a id="idp1377939028"></a><h2>Notes</h2><p>
12
This function selects TrueType fonts as the default font type as if
13
<a class="xref" href="SetUseTTF.html" title="SetUseTTF"><span class="refentrytitle">SetUseTTF</span></a>(True) was called.
14
    </p><p>
15
The supplied font name is first checked as given. If that does not work,
16
it is checked prefixed with the default TrueType font directory as set
17
with <a class="xref" href="SetTTFPath.html" title="SetTTFPath"><span class="refentrytitle">SetTTFPath</span></a>.
18
If that does not work either, a fatal error results.
19
See <a class="xref" href="conc-text.html#conc-text-fonts" title="3.8.3. TrueType Font Selection">Section 3.8.3, &#8220;TrueType Font Selection&#8221;</a> for more information.
20
    </p><p>
21
This function resets all elements to use the named font and default sizes,
22
so it undoes all prior
23
<a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a>, <a class="xref" href="SetFontGD.html" title="SetFontGD"><span class="refentrytitle">SetFontGD</span></a>,
24
and <a class="xref" href="SetFontTTF.html" title="SetFontTTF"><span class="refentrytitle">SetFontTTF</span></a> calls.
25
    </p><p>
26
Change the font used by individual text elements with
27
<a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a>, <a class="xref" href="SetFontGD.html" title="SetFontGD"><span class="refentrytitle">SetFontGD</span></a>,
28
and <a class="xref" href="SetFontTTF.html" title="SetFontTTF"><span class="refentrytitle">SetFontTTF</span></a> after using SetDefaultTTFont.
29
    </p><p>
30
Using <code class="literal">SetDefaultTTFont(NULL)</code> or
31
<code class="literal">SetDefaultTTFont()</code> will erase the default font, then
32
set TrueType fonts as the default font type and reset all fonts. This will
33
immediately result in PHPlot using its default algorithm to locate a usable
34
TrueType font. On systems where PHPlot is unable to locate a TrueType font
35
without help, <code class="literal">SetDefaultTTFont([NULL])</code> will fail, although
36
using <a class="xref" href="SetTTFPath.html" title="SetTTFPath"><span class="refentrytitle">SetTTFPath</span></a> first may help.
37
    </p></div><div class="refsect1"><a id="idp1377945764"></a><h2>History</h2><p>
38
Starting in PHPlot-6.0.0, the argument can be omitted and defaults to NULL,
39
which clears the default font. In previous versions, the argument was required.
40
    </p><p>
41
Starting with PHPlot-5.1.3, TrueType fonts are validated using GD.
42
This allows GD to apply its own rules to try to locate a font file. On at
43
least some platforms, this allows fonts to be specified by filename only,
44
without having to set the PHPlot default font directory.
45
(Through PHPlot-5.1.2, the existence of the font file was checked, which
46
did not allow GD to try to find the font using its own rules.)
47
    </p><p>
48
Through PHPlot-5.0.5, setting a default TrueType font with this function
49
also forced all text on the graph to use TrueType text.
50
Starting with PHPlot-5.0.6, it just sets the default font type.
51
Set <a class="xref" href="SetUseTTF.html" title="SetUseTTF"><span class="refentrytitle">SetUseTTF</span></a> for more information on this change.
52
    </p><p>
53
This behavior of this function was changed significantly at PHPlot-5.0rc3.
54
    </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetDefaultDashedStyle.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="SetDrawBrokenLines.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetDefaultDashedStyle </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetDrawBrokenLines</td></tr></table></div></body></html>