addfont.htm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <H2>AddFont</H2>
  10. <TT>AddFont(<B>string</B> family [, <B>string</B> style [, <B>string</B> file]])</TT>
  11. <H4 CLASS='st'>Version</H4>
  12. 1.5
  13. <H4 CLASS='st'>Description</H4>
  14. Imports a TrueType or Type1 font and makes it available. It is necessary to generate a font
  15. definition file first with the makefont.php utility.
  16. <BR>
  17. The definition file (and the font file itself when embedding) must be present in the font directory.
  18. If it is not found, the error "Could not include font definition file" is generated.
  19. <H4 CLASS='st'>Parameters</H4>
  20. <TT><U>family</U></TT>
  21. <BLOCKQUOTE>
  22. Font family. The name can be chosen arbitrarily. If it is a standard family name, it will
  23. override the corresponding font.
  24. </BLOCKQUOTE>
  25. <TT><U>style</U></TT>
  26. <BLOCKQUOTE>
  27. Font style. Possible values are (case insensitive):
  28. <UL>
  29. <LI>empty string: regular
  30. <LI><TT>B</TT>: bold
  31. <LI><TT>I</TT>: italic
  32. <LI><TT>BI</TT> or <TT>IB</TT>: bold italic
  33. </UL>
  34. The default value is regular.
  35. </BLOCKQUOTE>
  36. <TT><U>file</U></TT>
  37. <BLOCKQUOTE>
  38. The font definition file.
  39. <BR>
  40. By default, the name is built from the family and style, in lower case with no space.
  41. </BLOCKQUOTE>
  42. <H4 CLASS='st'>Example</H4>
  43. <TABLE WIDTH="100%" BGCOLOR="#E0E0E0"><TR><TD>
  44. <TT>
  45. $pdf-&gt;AddFont('Comic','I');
  46. </TT>
  47. </TD></TR></TABLE><BR>
  48. is equivalent to:
  49. <BR>
  50. <BR>
  51. <TABLE WIDTH="100%" BGCOLOR="#E0E0E0"><TR><TD>
  52. <TT>
  53. $pdf-&gt;AddFont('Comic','I','comici.php');
  54. </TT>
  55. </TD></TR></TABLE><BR>
  56. <H4 CLASS='st'>See also</H4>
  57. <A HREF="setfont.htm">SetFont()</A>.
  58. <HR STYLE="margin-top:1.2em">
  59. <DIV ALIGN="CENTER"><A HREF="index.htm">Index</A></DIV>
  60. </BODY>
  61. </HTML>