CVS update: php3/doc/functions
| From: | jah | Date: | Fri, 28 May 1999 07:22:02 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6118@lists.php.net to get a copy of this message | ||
Date: Friday May 28, 1999 @ 3:22
Author: jah
Update of /repository/php3/doc/functions
In directory php:/tmp/cvs-serv13520/doc/functions
Modified Files:
image.sgml
Log Message:
Some more work on PostScript Type 1 fonts and gd.c.
imagepstext with it's 12 (!) args is the winner of "the function with most
arguments in PHP3" contest...
Index: php3/doc/functions/image.sgml
diff -u php3/doc/functions/image.sgml:1.24 php3/doc/functions/image.sgml:1.25
--- php3/doc/functions/image.sgml:1.24 Mon May 24 18:24:37 1999
+++ php3/doc/functions/image.sgml Fri May 28 03:22:02 1999
@@ -1122,14 +1122,172 @@
Use this function if you need make further modifications to the font,
for example extending/condensing, slanting it or changing it's character
encoding vector, but need to keep the original along as well. Note that
- the font you want to copy must be one obtained using
<function>imagepsloadfont</function>.
- You can although make modifications to it before copying,
+ the font you want to copy must be one obtained using
<function>imagepsloadfont</function>,
+ not a font that is itself a copied one. You can although make modifications to it before
copying,
<para>
+ If you use this function, you <emphasis>must</emphasis> free the fonts obtained
this
+ way yourself and in reverse order. Otherwise your script <emphasis>will</emphasis>
hang.
+ <para>
In the case everything went right, a valid font index will be returned and
can be used for further purposes. Otherwise the function returns false and
prints a message describing what went wrong.
+ <para>
+ See also <function>imageploadpsfont</function>.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.imagepsencodefont">
+ <refnamediv>
+ <refname>ImagePSEncodeFont</refname>
+ <refpurpose>change the character encoding vector of a font</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>imagepsencodefont</function></funcdef>
+ <paramdef>string <parameter>encodingfile</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ If you find yourself using this function all the time, a much better way
+ to define the encoding is to set ps.default_encoding in php3.ini to point to the right
+ encoding file and all fonts you load will automatically have the right encoding.
+<!--
+ <example>
+ <title></title>
+ <programlisting role=php>
+<?php
+$f1 = imagepsloadfont("/usr/local/lib/psfonts/i/ItcEraBoo.pfb");
+$f2 = imagepscopyfont($f1);
+imagepsencodefont($f1, "/usr/local/share/t1lib/enc/IsoLatin1.enc");
+imagepsencodefont($f2, "/usr/local/share/t1lib/enc/IsoLatin1.enc");
+imagepsfreefont($f2);
+imagepsfreefont($f1);
+?>
+</programlisting>
+-->
+ </example>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.imagepstext">
+ <refnamediv>
+ <refname>ImagePSText</refname>
+ <refpurpose>to draw a text string over an image using PostScript Type1
fonts</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Descriptiom</title>
+ <funcsynopsis>
+ <funcdef>array <function>imagepstext</function></funcdef>
+ <paramdef>int <parameter>image</parameter></paramdef>
+ <paramdef>string <parameter>text</parameter></paramdef>
+ <paramdef>int <parameter>font</parameter></paramdef>
+ <paramdef>int <parameter>size</parameter></paramdef>
+ <paramdef>int <parameter>foreground</parameter></paramdef>
+ <paramdef>int <parameter>background</parameter></paramdef>
+ <paramdef>int <parameter>x</parameter></paramdef>
+ <paramdef>int <parameter>y</parameter></paramdef>
+ <paramdef>int <parameter>space</parameter></paramdef>
+ <paramdef>int <parameter>tightness</parameter></paramdef>
+ <paramdef>float <parameter>angle</parameter></paramdef>
+ <paramdef>int <parameter>antialias_steps</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ <parameter>foreground</parameter> is the color in which the text will be painted.
+ <parameter>background</parameter> is the color to which the text will try to fade
in
+ with antialiasing. No pixels with the color <parameter>background</parameter> are
+ actually painted, so the background image does not need to be of solid color.
+ <para>
+ The coordinates given by
+ <parameter>x</parameter>,<parameter>y</parameter> will define the
+ basepoint of the first character (roughly the lower-left corner
+ of the character). This is different from the
+ <function>ImageString</function>, where x,y define the
+ upper-right corner of the first character.
+ <para>
+ <parameter>space</parameter> allows you to change the default value of a space in
a font.
+ This amount is added to the normal value and can also be negative.
+ <para>
+ <parameter>tightness</parameter> allows you to control the amount of white space
+ between characters. This amount is added to the normal character width and can also be
negative.
+ <para>
+ <parameter>angle</parameter> is currently nonfunctional.
+ Only horizontal text, ie. angle = 0 degrees is supported.
+ <para>
+ <parameter>antialias_steps</parameter> allows you to control the number of colours
+ used for antialiasing text. Allowed values are 4 and 16. The higher value is
+ recommended for text sizes lower than 20, where the effect in text quality is quite visible.
+ With bigger sizes, use 4. It's less computationally intensive.
+ <para>
+ Parameters <parameter>space</parameter> and
<parameter>tightness</parameter>
+ are expressed in character space units, where 1 unit is 1/1000th of an em-square.
+ <para>
+ Parameters <parameter>space</parameter>,
<parameter>tightness</parameter>,
+ <parameter>angle</parameter> and <parameter>antialias</parameter> are
optional.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.imagepsbbox">
+ <refnamediv>
+ <refname>ImagePSBBox</refname>
+ <refpurpose>give the bounding box of a text rectangle using PostScript Type1
fonts</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>array <function>imagepsbbox</function></funcdef>
+ <paramdef>string <parameter>text</parameter></paramdef>
+ <paramdef>int <parameter>font</parameter></paramdef>
+ <paramdef>int <parameter>size</parameter></paramdef>
+ <paramdef>int <parameter>space</parameter></paramdef>
+ <paramdef>int <parameter>width</parameter></paramdef>
+ <paramdef>float <parameter>angle</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ <parameter>space</parameter> allows you to change the default value of a space in
a font.
+ This amount is added to the normal value and can also be negative.
+ <para>
+ <parameter>tightness</parameter> allows you to control the amount of white space
+ between characters. This amount is added to the normal character width and can also be
negative.
+ <para>
+ <parameter>angle</parameter> is currently nonfunctional.
+ Only horizontal text, ie. angle = 0 degrees is supported.
+ <para>
+ Parameters <parameter>space</parameter> and
<parameter>tightness</parameter>
+ are expressed in character space units, where 1 unit is 1/1000th of an em-square.
+ <para>
+ Parameters <parameter>space</parameter>,
<parameter>tightness</parameter> and
+ <parameter>angle</parameter> are optional.
+ <para>
+ The bounding box is calculated using information available from character metrics,
+ and unfortunately tends to differ slightly from the results achieved by actually
+ rasterizing the text. The lower left y-coordinate is often 1 pixel too far right,
+ and the upper right y-coordinate may be as far as 2% of the total width too far right
+ when using the six-parameter form of this function.
+ You have been warned.
<para>
- See also <function>imagepsfontload</function>.
+ This function returns an array containing the following elements:
+ <informaltable>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>lower left x-coordinate</entry>
+ </row>
+ <row>
+ <entry>1</entry>
+ <entry>lower left y-coordinate</entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry>upper right x-coordinate</entry>
+ </row>
+ <row>
+ <entry>3</entry>
+ <entry>upper right y-coordinate</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
</refsect1>
</refentry>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net