473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

create images with special chars

Hi

I want to create an image with vertical text, but how do I handle
special chars like "æøå"? I'm using php version 4.4.2.

This is my code so far:

$string = "æøå";
$fh = 6;

$im = imagecreate ( 14, strlen($string)*$fh+2 );
$bg = imagecolorallocate ( $im, 255, 17, 255 );
$black = imagecolorallocate($im, 0, 0, 0);

for ( $j=strlen($string)*$fh, $i=0; $i<strlen($string); $i++, $j-=$fh )
imagecharup ( $im, 2, 0, $j, $string[$i], $black );

header('Content-type: image/png');
imagepng($im);
Thanx
Ask
Dec 7 '06 #1
1 2022
Hi,

If you need more symbols, you can use a True Type font with
imagettftext (specify a vertical angle for your example). You could
also try loading another bitmap font with imageloadfont.

In my version of PHP (4.4.2), the built-in GD font seems to use the ISO
8859-2 character set. You can see the characters here:

http://nl.ijs.si/gnusl/cee/charset.html

For instance, latin "ae" is not shown. And I'm not sure if all
available chars are represented in the font...

Ask Josephsen wrote:
Hi

I want to create an image with vertical text, but how do I handle
special chars like "æøå"? I'm using php version 4.4.2.

This is my code so far:

$string = "æøå";
$fh = 6;

$im = imagecreate ( 14, strlen($string)*$fh+2 );
$bg = imagecolorallocate ( $im, 255, 17, 255 );
$black = imagecolorallocate($im, 0, 0, 0);

for ( $j=strlen($string)*$fh, $i=0; $i<strlen($string); $i++, $j-=$fh )
imagecharup ( $im, 2, 0, $j, $string[$i], $black );

header('Content-type: image/png');
imagepng($im);
Thanx
Ask
Dec 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: tertius | last post by:
Is there a better way to append certain chars in a string with a backslash that the example below? chr = "#$%^&_{}" # special chars to look out for str = "123 45^ & 00 0_" # string to...
6
by: Jonas Meurer | last post by:
hello, my script selects a comment saved as VARCHAR in MySQL and displays it inside an html page. the problem is, that the comment contains several special characters, as mysterious utf-8...
0
by: Steffen Gebert | last post by:
Hello, I want to fetch the page via php from a mysql-db, which is called by an emulated filename (mod_rewrite, but that might be unimportant). So I have a file, which is called by guestbook.html...
2
by: Thorsten Viel | last post by:
Hi List, im trying to use special chars with the std::string (like S) but when i cout<< the string the special chars have disappeared. What's wrong here? Thanks in advance
4
by: dutch disCo | last post by:
Hi, I'm trying to use GET method to pass variables through my script files. Unfortunately, when a special char (&, ?, +) is being posted the variable gets trimmed in a very strange way. I'm...
6
by: Nimrod Cohen | last post by:
Hi, newbie that i am in .Net, i'm trying to add "D/T" as a new element in C# : XmlElement elemAttr = (XmlElement)m_xmlDoc.AppendChild(m_xmlDoc.CreateElement("D/T" ) ); but the framework...
3
by: VMI | last post by:
When I execute a ReadLine from an ascii file with special chars (ie. the 'Ñ' in "NUÑEZ PEREZ"), it automatically deletes this character. So "NUÑEZ PEREZ" becomes "NUEZ PEREZ". How can this be...
8
by: abhi147 | last post by:
Hi , I have been trying to convert a 32 bit string like "b2a4fdf15af7c4f215e1909be4707bdb" to convert to a string of special chars like "²¤ýñZ÷Äòá?›äp{Û" I have tried a lot of things .. but...
5
by: Alex | last post by:
Hi all - Is there a standard way to handle special chars in strings in dotnet? I'm using csharp and having two seperate problems... 1. Passing in args... I need to pass in an arg that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.