Repository: nvaccess/nvda

Issue:
Wx assertion on welcome screen
### Steps to reproduce:
1. Start nvda with debug logging
1. Open the Welcome dialog (you can do this through `NVDA+n`,`h`,`l`)

### Expected behavior:
No exception in the log.

### Actual behavior:
The following exception in the log:
```
DEBUGWARNING - WX Widgets (07:07:34.237):
..\..\src\msw\font.cpp, line 651:
assert ff_family != (0<<4): unknown wxFontFamily
Stack trace:
  File "nvda.pyw", line 199, in <module>
    core.main()
  File "core.py", line 396, in main
    app.MainLoop()
  File "C:\work\nvda\miscDeps\python\wx\_core.py", line 8657, in MainLoop
    wx.PyApp.MainLoop(self)
  File "C:\work\nvda\miscDeps\python\wx\_core.py", line 7952, in MainLoop
    return _core_.PyApp_MainLoop(*args, **kwargs)
  File "C:\work\nvda\miscDeps\python\wx\_core.py", line 16766, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "gui\__init__.py", line 154, in showGui
    self.sysTrayIcon.onActivate(None)
  File "gui\__init__.py", line 488, in onActivate
    self.PopupMenu(self.menu)
  File "C:\work\nvda\miscDeps\python\wx\_windows.py", line 2849, in PopupMenu
    return _windows_.TaskBarIcon_PopupMenu(*args, **kwargs)
  File "gui\__init__.py", line 439, in <lambda>
    self.Bind(wx.EVT_MENU, lambda evt: WelcomeDialog.run(), item)
  File "gui\__init__.py", line 651, in run
    d = cls(mainFrame)
  File "gui\__init__.py", line 590, in __init__
    welcomeTextHeader.SetFont(wx.Font(18, wx.NORMAL, wx.NORMAL, wx.BOLD))
  File "C:\work\nvda\miscDeps\python\wx\_gdi.py", line 2253, in __init__
    _gdi_.Font_swiginit(self,_gdi_.new_Font(*args, **kwargs))
  File "core.py", line 226, in OnAssert
    log.debugWarning(message,codepath="WX Widgets",stack_info=True)
```

The key line is:
```
  File "gui\__init__.py", line 590, in __init__
    welcomeTextHeader.SetFont(wx.Font(18, wx.NORMAL, wx.NORMAL, wx.BOLD))
```

### System configuration:
NVDA version:
Recent dev build, just prior to 2017.4


Discussion:
Hi, taken care of as part of #7077. Thanks.


Thanks @josephsl, I would be happy for this bug to be fixed independently. This makes it even easier though!
See https://github.com/nvaccess/nvda/pull/7104/files#diff-9140a5f85417543d5f030fb3402465b9R591
Relevant change:
```
-		welcomeTextHeader.SetFont(wx.Font(18, wx.NORMAL, wx.NORMAL, wx.BOLD))
+		welcomeTextHeader.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.BOLD))
```
Hi, there are other host of issues fixed as part of wxPy4 work. All that’s needed are official version of wxPython 4, fixing wx.Yield problem and widest possible testing phase. Thanks.

 

From: Reef Turner [mailto:notifications@github.com] 
Sent: Tuesday, October 24, 2017 11:30 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] Wx assertion on welcome screen (#7692)

 

Thanks @josephsl <https://github.com/josephsl> , I would be happy for this bug to be fixed independently. This makes it even easier though!
See https://github.com/nvaccess/nvda/pull/7104/files#diff-9140a5f85417543d5f030fb3402465b9R591
Relevant change:

-              welcomeTextHeader.SetFont(wx.Font(18, wx.NORMAL, wx.NORMAL, wx.BOLD))
+              welcomeTextHeader.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.BOLD))

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7692#issuecomment-339228302> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkCwhkUV_l2Lj_yq6j6bAOLKwLuYqks5svtVVgaJpZM4QFe_o> .



Resolving patch:
diff --git a/source/gui/__init__.py b/source/gui/__init__.py
--- a/source/gui/__init__.py
+++ b/source/gui/__init__.py
@@ -587,7 +587,7 @@ def __init__(self, parent):
 		# Translators: The header for the Welcome dialog when user starts NVDA for the first time. This is in larger,
 		# bold lettering 
 		welcomeTextHeader = wx.StaticText(self, label=_("Welcome to NVDA!"))
-		welcomeTextHeader.SetFont(wx.Font(18, wx.NORMAL, wx.NORMAL, wx.BOLD))
+		welcomeTextHeader.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.BOLD))
 		mainSizer.AddSpacer(guiHelper.SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS)
 		mainSizer.Add(welcomeTextHeader,border=20,flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
 		mainSizer.AddSpacer(guiHelper.SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS)


Test patch: