Jump to content
php.lv forumi

PHP


Undeaded

Recommended Posts

Visiem sveiki!

Es šodien visu dienu sedeju un gribeju izdomat kā man ielikt GD funkcija fonts. Man serverim ir 2 versija GD.

 

Ka es saprotu vajag fonts ar .gdf formatu

 

es te atrodu sajtu kur var no .png uztaisit .gdf failu, bet man neizdodas... tur ir example .png fails, bet man vel vajaga vismaz 0123456789 ciparus

 

http://puremango.co.uk/fontmaker.php

 

Es gribu uztaisit userbaru, kurš skatisies databaze (mssql) kads man ir resets nu un vel radis niku. Varbut kaut kam ir Visitor fonts .gdf formata vaj varbut var kaut ka citadi uztaisit??

 

http://localhost/sm.php

 

http://localhost/sm2.php - variants kurš stradā, bet nav Visitor fonts :(

 

te ir mans .php faila kods:

<?php
# error_reporting(E_ALL  ^ E_NOTICE ^ E_WARNING);
include("config_ban.php");
include("signatures-code.php");
Header("Content-type: image/jpeg");
$image = imagecreatefromjpeg("http://localhost/img/sm.jpg");
$gray = imagecolorallocate($image, 0x00, 0x00, 0x00);
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$font = imageloadfont('font.gdf');
imagestring($image, $font, 110, 4, $web['namechar2'], $gray);
imagestring($image, $font, 185, 4, $web['resetchar2'], $gray);
imagejpeg($image);
imagedestroy($image);
?>

 

Visitor TT2 BRK .ttf fonts ir te http://localhost.lv/visitor.rar

Es njemu visitor2.ttf un 14 izmeru

Edited by Undeaded
Link to comment
Share on other sites

Fonts saka stradat ar imagettftext, bet man vel vajag laj butu border 1 px melna gaisa

 

http://mu.filebase.lv/signatures/sm2.php

 

es atradu tikaj image border, bet ne tekstam

 

uztaisiju ta:

 

$black = imagecolorallocate($image, 0x00, 0x00, 0x00);
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$font = 'visitor2.ttf';
imagettftext($image, 12, 0, 110, 14, $white, $font, $muweb['namechar2']);
imagettftext($image, 13, 0, 110, 14, $black, $font, $muweb['namechar2']);
imagettftext($image, 12, 0, 185, 14, $white, $font, $muweb['resetchar2']);
imagettftext($image, 13, 0, 185, 14, $black, $font, $muweb['resetchar2']);

 

laj ar baltiem burtiem butu 12 izmers, bet aizmuguraj 13 izmers melna gaisa... nav labi :))

Edited by Undeaded
Link to comment
Share on other sites

×
×
  • Create New...