I am having a problem with basic drawing of unicode characters in Windows 2000 and XP.
I have written a simplest possible C# WinForms program to test it (just create a new Windows Forms C# application and add a Paint event handler):
In Windows Vista, the unicode character (U2153, representing "1/3" in a single character) is drawn twice, but in Windows XP or 2000, it is not drawn in any case.
So, the question is: how to draw a unicode string in XP?
[EDIT:] I just found out something, but decided to add this post anyway: the main problem is - Windows XP Tahoma font simply does not have these characters! When you try to insert this unicode symbol in MS Word using Tahoma font, it is omitted from the list (http://zero2180.net/2008/01/tahoma/).
I usually use SystemFonts.Mes sageBoxFont to get the default system font (returns "Tahoma" for XP and 2000, "Segoe" for Vista).
So what font should I then use for unicode?
I have written a simplest possible C# WinForms program to test it (just create a new Windows Forms C# application and add a Paint event handler):
Code:
public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Paint += new PaintEventHandler(Form1_Paint); } void Form1_Paint(object sender, PaintEventArgs e) { Font f = new Font("Tahoma", 12); // this is used just to get a larger font // try drawing with DrawString e.Graphics.DrawString("Test \u2153", f, SystemBrushes.ControlText, new PointF(10, 50)); // try drawing with DrawText TextRenderer.DrawText(e.Graphics, "Test \u2153", f, new Rectangle(10, 10, 50, 50), SystemColors.ControlText); } }
So, the question is: how to draw a unicode string in XP?
[EDIT:] I just found out something, but decided to add this post anyway: the main problem is - Windows XP Tahoma font simply does not have these characters! When you try to insert this unicode symbol in MS Word using Tahoma font, it is omitted from the list (http://zero2180.net/2008/01/tahoma/).
I usually use SystemFonts.Mes sageBoxFont to get the default system font (returns "Tahoma" for XP and 2000, "Segoe" for Vista).
So what font should I then use for unicode?
Comment