Author Topic: Assertion when font changed  (Read 645 times)

Offline Amel

  • Single posting newcomer
  • *
  • Posts: 1
Assertion when font changed
« on: April 25, 2020, 03:04:14 pm »
An assertion alart saying "Assertion failed: numWeight>0" pops up when I try to change font by Setting-editor.

It happens on 20.03 version and the most recent nightly build (I tried both, uninstalled and install several times).

But when I install 17.12 version again, such assertion does not happen.

I searched about this issue and found a post.

But I cannot understand how he solved this problem.

I want to code with Consolas, not a system font...

Please help me. :'(

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5295
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Assertion when font changed
« Reply #1 on: May 03, 2020, 01:41:50 am »
This is a bug inside the wxWidgets 3.1.3 library.
This bug is fixed in wx trunk, see here: #18590 (Font description string Get and Set bug in wx3.1.3 on Windows 32bit build) wxWidgets. You can patch the wxWidgets 3.1.3's source and rebuild the wx library.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.