Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów
Generator sygnaturek - problem z czcionką - Wersja do druku

+- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl)
+-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www)
+--- Dział: Początkujący webmaster (https://www.webmastertalk.pl/forum-poczatkujacy-webmaster)
+--- Wątek: Generator sygnaturek - problem z czcionką (/thread-generator-sygnaturek-problem-z-czcionka)



Generator sygnaturek - problem z czcionką - SanKylo - 23-05-2011

Witam mam taki skrypt
Kod:
<?php

header("Content-type: image/png");

$obraz = imagecreatefrompng("1.png");

$czcionka_biala = imagecolorallocate($obraz, 255, 255, 255);
$czcionka_czarna = imagecolorallocate($obraz, 0, 0, 0);

$tekst = $_GET['tekst'];

$font = 'arial.ttf';

imagettftext($obraz, 11, 0, 5, 14, $czcionka_biala, $font, $tekst);

imagepng($obraz);
imagedestroy($obraz);

?>
I chciałbym zmienić czcionkę niż ariel , wrzucam do folderu czcionkę np.: Tahoma w kodzie zmieniam na Tahoma.Po czym wyskakuje kiedy chce wygenerować kod komunikat :
Kod:
Obrazek "http://generator.xaa.pl/img/8/generator.php?tekst=sss" nie może zostać wyświetlony, ponieważ zawiera błędy.
Link do niedziłającego ze zmienioną czcionka.
Kod:
http://generator.xaa.pl/img/8/
A Tu do działającego
Kod:
http://generator.xaa.pl/img/2/
Co zrobić żeby była inna czcionka ? : P


RE: Generator sygnaturek - problem z czcionką - mateo - 23-05-2011

http://php-manual.skryptoteka.pl/function.imagettftext.html

Tam znajdziesz odpowiedź na swoje pytanie.


RE: Generator sygnaturek - problem z czcionką - SanKylo - 23-05-2011

Kod
Kod:
<?php

header("Content-type: image/png");

$obraz = imagecreatefrompng("1.png");

$czcionka_biala = imagecolorallocate($obraz, 255, 255, 255);
$czcionka_czarna = imagecolorallocate($obraz, 0, 0, 0);

$tekst = $_GET['tekst'];
putenv ( 'GDFONTPATH=' . realpath ( '.' ));
$font = 'dupa.ttf';

imagettftext($obraz, 11, 0, 5, 14, $czcionka_biala, $font, $tekst);

imagepng($obraz);
imagedestroy($obraz);

?>
Nadal nie działa ;f


RE: Generator sygnaturek - problem z czcionką - mateo - 23-05-2011

Nadal ten sam błąd...
Kod:
// Name the font to be used (note the lack of the .ttf extension)
Mam nadzieję, że angielski lub użycie translatora ogarniasz?


RE: Generator sygnaturek - problem z czcionką - SanKylo - 23-05-2011

Tak wiem przeczytałem to wcześniej ale nic to nie pomogło ;f


RE: Generator sygnaturek - problem z czcionką - mateo - 23-05-2011

Skoro dałeś mi plusa to chyba raczej pomogło Smile


RE: Generator sygnaturek - problem z czcionką - SanKylo - 23-05-2011

Nie nie pomogło , ale plus za starania.

Czekam na dalsze propozycje.