URGENT vb.net converting font to string and string to font working in my computer but not in other computers
Posted on 2010-01-04
Hi, i have a application that stores button information about font family, font size, font bold and so on.
I build my application, and install it in other computer.
and start the program, i got Microsoft Sans serif 8,25pt every time
i should get Microsoft Sans Serif, 12pt, style=Bold
I have also checked a simular problem in C# here in E-X. TypeConverter (Font) not converting correctly, i was trying this, in vb.net (convert it first) with same result.
I have also checked the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.drawing.dll, they are equal in both computers
Windows XP sr3 on both computers (swedish version)
example of string to font
DIm H as string = "Microsoft Sans Serif, 12pt, style=Bold"
Dim tc As TypeConverter = TypeDescriptor.GetConverter(GetType(Font))
Dim Fo As Font = DirectCast(tc.ConvertFromString(H), Font)
I got "Microsoft Sans Serif, 8,25pt"
I have also tryied to take away the pt in the string.
eg. "Microsoft Sans Serif, 12, style=Bold" that gives the same result 8.25pt
I have also tryied to run my .exe file bin\release on my computer it's working good
The problem are when application are run on other computer than my development computer
the font converter gives wrong result.
I hope you have any idea about this problem