|
użytkowników online: 17
|
OPINIE UŻYTKOWNIKÓW
|
Przyznam, że jestem pod sporym wrażeniem. Od wielu lat zajmuje się grafiką przeznaczoną do druku ze szczególnym uwzględnieniem opakowań. Z radością stwierdzam, iż twórca serwisu jest moim ulubionym typem potencjalnego współpracownika (choć branża troszeczkę inna) tzn. pada pytanie i błyskawicznie pada konkretna odpowiedź bez względu na stopień skomplikowania pytania. Gorąco polecam współpracę, gdyż macie pewność że nie zostaniecie potraktowani sloganami typu "oczywiście", "nie ma sprawy" tylko otrzymacie konkretną pomoc. Tak trzymać! Na pewno jeszcze nie raz skorzystam
Paweł
Studio Gama
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
imagepsbbox (PHP 3 >= 3.0.9, PHP 4, PHP 5) imagepsbbox --
Give the bounding box of a text rectangle using PostScript Type1
fonts
Descriptionarray imagepsbbox ( string text, int font, int size [, int space, int tightness, float angle] )
size is expressed in pixels.
space 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.
tightness 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.
angle is in degrees.
Parameters space and
tightness are expressed in character space
units, where 1 unit is 1/1000th of an em-square.
Parameters space,
tightness, and angle
are optional.
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. If
the angle is 0 degrees, you can expect the text to need 1 pixel
more to every direction.
Notatka: Ta funkcja jest dostępna tylko jeśli
PHP zostało skompilowane z dyrektywą --enable-t1lib.
This function returns an array containing the following elements:
See also imagepstext().
User Contributed Notesdaniel at dantec dot NO_SPAM dot nl
18-Apr-2002 06:23
When using imagepsbbox, you are probably trying to do something like creating a button with text, so that the button is large enough for the text...
Below is a very simple example of making a black button just big enough to display white text on it.
<?php
if (!$text)
$text = "This is a sample text";
$fontsize=14;
$font=ImagePsLoadFont("/fonts/ariam___.pfb");
list($lx,$ly,$rx,$ry) = imagepsbbox($text,$font,$fontsize,0,0,0);
$textwidth = $rx - $lx;
$textheight = $ry - $ly;
$imh = $textheight + 20;
$imw = $textwidth + 40;
$im = imageCreate( $imw, $imh );
$black = ImageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
ImagePSText ($im, "$text", $font, $fontsize, $white, $white, 20, 20,'','','',4);
header("Content-type: image/jpeg");
ImageJPEG ($im,"",100);
Imagepsfreefont ( $font );
ImageDestroy ( $im );
?>
|