@@ -1499,6 +1499,92 @@ function imagepolygon($image, array $points, int $num_points, int $color): void
14991499}
15001500
15011501
1502+ /**
1503+ * Loads a character encoding vector from a file and changes the fonts
1504+ * encoding vector to it. As a PostScript fonts default vector lacks most of
1505+ * the character positions above 127, you'll definitely want to change this
1506+ * if you use a language other than English.
1507+ *
1508+ * If you find yourself using this function all the time, a much
1509+ * better way to define the encoding is to set ps.default_encoding in
1510+ * the configuration file
1511+ * to point to the right encoding file and all fonts you load will
1512+ * automatically have the right encoding.
1513+ *
1514+ * @param resource $font_index A font resource, returned by imagepsloadfont.
1515+ * @param string $encodingfile The exact format of this file is described in T1libs documentation.
1516+ * T1lib comes with two ready-to-use files,
1517+ * IsoLatin1.enc and
1518+ * IsoLatin2.enc.
1519+ * @throws ImageException
1520+ *
1521+ */
1522+ function imagepsencodefont ($ font_index , string $ encodingfile ): void
1523+ {
1524+ error_clear_last ();
1525+ $ result = \imagepsencodefont ($ font_index , $ encodingfile );
1526+ if ($ result === false ) {
1527+ throw ImageException::createFromPhpError ();
1528+ }
1529+ }
1530+
1531+
1532+ /**
1533+ * Extend or condense a font (font_index), if
1534+ * the value of the extend parameter is less
1535+ * than one you will be condensing the font.
1536+ *
1537+ * @param resource $font_index A font resource, returned by imagepsloadfont.
1538+ * @param float $extend Extension value, must be greater than 0.
1539+ * @throws ImageException
1540+ *
1541+ */
1542+ function imagepsextendfont ($ font_index , float $ extend ): void
1543+ {
1544+ error_clear_last ();
1545+ $ result = \imagepsextendfont ($ font_index , $ extend );
1546+ if ($ result === false ) {
1547+ throw ImageException::createFromPhpError ();
1548+ }
1549+ }
1550+
1551+
1552+ /**
1553+ * imagepsfreefont frees memory used by a PostScript
1554+ * Type 1 font.
1555+ *
1556+ * @param resource $font_index A font resource, returned by imagepsloadfont.
1557+ * @throws ImageException
1558+ *
1559+ */
1560+ function imagepsfreefont ($ font_index ): void
1561+ {
1562+ error_clear_last ();
1563+ $ result = \imagepsfreefont ($ font_index );
1564+ if ($ result === false ) {
1565+ throw ImageException::createFromPhpError ();
1566+ }
1567+ }
1568+
1569+
1570+ /**
1571+ * Slant a given font.
1572+ *
1573+ * @param resource $font_index A font resource, returned by imagepsloadfont.
1574+ * @param float $slant Slant level.
1575+ * @throws ImageException
1576+ *
1577+ */
1578+ function imagepsslantfont ($ font_index , float $ slant ): void
1579+ {
1580+ error_clear_last ();
1581+ $ result = \imagepsslantfont ($ font_index , $ slant );
1582+ if ($ result === false ) {
1583+ throw ImageException::createFromPhpError ();
1584+ }
1585+ }
1586+
1587+
15021588/**
15031589 * imagerectangle creates a rectangle starting at
15041590 * the specified coordinates.
0 commit comments