<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Create a new font</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.printer-create-dc.html">printer_create_dc</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.printer-create-pen.html">printer_create_pen</a></div> <div class="up"><a href="ref.printer.html">Printer Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.printer-create-font" class="refentry"> <div class="refnamediv"> <h1 class="refname">printer_create_font</h1> <p class="verinfo">(PECL printer SVN)</p><p class="refpurpose"><span class="refname">printer_create_font</span> — <span class="dc-title">Create a new font</span></p> </div> <div class="refsect1 description" id="refsect1-function.printer-create-font-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><strong>printer_create_font</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$face</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$height</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$width</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$font_weight</code></span> , <span class="methodparam"><span class="type">bool</span> <code class="parameter">$italic</code></span> , <span class="methodparam"><span class="type">bool</span> <code class="parameter">$underline</code></span> , <span class="methodparam"><span class="type">bool</span> <code class="parameter">$strikeout</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$orientation</code></span> )</div> <p class="para rdfs-comment"> The function creates a new font and returns a handle to it. A font is used to draw text. For an example see <span class="function"><a href="function.printer-select-font.html" class="function">printer_select_font()</a></span>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.printer-create-font-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">face</code></em></span> <dd> <p class="para"> <em><code class="parameter">face</code></em> must be a string specifying the font face. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">height</code></em></span> <dd> <p class="para"> <em><code class="parameter">height</code></em> specifies the font height. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">width</code></em></span> <dd> <p class="para"> <em><code class="parameter">width</code></em> specifies the font width. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">font_weight</code></em></span> <dd> <p class="para"> The <em><code class="parameter">font_weight</code></em> specifies the font weight (400 is normal), and can be one of the following predefined constants. <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_THIN</code></strong>: sets the font weight to thin (100). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_ULTRALIGHT</code></strong>: sets the font weight to ultra light (200). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_LIGHT</code></strong>: sets the font weight to light (300). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_NORMAL</code></strong>: sets the font weight to normal (400). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_MEDIUM</code></strong>: sets the font weight to medium (500). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_BOLD</code></strong>: sets the font weight to bold (700). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_ULTRABOLD</code></strong>: sets the font weight to ultra bold (800). </span> </li> <li class="listitem"> <span class="simpara"> <strong><code>PRINTER_FW_HEAVY</code></strong>: sets the font weight to heavy (900). </span> </li> </ul> </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">italic</code></em></span> <dd> <p class="para"> <em><code class="parameter">italic</code></em> can be <strong><code>TRUE</code></strong> or <strong><code>FALSE</code></strong>, and sets whether the font should be italic. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">underline</code></em></span> <dd> <p class="para"> <em><code class="parameter">underline</code></em> can be <strong><code>TRUE</code></strong> or <strong><code>FALSE</code></strong>, and sets whether the font should be underlined. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">strikeout</code></em></span> <dd> <p class="para"> <em><code class="parameter">strikeout</code></em> can be <strong><code>TRUE</code></strong> or <strong><code>FALSE</code></strong>, and sets whether the font should be stroked out. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">orientaton</code></em></span> <dd> <p class="para"> <em><code class="parameter">orientation</code></em> specifies a rotation. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.printer-create-font-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a font handle on success or <strong><code>FALSE</code></strong> on error. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.printer-create-dc.html">printer_create_dc</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.printer-create-pen.html">printer_create_pen</a></div> <div class="up"><a href="ref.printer.html">Printer Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>