function footer($ps, $text) { $psfont = ps_findfont($ps, "Helvetica", "", 0); ps_setfont($ps, $psfont, 8.0); $buffer = "This file has been created with pslib " . ps_get_parameter($ps, "dottedversion", 0.0); ps_show_xy($ps, $buffer, LEFT_BORDER, 25); }
exit(1); } ps_set_parameter($ps, "hyphenation", "true"); ps_set_parameter($ps, "hyphendict", "hyph_en.dic"); $psfont = ps_findfont($ps, "Helvetica", "", 0); printf("Creating %d pages\n", $_SERVER["argc"] - 1); for ($k = 1; $k < $_SERVER["argc"]; $k++) { printf("Creating page for %s\n", $_SERVER["argv"][$k]); ps_begin_page($ps, 596, 842); $samplefont = ps_findfont($ps, $_SERVER["argv"][$k], "", 1); ps_setfont($ps, $psfont, 15.0); $text = sprintf("Fontsample for '%s'", ps_get_parameter($ps, "fontname", $samplefont)); ps_show_xy($ps, $text, $leftmargin, $bottommargin + 20 * $rowheight); ps_setfont($ps, $psfont, 10.0); ps_show_xy($ps, "Font encoding: ", $leftmargin, $bottommargin + 19.0 * $rowheight); ps_show($ps, ps_get_parameter($ps, "fontencoding", $samplefont)); ps_show_xy($ps, "capheight: ", $leftmargin, $bottommargin + 18.5 * $rowheight); $text = sprintf("%.2f", ps_get_value($ps, "capheight", $samplefont)); ps_show($ps, $text); ps_show_xy($ps, "ascender: ", $leftmargin, $bottommargin + 18.0 * $rowheight); $text = sprintf("%.2f", ps_get_value($ps, "ascender", $samplefont)); ps_show($ps, $text); ps_show_xy($ps, "descender: ", $leftmargin, $bottommargin + 17.5 * $rowheight); $text = sprintf("%.2f", ps_get_value($ps, "descender", $samplefont)); ps_show($ps, $text); for ($i = 0; $i <= 16; $i++) { ps_moveto($ps, $leftmargin + $i * $colwidth, $bottommargin); ps_lineto($ps, $leftmargin + $i * $colwidth, $bottommargin + 16 * $rowheight); ps_stroke($ps); } for ($j = 0; $j <= 16; $j++) {