11<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
22< html >
33< head >
4- < meta http-equiv ="Content-Type " content ="text/html; charset=ISO-8859-1 ">
4+ < meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 ">
55< title > AddFont</ title >
66< link type ="text/css " rel ="stylesheet " href ="../fpdf.css ">
77</ head >
88< body >
99< h1 > AddFont</ h1 >
10- < code > AddFont(< b > string</ b > family [, < b > string</ b > style [, < b > string</ b > file]])</ code >
10+ < code > AddFont(< b > string</ b > family [, < b > string</ b > style [, < b > string</ b > file [, < b > string </ b > dir] ]])</ code >
1111< h2 > Description</ h2 >
1212Imports a TrueType, OpenType or Type1 font and makes it available. It is necessary to generate a font
1313definition file first with the MakeFont utility.
1414< 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 raised.
15+ < br >
16+ The definition file (and the font file itself in case of embedding) must be present in:
17+ < ul >
18+ < li > The directory indicated by the 4th parameter (if that parameter is set)</ li >
19+ < li > The directory indicated by the < code > FPDF_FONTPATH</ code > constant (if that constant is defined)</ li >
20+ < li > The < code > font</ code > directory located in the same directory as < code > fpdf.php</ code > </ li >
21+ </ ul >
22+ If the file is not found, the error "Could not include font definition file" is raised.
1723< h2 > Parameters</ h2 >
1824< dl class ="param ">
1925< dt > < code > family</ code > </ dt >
@@ -34,9 +40,15 @@ <h2>Parameters</h2>
3440</ dd >
3541< dt > < code > file</ code > </ dt >
3642< dd >
37- The font definition file.
43+ The name of the font definition file.
44+ < br >
45+ By default, it is built from the family and style, in lower case with no space.
46+ </ dd >
47+ < dt > < code > dir</ code > </ dt >
48+ < dd >
49+ The directory where to load the definition file.
3850< br >
39- By default , the name is built from the family and style, in lower case with no space .
51+ If not specified , the default directory will be used .
4052</ dd >
4153</ dl >
4254< h2 > Example</ h2 >
0 commit comments