PHP Velho Oeste 2024

imagepsextendfont

(PHP 4, PHP 5)

imagepsextendfontBir PS yazı tipini genişletir veya daraltır

Açıklama

imagepsextendfont ( resource $yazıtipi , float $katsayı ) : bool

yazıtipi tanıtıcısı ile belirtilen PS yazı tipini genişletir veya daraltır; katsayı birden büyükse genişletir, küçükse daraltır.

DeÄŸiÅŸtirgeler

yazıtipi

imagepsloadfont() tarafından döndürülen bir yazı tipi özkaynağı.

katsayı

Yazı tipi genişlik çarpanı. Sıfırdan büyük olmalıdır.

Dönen Değerler

Başarı durumunda TRUE, başarısızlık durumunda FALSE döner.

Örnekler

Örnek 1 - imagepsextendfont() örneği

<?php
//Bir .pfb yazı tipi dosyası yükleyelim
$font imagepsloadfont('./px3l.pfb');

// Yazı tipini 2.5 kere geniÅŸletiyoruz
imagepsextendfont($font2.5);

// Burada yazı tipini kullanıyoruz


// Ä°ÅŸimiz bitince yazı tipine ayrılan belleÄŸi serbest bırakıyoruz
imagepsfreefont($font);
?>

Notlar

Bilginize: Bu işlev sadece, PHP, --with-t1lib[=DİZİN] seçeneği ile derlenmişse kullanılabilir.

add a note add a note

User Contributed Notes 2 notes

up
3
admin at studio-gepard dot pl
14 years ago
It is impossible to use this function with a TrueType (.ttf) fonts.You need to convert font to PostScript Type1 (.pfb) on your own (google - there are free converters too)
up
0
Pascal@TeamX
20 years ago
Just for the less experienced PHP-Hackers, like me ;-) …

header("Content-type: image/png");
$text = "hello world";
$val = 1.2;
$font = imagepsloadfont(" path to font ");
$im = imagecreate(200, 200);
$color_bg = imagecolorallocate($im, 255, 255, 255);
$color_font = imagecolorallocate($im, 0, 0, 0);
imagefill($im, 0, 0, $color_font);

imagepsextendfont($font, $val);

$bound = imagepstext($im, $text, $font, 25, $color_bg, $color_font, 10, 100, 0, 0, 0, 4);
imagepng($im);
imagedestroy($im);
To Top