<slide title="Sizing Blocks of text">
<blurb>
The hardest part of creating a PDF document this way is to keep control of blocks of text.  You need to
know the height of a block of text in order to handle pagination correctly in multipage documents.
</blurb>

<image filename="pdf.png" align="center" />

<list title="Font Characteristics">
<bullet>fontsize</bullet>
<bullet>capheight</bullet>
<bullet>ascender</bullet>
<bullet>descender</bullet>
</list>

<list title="Text Rendering Attributes">
<bullet>leading</bullet>
<bullet>textrise</bullet>
<bullet>horizscaling</bullet>
<bullet>charspacing</bullet>
<bullet>wordspacing</bullet>
</list>

<example title="Calculating the height of a blurb" fontsize="1.85em"><![CDATA[<?
 pdf_save($pdf);
 pdf_translate($pdf,0,$page_height);
 pdf_scale($pdf,1,-1);
 pdf_set_font($pdf, $font , 12, 'winansi');
 $leading = pdf_get_value($pdf, "leading");
 $height = $inc = 12+$leading;

 while(pdf_show_boxed($pdf, $text, $x, $page_height-$y, 
                     $page_width-2*$x, $height, $align, 
                     'blind')!=0) 
     $height+=$inc;

 pdf_restore($pdf);
?>]]></example>

</slide>
