|
-
Oct 30th, 2003, 04:35 PM
#1
Thread Starter
Addicted Member
Outputing Multibyte characters with GD2
Does anyone know how to do this?
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Oct 30th, 2003, 07:28 PM
#2
whats a multibyte character again?
-
Oct 31st, 2003, 03:02 AM
#3
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.
-
Nov 12th, 2003, 03:37 PM
#4
Thread Starter
Addicted Member
can anyone help me with this?
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Nov 12th, 2003, 06:45 PM
#5
Frenzied Member
what code do you have now?
-
Nov 12th, 2003, 07:34 PM
#6
Thread Starter
Addicted Member
PHP Code:
<?php
header("Content-type: image/jpeg");
$im = imagecreate(400,30);
$white = imagecolorallocate($im, 255,255,255);
$black = imagecolorallocate($im, 0,0,0);
imagettftext($im, 20, 0, 10, 20, $black, "F:\web\msgothic.ttc", "‚±‚ñ‚É‚¿‚Í");
imagejpeg($im);
imagedestroy($im);
?>
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Nov 12th, 2003, 08:12 PM
#7
Frenzied Member
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 (100, 100) or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 233, 14, 91);
// ($im, 5, 5, 5,) 1st ($im, 5, 5, 5, is the font size
// 2nd is the distasnce from left
// 3rd is from top.
ImageString ($im, 5, 5, 5, "‚±‚ñ‚É‚¿‚Í", $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.
-
Nov 12th, 2003, 09:18 PM
#8
Thread Starter
Addicted Member
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
-
Nov 12th, 2003, 09:21 PM
#9
Thread Starter
Addicted Member
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
-
Nov 12th, 2003, 09:37 PM
#10
Frenzied Member
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.
-
Nov 12th, 2003, 10:40 PM
#11
Thread Starter
Addicted Member
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
-
Nov 12th, 2003, 10:52 PM
#12
Frenzied Member
my god 8mb? k will play around with it and see what I can get.
-
Nov 13th, 2003, 12:07 AM
#13
Frenzied Member
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.
-
Nov 13th, 2003, 12:22 AM
#14
Thread Starter
Addicted Member
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Nov 13th, 2003, 12:37 AM
#15
Frenzied Member
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.
-
Nov 13th, 2003, 10:08 PM
#16
Thread Starter
Addicted Member
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
-
Nov 13th, 2003, 10:57 PM
#17
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|