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>SetFontTTF</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="SetFontGD.html" title="SetFontGD" /><link rel="next" href="SetGridColor.html" title="SetGridColor" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetFontTTF</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetFontGD.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetGridColor.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetFontTTF"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetFontTTF</span></h2><p>SetFontTTF — Select a TrueType font to use for a plot element</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetFontTTF(<em class="parameter"><code>$elem</code></em>, <em class="parameter"><code>$font</code></em>, [<span class="optional"><em class="parameter"><code>$size</code></em></span>], [<span class="optional"><em class="parameter"><code>$line_spacing</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378150356"></a><h2>Description</h2><p>
|
|
|
3 |
<code class="function">SetFontTTF</code> selects a TrueType font and size to use for one
|
|
|
4 |
plot element (for example, the title).
|
|
|
5 |
This function supplements <a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a>, which selects a GD or TTF
|
|
|
6 |
font depending on the currently selected font type. SetFontTTF always selects
|
|
|
7 |
a TrueType font, even if TrueType fonts are not the default font type.
|
|
|
8 |
</p></div><div class="refsect1"><a id="idp1378151940"></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>
|
|
|
9 |
The name of the element to change the font for. Use one of the following
|
|
|
10 |
strings: 'title', 'legend', 'generic', 'x_label', 'y_label', 'x_title',
|
|
|
11 |
or 'y_title'.
|
|
|
12 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$font</code></em></span></dt><dd><p>
|
|
|
13 |
Selects the TrueType font to use.
|
|
|
14 |
This is either the full pathname of a TrueType font filename,
|
|
|
15 |
or the filename (without path) if the font file is either located in the
|
|
|
16 |
default TrueType font directory set with <a class="xref" href="SetTTFPath.html" title="SetTTFPath"><span class="refentrytitle">SetTTFPath</span></a>
|
|
|
17 |
or can be found by GD using its default search rules.
|
|
|
18 |
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.
|
|
|
19 |
An empty string or NULL can be specified to use the default TrueType font.
|
|
|
20 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$size</code></em></span></dt><dd><p>
|
|
|
21 |
The TrueType font size in points.
|
|
|
22 |
If not specified, a default value of 12 is used.
|
|
|
23 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$line_spacing</code></em></span></dt><dd><p>
|
|
|
24 |
Optional line spacing adjustment for this text element.
|
|
|
25 |
For TrueType text, this is an adjustment factor for the built-in font
|
|
|
26 |
spacing.
|
|
|
27 |
See <a class="xref" href="SetLineSpacing.html" title="SetLineSpacing"><span class="refentrytitle">SetLineSpacing</span></a> for details.
|
|
|
28 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378157796"></a><h2>Notes</h2><p>
|
|
|
29 |
See <a class="xref" href="conc-text.html" title="3.8. Text Fonts">Section 3.8, “Text Fonts”</a>,
|
|
|
30 |
<a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a> for more information about fonts, and
|
|
|
31 |
<a class="xref" href="SetLineSpacing.html" title="SetLineSpacing"><span class="refentrytitle">SetLineSpacing</span></a> for more information about line spacing.
|
|
|
32 |
</p><p>
|
|
|
33 |
The <code class="literal">generic</code> font is used for pie chart segment labels,
|
|
|
34 |
message image text (see <a class="xref" href="DrawMessage.html" title="DrawMessage"><span class="refentrytitle">DrawMessage</span></a>), error image text,
|
|
|
35 |
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>).
|
|
|
36 |
However, changing this font has no effect on error image text, because the
|
|
|
37 |
PHPlot error handler resets the font to the default before displaying the error.
|
|
|
38 |
</p><p>
|
|
|
39 |
Use <a class="xref" href="SetUseTTF.html" title="SetUseTTF"><span class="refentrytitle">SetUseTTF</span></a>
|
|
|
40 |
(or <a class="xref" href="SetDefaultTTFont.html" title="SetDefaultTTFont"><span class="refentrytitle">SetDefaultTTFont</span></a>, which calls it) to set the default
|
|
|
41 |
font type.
|
|
|
42 |
Use <a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a> to specify the font to use for an element
|
|
|
43 |
using the default font type.
|
|
|
44 |
Use <a class="xref" href="SetFontGD.html" title="SetFontGD"><span class="refentrytitle">SetFontGD</span></a> and SetFontTTF to
|
|
|
45 |
specify the font of an element using the specific type of font.
|
|
|
46 |
</p></div><div class="refsect1"><a id="idp1378162764"></a><h2>History</h2><p>
|
|
|
47 |
Starting with PHPlot-5.1.3, TrueType fonts are validated by trying to
|
|
|
48 |
use the font with a non-drawing operation, rather than by seeing if the
|
|
|
49 |
font file exists.
|
|
|
50 |
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.
|
|
|
51 |
</p><p>
|
|
|
52 |
This function was added at PHPlot-5.0.6, along with <a class="xref" href="SetFontGD.html" title="SetFontGD"><span class="refentrytitle">SetFontGD</span></a>,
|
|
|
53 |
to allow mixing GD and TrueType fonts in the same graph.
|
|
|
54 |
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetFontGD.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="SetGridColor.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetFontGD </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetGridColor</td></tr></table></div></body></html>
|