tifier of the postscript file * as returned by ps_new. * @param float $on The length of the dash. * @param float $off The length of the gap between dashes. * @throws PsException * */ function ps_setdash($psdoc, float $on, float $off): void { error_clear_last(); $result = \ps_setdash($psdoc, $on, $off); if ($result === false) { throw PsException::createFromPhpError(); } } /** * This function is * currently not documented; only its argument list is available. * * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param float $value The value must be between 0.2 and 1. * @throws PsException * */ function ps_setflat($psdoc, float $value): void { error_clear_last(); $result = \ps_setflat($psdoc, $value); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets a font, which has to be loaded before with * ps_findfont. Outputting text without setting a font * results in an error. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $fontid The font identifier as returned by ps_findfont. * @param float $size The size of the font. * @throws PsException * */ function ps_setfont($psdoc, int $fontid, float $size): void { error_clear_last(); $result = \ps_setfont($psdoc, $fontid, $size); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets the gray value for all following drawing operations. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param float $gray The value must be between 0 (white) and 1 (black). * @throws PsException * */ function ps_setgray($psdoc, float $gray): void { error_clear_last(); $result = \ps_setgray($psdoc, $gray); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets how line ends look like. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $type The type of line ends. Possible values are * PS_LINECAP_BUTT, * PS_LINECAP_ROUND, or * PS_LINECAP_SQUARED. * @throws PsException * */ function ps_setlinecap($psdoc, int $type): void { error_clear_last(); $result = \ps_setlinecap($psdoc, $type); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets how lines are joined. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $type The way lines are joined. Possible values are * PS_LINEJOIN_MITER, * PS_LINEJOIN_ROUND, or * PS_LINEJOIN_BEVEL. * @throws PsException * */ function ps_setlinejoin($psdoc, int $type): void { error_clear_last(); $result = \ps_setlinejoin($psdoc, $type); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets the line width for all following drawing operations. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param float $width The width of lines in points. * @throws PsException * */ function ps_setlinewidth($psdoc, float $width): void { error_clear_last(); $result = \ps_setlinewidth($psdoc, $width); if ($result === false) { throw PsException::createFromPhpError(); } } /** * If two lines join in a small angle and the line join is set to * PS_LINEJOIN_MITER, then * the resulting spike will be very long. The miter limit is the maximum * ratio of the miter length (the length of the spike) and the line width. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param float $value The maximum ratio between the miter length and the line width. Larger * values (> 10) will result in very long spikes when two lines meet * in a small angle. Keep the default unless you know what you are doing. * @throws PsException * */ function ps_setmiterlimit($psdoc, float $value): void { error_clear_last(); $result = \ps_setmiterlimit($psdoc, $value); if ($result === false) { throw PsException::createFromPhpError(); } } /** * This function is * currently not documented; only its argument list is available. * * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $mode * @throws PsException * */ function ps_setoverprintmode($psdoc, int $mode): void { error_clear_last(); $result = \ps_setoverprintmode($psdoc, $mode); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets the length of the black and white portions of a dashed line. * ps_setpolydash is used to set more complicated dash * patterns. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param float $arr arr is a list of length elements alternately for * the black and white portion. * @throws PsException * */ function ps_setpolydash($psdoc, float $arr): void { error_clear_last(); $result = \ps_setpolydash($psdoc, $arr); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Creates a pattern based on a shading, which has to be created before with * ps_shading. Shading patterns can be used like regular * patterns. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $shadingid The identifier of a shading previously created with * ps_shading. * @param string $optlist This argument is not currently used. * @return int The identifier of the pattern. * @throws PsException * */ function ps_shading_pattern($psdoc, int $shadingid, string $optlist): int { error_clear_last(); $result = \ps_shading_pattern($psdoc, $shadingid, $optlist); if ($result === false) { throw PsException::createFromPhpError(); } return $result; } /** * Creates a shading, which can be used by ps_shfill or * ps_shading_pattern. * * The color of the shading can be in any color space except for * pattern. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param string $type The type of shading can be either radial or * axial. Each shading starts with the current fill * color and ends with the given color values passed in the parameters * c1 to c4 * (see ps_setcolor for their meaning). * @param float $x0 The coordinates x0, y0, * x1, y1 are the start and * end point of the shading. If the type of shading is * radial the two points are the middle points of * a starting and ending circle. * @param float $y0 See ps_setcolor for their meaning. * @param float $x1 If the shading is of type radial the * optlist must also contain the parameters * r0 and r1 with the radius of the * start and end circle. * @param float $y1 * @param float $c1 * @param float $c2 * @param float $c3 * @param float $c4 * @param string $optlist * @return int Returns the identifier of the pattern. * @throws PsException * */ function ps_shading($psdoc, string $type, float $x0, float $y0, float $x1, float $y1, float $c1, float $c2, float $c3, float $c4, string $optlist): int { error_clear_last(); $result = \ps_shading($psdoc, $type, $x0, $y0, $x1, $y1, $c1, $c2, $c3, $c4, $optlist); if ($result === false) { throw PsException::createFromPhpError(); } return $result; } /** * Fills an area with a shading, which has to be created before with * ps_shading. This is an alternative way to creating * a pattern from a shading ps_shading_pattern and using * the pattern as the filling color. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $shadingid The identifier of a shading previously created with * ps_shading. * @throws PsException * */ function ps_shfill($psdoc, int $shadingid): void { error_clear_last(); $result = \ps_shfill($psdoc, $shadingid); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Output a text at the given text position. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param string $text The text to be output. * @param float $x x-coordinate of the lower left corner of the box surrounding the text. * @param float $y y-coordinate of the lower left corner of the box surrounding the text. * @throws PsException * */ function ps_show_xy($psdoc, string $text, float $x, float $y): void { error_clear_last(); $result = \ps_show_xy($psdoc, $text, $x, $y); if ($result === false) { throw PsException::createFromPhpError(); } } /** * This function is * currently not documented; only its argument list is available. * * * @param resource $psdoc * @param string $text * @param int $len * @param float $xcoor * @param float $ycoor * @throws PsException * */ function ps_show_xy2($psdoc, string $text, int $len, float $xcoor, float $ycoor): void { error_clear_last(); $result = \ps_show_xy2($psdoc, $text, $len, $xcoor, $ycoor); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Output a text at the current text position. The text position can be set * by storing the x and y coordinates into the values textx * and texty with the function * ps_set_value. The function will issue an * error if a font was not set before with ps_setfont. * * ps_show evaluates the following parameters and values * as set by ps_set_parameter and * ps_set_value. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param string $text The text to be output. * @throws PsException * */ function ps_show($psdoc, string $text): void { error_clear_last(); $result = \ps_show($psdoc, $text); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Output text at the current position. Do not print more than len characters. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param string $text The text to be output. * @param int $len The maximum number of characters to print. * @throws PsException * */ function ps_show2($psdoc, string $text, int $len): void { error_clear_last(); $result = \ps_show2($psdoc, $text, $len); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Draws the path constructed with previously called drawing functions like * ps_lineto. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @throws PsException * */ function ps_stroke($psdoc): void { error_clear_last(); $result = \ps_stroke($psdoc); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Output the glyph at position ord in the font * encoding vector of the current font. The font encoding for a font can be * set when loading the font with ps_findfont. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param int $ord The position of the glyph in the font encoding vector. * @throws PsException * */ function ps_symbol($psdoc, int $ord): void { error_clear_last(); $result = \ps_symbol($psdoc, $ord); if ($result === false) { throw PsException::createFromPhpError(); } } /** * Sets a new initial point of the coordinate system. * * @param resource $psdoc Resource identifier of the postscript file * as returned by ps_new. * @param float $x x-coordinate of the origin of the translated coordinate system. * @param float $y y-coordinate of the origin of the translated coordinate system. * @throws PsException * */ function ps_translate($psdoc, float $x, float $y): void { error_clear_last(); $result = \ps_translate($psdoc, $x, $y); if ($result === false) { throw PsException::createFromPhpError(); } }