Location: PHPKode > projects > Dompdf > dompdf-0.4/doc/dompdf/Font_Metrics.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Font_Metrics</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Font_Metrics</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
											<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
						
			</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The font metrics class</p>
<div class="description"><p>This class provides information about fonts and text.  It can resolve  font names into actual installed font files, as well as determine the  size of text in a particular font and size.</p></div>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_include_font_metrics_cls_php.html">/include/font_metrics.cls.php</a> (line <span class="field">63</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>


	<a name="sec-const-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constant Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Constants</span> (<a href="#sec-consts">details</a>)
												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="const-summary">
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#CACHE_FILE" title="details" class="const-name">CACHE_FILE</a> = 					<span class="var-type"> __DOMPDF_FONT_CACHE_FILE</span>

				</div>
							</div>
		</div>
	</div>

	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_font_lookup" title="details" class="var-name">$_font_lookup</a>
				</div>
								<div class="var-title">
					<span class="var-type">Cpdf</span>
					<a href="#$_pdf" title="details" class="var-name">$_pdf</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#get_font" title="details" class="method-name">get_font</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$family</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$subtype</span> = <span class="var-default">"normal"</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_font_families" title="details" class="method-name">get_font_families</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">float</span>
										<a href="#get_font_height" title="details" class="method-name">get_font_height</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$font</span>, <span class="var-type">float</span>&nbsp;<span class="var-name">$size</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">float</span>
										<a href="#get_text_width" title="details" class="method-name">get_text_width</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$text</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$font</span>, <span class="var-type">float</span>&nbsp;<span class="var-name">$size</span>, <span class="var-type">float</span>&nbsp;<span class="var-name">$spacing</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#init" title="details" class="method-name">init</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#load_font_families" title="details" class="method-name">load_font_families</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#save_font_families" title="details" class="method-name">save_font_families</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#set_font_family" title="details" class="method-name">set_font_family</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$fontname</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$entry</span>)
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
												<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$_font_lookup" id="$_font_lookup"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_font_lookup</span>
			 = <span class="var-default">array()</span>			(line <span class="line-number">84</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Array of font family names to font files</p>
<div class="description"><p>Usually cached by the <a href="../dompdf/_load_font_php.html">load_font.php</a> script</p></div>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">static:</span> </li>
			</ul>
	
	
		
		

</div>
<a name="var$_pdf" id="$_pdf"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">Cpdf</span>
			<span class="var-name">$_pdf</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">75</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Underlying Cpdf object to perform text size calculations</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">static:</span> </li>
			</ul>
	
	
		
		

</div>

						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																			<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodget_font" id="get_font"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_font</span> (line <span class="line-number">134</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Resolves a font family &amp; subtype into an actual font file</p>
<div class="description"><p>Subtype can be one of 'normal', 'bold', 'italic' or 'bold_italic'.  If  the particular font family has no suitable font file, the default font  (<a href="../dompdf/_dompdf_config_inc_php.html#defineDOMPDF_DEFAULT_FONT">DOMPDF_DEFAULT_FONT</a>) is used.  The font file returned  is the absolute pathname to the font file on the system.</p></div>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			get_font
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$family</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$subtype</span> = <span class="var-default">"normal"</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$family</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$subtype</span>			</li>
				</ul>
		
		
	</div>
<a name="methodget_font_families" id="get_font_families"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_font_families</span> (line <span class="line-number">185</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the current font lookup table</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_font_families
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodget_font_height" id="get_font_height"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_font_height</span> (line <span class="line-number">118</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Calculates font height</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">float</span>
		<span class="method-name">
			get_font_height
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$font</span>, <span class="var-type">float</span>&nbsp;<span class="var-name">$size</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$font</span>			</li>
					<li>
				<span class="var-type">float</span>
				<span class="var-name">$size</span>			</li>
				</ul>
		
		
	</div>
<a name="methodget_text_width" id="get_text_width"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_text_width</span> (line <span class="line-number">107</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Calculates text size, in points</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">float</span>
		<span class="method-name">
			get_text_width
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$text</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$font</span>, <span class="var-type">float</span>&nbsp;<span class="var-name">$size</span>, <span class="var-type">float</span>&nbsp;<span class="var-name">$spacing</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$text</span><span class="var-description">: the text to be sized</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$font</span><span class="var-description">: the desired font</span>			</li>
					<li>
				<span class="var-type">float</span>
				<span class="var-name">$size</span><span class="var-description">: the desired font size</span>			</li>
					<li>
				<span class="var-type">float</span>
				<span class="var-name">$spacing</span><span class="var-description">: word spacing, if any</span>			</li>
				</ul>
		
		
	</div>
<a name="methodinit" id="init"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">init</span> (line <span class="line-number">91</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Class initialization</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			init
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodload_font_families" id="load_font_families"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">load_font_families</span> (line <span class="line-number">169</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads the stored font family cache</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
				<li><span class="field">see:</span> <a href="../dompdf/Font_Metrics.html#methodsave_font_families">Font_Metrics::save_font_families()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			load_font_families
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodsave_font_families" id="save_font_families"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">save_font_families</span> (line <span class="line-number">158</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Saves the stored font family cache</p>
<div class="description"><p>The name and location of the cache file are determined by <a href="../dompdf/Font_Metrics.html#constCACHE_FILE">Font_Metrics::CACHE_FILE</a>.  This file should be writable by the  webserver process.</p></div>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
				<li><span class="field">see:</span> <a href="../dompdf/Font_Metrics.html#methodload_font_families">Font_Metrics::load_font_families()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			save_font_families
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodset_font_family" id="set_font_family"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">set_font_family</span> (line <span class="line-number">189</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">static:</span> </li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			set_font_family
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$fontname</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$entry</span>)
			</div>
	
		
		
	</div>
						
		</div>
	</div>

	<a name="sec-consts"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Constants</a> (<span class="disabled">details</span>)
						
			
												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="constCACHE_FILE" id="CACHE_FILE"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">CACHE_FILE</span>
			 = <span class="const-default"> __DOMPDF_FONT_CACHE_FILE</span>
			(line <span class="line-number">68</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../dompdf/_include_font_metrics_cls_php.html#define__DOMPDF_FONT_CACHE_FILE">__DOMPDF_FONT_CACHE_FILE</a></li>
			</ul>
	
	
</div>

						
		</div>
	</div>

	<p class="notes" id="credit">
		Documentation generated on Fri, 04 Mar 2005 13:31:18 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: Dompdf