C# script component font change error

When I tried to change a font for c# script component, It didn’t display any fonts in setup dialog and it reported following crash report on the windows desktop.

[ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Grasshopper.GUI.GH_FontList.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
[END ERROR]

I attached some images, too.
Thanks.

1 Like

I faced similar issue. It has to do with Windows 10 app control from Windows defender. Checkout the settings there.

Can you send me a screenshot of your Windows Fonts folder showing all the installed fonts? Should be at C:\Windows\Fonts

i made a topic on this with more info a few days ago:

1 Like

Oops, missed that one. Thanks for reminding me.

After I deleted most 3rd party font files from 500 to 300, but it happened still again. My os is windows 10. I attached a zipped files including whole font files from the windows/font folder. I did it as as a link. I hope this would be helpful to solve this issue. Thanks.

Zipped font file link:
https://1drv.ms/u/s!AmyvwcM5G7KJjqo7ITel-gf9c6WSfw

Hi David, I’m a bit of a novice here. Is there a (simple) fix to the font change crash issue. I don’t seem to see an unnamed font in my directory. I wasn’t sure if this issue got resolved. Thanks.

No it’s hidden from the Windows interface, it’s just there in the list of all installed fonts if you access it through code.

The issue has been fixed (RH-49017), you can see whether your version has this fix if you run the _GetIssueState command using the id RH-49017.