| 1 |
lars |
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
2 |
<html>
|
|
|
3 |
<head>
|
|
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
|
5 |
<title>AddFont</title>
|
|
|
6 |
<link type="text/css" rel="stylesheet" href="../fpdf.css">
|
|
|
7 |
</head>
|
|
|
8 |
<body>
|
|
|
9 |
<h1>AddFont</h1>
|
|
|
10 |
<code>AddFont(<b>string</b> family [, <b>string</b> style [, <b>string</b> file]])</code>
|
|
|
11 |
<h2>Description</h2>
|
|
|
12 |
Imports a TrueType or Type1 font and makes it available. It is necessary to generate a font
|
|
|
13 |
definition file first with the makefont.php utility.
|
|
|
14 |
<br>
|
|
|
15 |
The definition file (and the font file itself when embedding) must be present in the font directory.
|
|
|
16 |
If it is not found, the error "Could not include font definition file" is generated.
|
|
|
17 |
<h2>Parameters</h2>
|
|
|
18 |
<dl class="param">
|
|
|
19 |
<dt><code>family</code></dt>
|
|
|
20 |
<dd>
|
|
|
21 |
Font family. The name can be chosen arbitrarily. If it is a standard family name, it will
|
|
|
22 |
override the corresponding font.
|
|
|
23 |
</dd>
|
|
|
24 |
<dt><code>style</code></dt>
|
|
|
25 |
<dd>
|
|
|
26 |
Font style. Possible values are (case insensitive):
|
|
|
27 |
<ul>
|
|
|
28 |
<li>empty string: regular</li>
|
|
|
29 |
<li><code>B</code>: bold</li>
|
|
|
30 |
<li><code>I</code>: italic</li>
|
|
|
31 |
<li><code>BI</code> or <code>IB</code>: bold italic</li>
|
|
|
32 |
</ul>
|
|
|
33 |
The default value is regular.
|
|
|
34 |
</dd>
|
|
|
35 |
<dt><code>file</code></dt>
|
|
|
36 |
<dd>
|
|
|
37 |
The font definition file.
|
|
|
38 |
<br>
|
|
|
39 |
By default, the name is built from the family and style, in lower case with no space.
|
|
|
40 |
</dd>
|
|
|
41 |
</dl>
|
|
|
42 |
<h2>Example</h2>
|
|
|
43 |
<div class="doc-source">
|
|
|
44 |
<pre><code>$pdf->AddFont('Comic','I');</code></pre>
|
|
|
45 |
</div>
|
|
|
46 |
is equivalent to:
|
|
|
47 |
<div class="doc-source">
|
|
|
48 |
<pre><code>$pdf->AddFont('Comic','I','comici.php');</code></pre>
|
|
|
49 |
</div>
|
|
|
50 |
<h2>See also</h2>
|
|
|
51 |
<a href="setfont.htm">SetFont()</a>.
|
|
|
52 |
<hr style="margin-top:1.5em">
|
|
|
53 |
<div style="text-align:center"><a href="index.htm">Index</a></div>
|
|
|
54 |
</body>
|
|
|
55 |
</html>
|