changing culture for Graphics.DrawString

  • Thread starter Gürkan Demirci
  • Start date
G

Gürkan Demirci

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.CurrentCulture = new
CultureInfo("ja-JP");

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

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

}
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
Top