Bug #54953 System.ArgumentException
Submitted: 2 Jul 2010 8:45 Modified: 17 Sep 2010 9:28
Reporter: zheng sj Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.25 OS:Windows (windows7)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: System.ArgumentException

[2 Jul 2010 8:45] zheng sj
Description:
Exception = System.ArgumentException
Message = 字体“Trebuchet MS”不支持样式“Regular”。
FullText = System.ArgumentException: 字体“Trebuchet MS”不支持样式“Regular”。
   在 System.Drawing.Font.CreateNativeFont()
   在 System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
   在 System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
   在 System.Drawing.Font..ctor(String familyName, Single emSize)
   在 MySQL.Utilities.CollapsingPanel..ctor()
   在 MySQL.Utilities.CollapsingPanel..ctor(String Caption, CollapsingPanelDisplayMode InitialDisplayMode, CollapsingPanelStyle InitialStyle, Boolean InitialExpandState, Int32 initialHeight)
   在 MySQL.GUI.Workbench.ModelOverviewForm.RebuildModelContents()
   在 MySQL.GUI.Workbench.MainForm.ShowPhysicalOverviewForm(NodeId nodeId)
   在 MySQL.GUI.Workbench.MainForm.RefreshGUI(RefreshType refresh, String str, IntPtr ptr)
   在 MySQL.Workbench.WbFrontendCallbacks.refresh_gui_wrapper(RefreshType refresh, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* str, Int64 ptr)
   在 sigc.pointer_functor3<enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,__int64,void>.()(pointer_functor3<enum wb::RefreshType\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,__int64\,void>* , RefreshType* _A_a1, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_a2, Int64* _A_a3)
   在 sigc.adaptor_functor<sigc::pointer_functor3<enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,__int64,void> >.operator()<enum wb::RefreshType const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,__int64 const &>(adaptor_functor<sigc::pointer_functor3<enum wb::RefreshType\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,__int64\,void> >* , RefreshType* _A_arg1, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_arg2, Int64* _A_arg3)
   在 sigc.internal.slot_call3<sigc::pointer_functor3<enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,__int64,void>,void,enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__int64>.call_it(slot_rep* rep, RefreshType* a_1, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a_2, Int64* a_3)
   在 wb.WBContext.flush_idle_tasks(WBContext* )
   在 MySQL.Workbench.WbContext.flush_idle_tasks()
   在 MySQL.GUI.Workbench.Program.timer_Tick(Object sender, EventArgs e)

How to repeat:
Exception = System.ArgumentException
Message = 字体“Trebuchet MS”不支持样式“Regular”。
FullText = System.ArgumentException: 字体“Trebuchet MS”不支持样式“Regular”。
   在 System.Drawing.Font.CreateNativeFont()
   在 System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
   在 System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
   在 System.Drawing.Font..ctor(String familyName, Single emSize)
   在 MySQL.Utilities.CollapsingPanel..ctor()
   在 MySQL.Utilities.CollapsingPanel..ctor(String Caption, CollapsingPanelDisplayMode InitialDisplayMode, CollapsingPanelStyle InitialStyle, Boolean InitialExpandState, Int32 initialHeight)
   在 MySQL.GUI.Workbench.ModelOverviewForm.RebuildModelContents()
   在 MySQL.GUI.Workbench.MainForm.ShowPhysicalOverviewForm(NodeId nodeId)
   在 MySQL.GUI.Workbench.MainForm.RefreshGUI(RefreshType refresh, String str, IntPtr ptr)
   在 MySQL.Workbench.WbFrontendCallbacks.refresh_gui_wrapper(RefreshType refresh, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* str, Int64 ptr)
   在 sigc.pointer_functor3<enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,__int64,void>.()(pointer_functor3<enum wb::RefreshType\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,__int64\,void>* , RefreshType* _A_a1, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_a2, Int64* _A_a3)
   在 sigc.adaptor_functor<sigc::pointer_functor3<enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,__int64,void> >.operator()<enum wb::RefreshType const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,__int64 const &>(adaptor_functor<sigc::pointer_functor3<enum wb::RefreshType\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,__int64\,void> >* , RefreshType* _A_arg1, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_arg2, Int64* _A_arg3)
   在 sigc.internal.slot_call3<sigc::pointer_functor3<enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,__int64,void>,void,enum wb::RefreshType,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__int64>.call_it(slot_rep* rep, RefreshType* a_1, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a_2, Int64* a_3)
   在 wb.WBContext.flush_idle_tasks(WBContext* )
   在 MySQL.Workbench.WbContext.flush_idle_tasks()
   在 MySQL.GUI.Workbench.Program.timer_Tick(Object sender, EventArgs e)
[14 Jul 2010 9:05] Johannes Taxacher
We would need some information on how to reproduce the error. Also please add the output you get from "Help->System Info" in Workbench Main Menu.
Thanks in advance
[15 Jul 2010 1:02] zheng sj
My System Info:

MySQL Workbench CE for Windows version 5.2.25

Data Directory: D:\Program Files\MySQL\MySQL Workbench 5.2 CE

Cairo Version: 1.8.8

Rendering Mode: OpenGL is available on this system, so OpenGL is used for rendering.

OpenGL Driver Version: 3.2.9262 Compatibility Profile Context

OS: Microsoft Windows 7 Ultimate Edition (build 7600), 32-bit

CPU: 4x Intel(R) Core(TM) i3 CPU       M 350  @ 2.27GHz, 1.9 GiB RAM

Video adapter info:

Adapter type: ATI Mobility Radeon HD 5145

Chip Type: ATI display adapter (0x9553)

BIOS String: BR036231-001

Video Memory: 524288 KB
[15 Jul 2010 9:48] Susanne Ebrecht
Please describe step by step what you did to get this error.
[16 Jul 2010 2:32] zheng sj
"Open Connection to Start Querying" ==> connection my localhost database ==> error
[16 Jul 2010 14:35] Valeriy Kravchuk
What exact version of MySQL server, x.y.z, are you working with?
[21 Jul 2010 6:37] zheng sj
MySQL server version: 5.1.48-community
MySQL Workbench version: 5.2.25 CE
[8 Aug 2010 11:37] Valeriy Kravchuk
Please, check if this happens with a newer version, 5.2.26.
[30 Aug 2010 20:54] Alfredo Kojima
Do you have the Trebuchet MS Regular font installed?
[30 Aug 2010 20:57] Alfredo Kojima
From the amount of duplicates from what appear to be other Chinese users, my guess is that Chinese Windows 7 doesn't ship the Trebuchet font. 

We can try repeating by changing the Trebuchet font with some invalid string and then fix the code to fallback to some other standard font.
[30 Aug 2010 21:03] Alfredo Kojima
These:

CollapsingPanel.cs:    private Font headerFont = new Font("Trebuchet MS", 11, FontStyle.Bold);
CollapsingPanel.cs:    private Font tabHeaderCaptionFont = new Font("Trebuchet MS", 11, FontStyle.Bold);
CollapsingPanel.cs:    private Font tabHeaderDescriptionFont = new Font("Trebuchet MS", 7);

should be changed so that if the font isn't fount, a different one (Tahoma or MS Sans Serif) is used as fallback.
[2 Sep 2010 11:54] Mike Lischke
A fix has been pushed to the repository to prevent this type of exception. However, it is important to note that this is NOT a bug in WB, but rather a Windows problem. It is documented that font subsitutes are selected automatically by Windows if a certain one is not available. But this problem here is caused by corrupted fonts and hence even with the fix things can still go bad if the default font is corrupted too. Search the internet to see how common this problem is. However it is easy to come around it: by re-installing the font in question.
[16 Sep 2010 22:39] Johannes Taxacher
fix confirmed in repository
[17 Sep 2010 9:28] Tony Bedford
An entry has been added to the 5.2.28 changelog:

On Microsoft Windows, MySQL Workbench crashed if the Trebuchet MS font was missing or corrupted.

MySQL Workbench has been changed to fall back to a secondary font if the Trebuchet MS font is missing or corrupted.