Jump to content

Search the Community

Showing results for tags 'true type font'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. hello my programming is focused at the image processing library GD and FREE TYPE. I tried , amongst others, the script at this page : http://code.tutsplus.com/tutorials/build-your-own-captcha-and-contact-form--net-5362 but I cant get it working. I placed the true type font *.ttf file in the right directory but still get an error message saying: The image 'http://localhost/mydirectory/captcha.php' can't be displayed because it contains errors. (not sure this is the correct translation of the errormessage as it was displayed in my own language). I tried many things. like placing it in another directory. I checked phpinfo() to see if GD was installed which it was. Firefox gives an error message, IE and Chrome just dont show anything. This is the code: <?php session_start(); $string = ''; for ($i = 0; $i < 5; $i++) { // this numbers refer to numbers of the ascii table (lower case) $string .= chr(rand(97, 122)); } $_SESSION['rand_code'] = $string; // $dir = 'fonts/'; $dir = 'http://localhost/mydir/fonts/'; $image = imagecreatetruecolor(170, 60); $black = imagecolorallocate($image, 0, 0, 0); $color = imagecolorallocate($image, 200, 100, 90); // red $white = imagecolorallocate($image, 255, 255, 255); imagefilledrectangle($image,0,0,399,99,$white); // imagettftext ($image, 30, 0, 10, 40, $color, $dir."arial.ttf", $_SESSION['rand_code']); imagettftext ($image, 30, 0, 10, 40, $color, "arial.ttf", $_SESSION['rand_code']); header("Content-type: image/png"); imagepng($image); ?> What I want to know first is if I understand fully how it should be done. Maybe the tut I'm working with is not complete. Online I found a few topics with the same error report, they solved it by saving it as another file format (not utf-8). I would like to try that but dont know how. Notepad doesnt seem to have that feature of another file format like UTF-8 NO NOM. And besides that: WHY is file format so important? Please help !
×
×
  • Create New...