471,355 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

changing culture for Graphics.DrawString

Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}


Dec 7 '05 #1
3 2149
Gürkan,

The current culture has nothing to do with how characters are rendered.
A character has one value, that's it. The problem here is that your font
doesn't support those characters, hence the black boxes.

You have to use a different font which supports the characters.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Gürkan Demirci" <fa********@host.de> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}

Dec 7 '05 #2
using a font which supports japanese characters would certainly help.
"Gürkan Demirci" <fa********@host.de> schrieb im Newsbeitrag
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}

Dec 7 '05 #3
thank you both.

that solved my problem

regards

"Gürkan Demirci" <fa********@host.de> schrieb im Newsbeitrag
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}

Dec 7 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by twostepted | last post: by
5 posts views Thread by Charles A. Lackman | last post: by
3 posts views Thread by Mad Scientist Jr | last post: by
3 posts views Thread by D Witherspoon | last post: by
6 posts views Thread by Dom | last post: by
2 posts views Thread by Tony Johansson | last post: by
6 posts views Thread by Dilip | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.