[PHP] Re: imagettftext

2010-07-10 Thread Nisse Engström
On Fri, 9 Jul 2010 20:12:38 -0500, Karl DeSaulniers wrote: > Is there a way to get the width and height of text created with > imagettftext? /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-03-06 Thread tedd
At 8:35 AM +0100 3/6/08, David Sveningsson wrote: Sidenote: If I replace åäö with numerical html entities it works, but that's not a reasonable solution to me. And you're right -- it isn't a reasonable solution . Whatever is generating your characters should generating the same characters

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-03-05 Thread David Sveningsson
tedd skrev: At 2:17 AM + 2/29/08, Nathan Rixham wrote: Nathan Rixham wrote: try changing: imagettftext( $im, $title_size, 0, 50, 50, $white, $font, $title ); to: imagettftext($im, $title_size, 0, 50, 50, $white, $font, utf8_decode($title)); Both statements work for me. -- see here: htt

[PHP] Re: imagettftext and utf-8 (swedish characters)

2008-03-05 Thread tedd
At 2:17 AM + 2/29/08, Nathan Rixham wrote: Nathan Rixham wrote: try changing: imagettftext( $im, $title_size, 0, 50, 50, $white, $font, $title ); to: imagettftext($im, $title_size, 0, 50, 50, $white, $font, utf8_decode($title)); Both statements work for me. -- see here: http://www.webby

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread David Sveningsson
Jochem Maas skrev: I guess I skimmed somewhat too ... but I based my assumption on the following from the OPs post: /index.php/slides/upload: $title = htmlentities($_POST['title'], ENT_COMPAT, 'UTF-8'); $image = '/index.php/slides/preview?title='.urlencode($title).'&content='.urlencode($_POST

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread David Sveningsson
Frank Arensmeier skrev: 29 feb 2008 kl. 03.41 skrev David Sveningsson: Nathan Rixham skrev: before going any further, your HTML page is in UTF-8 yes? with the appropriate content-type line. Yes, apache uses only utf-8 as charset and the html content-type meta tag is set to utf-8 too. Also,

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread Daniel Brown
On Fri, Feb 29, 2008 at 1:31 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > (my guess would be you could rely on all systems that have said TTF file > to support the same chars - I assume that although it may be compiled > diffferently > for different platforms the source font definition is going

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread Jochem Maas
Daniel Brown schreef: On Fri, Feb 29, 2008 at 12:59 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: it does because he's passing the title as an argument to the image script: I would say that's what I get for skimming, but look here: I guess I skimmed somewhat too ... but I based my assumpti

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread Daniel Brown
On Fri, Feb 29, 2008 at 12:59 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > it does because he's passing the title as an argument to the image script: I would say that's what I get for skimming, but look here: > The form accepts (expects) UTF-8 (though the OP may be better with `latin1

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread Jochem Maas
Daniel Brown schreef: On Thu, Feb 28, 2008 at 9:17 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: before going any further, your HTML page is in UTF-8 yes? with the appropriate content-type line. That wouldn't matter, Nate. It's an image (and already rendered as a static graphical object)

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread Daniel Brown
On Thu, Feb 28, 2008 at 9:17 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > before going any further, your HTML page is in UTF-8 yes? with the > appropriate content-type line. That wouldn't matter, Nate. It's an image (and already rendered as a static graphical object). Page encoding won't

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-29 Thread Frank Arensmeier
29 feb 2008 kl. 03.41 skrev David Sveningsson: Nathan Rixham skrev: before going any further, your HTML page is in UTF-8 yes? with the appropriate content-type line. Yes, apache uses only utf-8 as charset and the html content-type meta tag is set to utf-8 too. Also, the html form validates

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread David Sveningsson
Nathan Rixham skrev: before going any further, your HTML page is in UTF-8 yes? with the appropriate content-type line. Yes, apache uses only utf-8 as charset and the html content-type meta tag is set to utf-8 too. Also, the html form validates at validator.w3.org plus: first debugging step

[PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread Nathan Rixham
Nathan Rixham wrote: David Sveningsson wrote: Hi, I've ran into some problems when outputing text to an image using imagettftext. I cannot get swedish characters to work, I just get a square. I've tried different fonts which I know has those characters (bitstream vera, arial, times new roman,

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread David Sveningsson
Nathan Rixham skrev: try changing: imagettftext( $im, $title_size, 0, 50, 50, $white, $font, $title ); to: imagettftext($im, $title_size, 0, 50, 50, $white, $font, utf8_decode($title)); It draws lesser squares, but no characters (except for the regular alphanum characters which is rendered

[PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread Nathan Rixham
David Sveningsson wrote: Hi, I've ran into some problems when outputing text to an image using imagettftext. I cannot get swedish characters to work, I just get a square. I've tried different fonts which I know has those characters (bitstream vera, arial, times new roman, etc). What am I doing

Re: [PHP] Re: imagettftext color problem

2005-02-11 Thread hitek
You are using imagecreate() with png, which creates an indexed color image. > $img=imagecreate($width, $height); Use Imagecreatetruecolor() instead. > > From: Anni Hienola <[EMAIL PROTECTED]> > Date: 2005/02/11 Fri AM 02:27:03 EST > To: php-general@lists.php.ne

Re: [PHP] Re: imagettftext color problem

2005-02-11 Thread Richard Lynch
Anni Hienola wrote: > > And to correct one mistake in the code that was kindly pointed out but is > here just a typo: > >> $bg=imagecolorallocate($img, 255, 255, 255); >> $font_color=imageallocatecolor($img, 0, 0, 0); > > Should be: > $bg=imagecolorallocate($img, 255, 255, 255); > $font_color=i

[PHP] Re: imagettftext color problem

2005-02-11 Thread Anni Hienola
And to correct one mistake in the code that was kindly pointed out but is here just a typo: > $bg=imagecolorallocate($img, 255, 255, 255); > $font_color=imageallocatecolor($img, 0, 0, 0); Should be: $bg=imagecolorallocate($img, 255, 255, 255); $font_color=imagecolorallocate($img, 0, 0, 0); Full

[PHP] Re: imagettftext question

2002-05-28 Thread Stellan Klebom
"Ziying Sherwin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > In our application, we need to write a UTF8 strings to the image using True > Type fonts. The php function that we are using is imagettftext. However, > we have the two problems regarding that