473,626 Members | 3,183 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 = imagecoloralloc ate ( $im, 255, 17, 255 );
$black = imagecoloralloc ate($im, 0, 0, 0);

for ( $j=strlen($stri ng)*$fh, $i=0; $i<strlen($stri ng); $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 2044
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 = imagecoloralloc ate ( $im, 255, 17, 255 );
$black = imagecoloralloc ate($im, 0, 0, 0);

for ( $j=strlen($stri ng)*$fh, $i=0; $i<strlen($stri ng); $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
24097
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 convert n = "" # init new string for i in str: if i in chr: # if special character in str n+='\\' # append it with a backslash n+=i
6
2786
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 hyphens, german umlauts, etc. i could write a function to parse the comment and substitute special chars with the relevant html code, but maybe this already exists in some
0
1835
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 - so I have to find the entry in my db, where the page title is guestbook. But there isn't a only column for this virtual filenames, but only entries like "Guestbook", "This & much more..." and so on. Becaus I'm not able to use "This & much...
2
1639
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
2640
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 aware, that's connected with the way the GET method passes variable values, but I don't know how to make GET to take the variable value "as it is" without interpreting special chars as special chars. So, how should I send GET variables in order not...
6
4205
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 throws an XmlException ... how do i overcome this ? do i have to parse the string for special chars
3
10154
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 avoided? The reason being that I compare this string to a string in an Access DB (btw, Access also screws up with the character by replacing "Ñ" with "-"). So when I compare these two strings, they won't match because both systems storing the data...
8
2910
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 nothing works . I have no idea how to go further . Can anyone help me ? Thanks in advance.
5
4160
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 points to a sqlserver2005 instance... it comes in looking like this in the debugger:
0
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8504
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.