Results 1 to 17 of 17

Thread: Outputing Multibyte characters with GD2

  1. #1

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217

    Outputing Multibyte characters with GD2

    Does anyone know how to do this?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    whats a multibyte character again?
    Like Archer? Check out some Sterling Archer quotes.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    An ANSI or UTF-8 multibyte character: used mostly for asian languages, consists of more than one byte.
    In UTF-8, many more characters are multi-byte as there are no code pages. E.g. ä, ö and ü are multi-byte in UTF-8 but only single-byte in ANSI with the right codepage (with the wrong codepage they show up incorrectly).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    can anyone help me with this?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  5. #5
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    what code do you have now?

  6. #6

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    PHP Code:
    <?php
      header
    ("Content-type: image/jpeg");
      
    $im imagecreate(400,30);
      
    $white imagecolorallocate($im255,255,255);
      
    $black imagecolorallocate($im0,0,0);
      
    imagettftext($im2001020$black"F:\web\msgothic.ttc""‚±‚ñ‚É‚¿‚Í");
      
    imagejpeg($im);
      
    imagedestroy($im);
    ?>
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  7. #7
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    for one are you sure the freetype library is installed? you have to have that along with the GD Library. also that is not a correct path.

    what do you get when you do this
    PHP Code:
    $im ImageCreate (100100) or die ("Cannot Initialize new GD image stream");
    $background_color ImageColorAllocate ($im255255255);
    $text_color ImageColorAllocate ($im2331491);
    // ($im, 5, 5, 5,)  1st ($im, 5, 5, 5, is the font size
    // 2nd  is the distasnce from left
    // 3rd is from top.
    ImageString ($im555"‚±‚ñ‚É‚¿‚Í"$text_color);
    ImagePng($im,"imagePNG.png");
    ImageDestroy($im);
    echo 
    "<img src=\"imagePNG.png\" border=0>"
    but if that doesn't work then you might not be able to use commas in the text string.

  8. #8

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    Here is it with your code: http://suneo.no-ip.com/jap.php
    and with the code I used: http://suneo.no-ip.com/ttf.php

    I do have FreeType installed or else that wouldn't work at all.

    The string is japanese text, im not sure if you can see it...
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  9. #9

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    Here is what I posted on another forum, it includes extra details just incase it helps:

    I want to write a script that will generate a dynamic image that contains japanese text. The server is setup for japanese and I have the fonts that contain the japanese characters. This is the result image I get when I try to display japanese text with imagettftext: http://suneo.no-ip.com/ttf.php Does anyone know what I have to do to get it to work?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  10. #10
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    well it seems mine works and your doesn't. can you upload that ttc file? actually what is that ttc file? it isn't a font, at least not an any system I have seen. most fonts are ttf fonts.

    did you fix the path? I se little block boxes as the font is not there.

  11. #11

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    TTC is a "TrueType Collection Font File" its basically more than one font in the same file. The font is the japanese version of MS Gothic. http://suneo.no-ip.com/msgothic.ttc
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  12. #12
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    my god 8mb? k will play around with it and see what I can get.

  13. #13
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    My guess is that the font is lacking UTF-8 mapping tables.

    I have read of the little blocks and this is what they say. nothing wrong with code as that is what I get as well.

  14. #14

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    what font has them?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  15. #15
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    beats me. read this


    http://www.php.net/imagetftext

    and go down to the user comments. the one dated may 2003

    they say the samething as I just did. I have no clue what the tables are that it needs.

  16. #16

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    I found a patch for the php source that adds japanese support. But I am having a hell of a hard time trying to compile PHP. Do you know of any step by step tutorials that could help me?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  17. #17
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    sorry, I run windows and never compiled it. look at www.php.net to find it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width