winpdb icon indicating copy to clipboard operation
winpdb copied to clipboard

Source and Console panes use unusable and not-obviously-changeable font

Open ydirson opened this issue 5 years ago • 6 comments

First time I try out winpdb-reborn, having used winpdb in the past. I installed using pip3 for a test, all dependencies satisfied by the system (debian testing).

The Code ans Conssole panes are just unusable, this font is suprising:

Screenshot_2020-04-27_21-03-28

Strace revealed the use of a .winpdb_settings.cfg file (binary content with no particular magic, OMG!), which I moved away with no better result.

Also tried with a fresh user account that never used winpdb before, and without loading a script to debug, same result.

ydirson avatar Apr 27 '20 19:04 ydirson

That's kind of weird indeed.

The default fixed font used to display the console and the program source code is "Courier". See https://github.com/bluebird75/winpdb/blob/2082b8b296a0f87b5cbf062a5a179c80ecec32ab/winpdb.py#L3000

Could you try to change that and see if there is a different result ?

The settings.cfg is saved using pickle, this is why it is a binary format. It would be a good idea indeed to move to a text format.

Sorry for the delay and inswering your bug issue by the way.

bluebird75 avatar Jul 03 '20 20:07 bluebird75

On which platform are you using winpdb ?

bluebird75 avatar Jul 04 '20 12:07 bluebird75

I found the same problem on Ubuntu 20.04 (64 bit). I used "python -m pip install winpdb-reborn" to install as a normal user. In def set_font(self, ctrl): in the else branch I replaced face = "Courier" with face = "Cousine". (This was the first fixed width font I found in LibreOffice Writer.) This made the console view readable, but not the source code. After replacing another occurrence of Courier at line 2372 in def __init__(self, *args, **kwargs): the source code is readable as well.

I just noticed that the installation of the Microsoft fonts fixes the problem:
sudo apt-get install ttf-mscorefonts-installer

bomm avatar Jul 13 '20 13:07 bomm

Thanks, that's greatly appreciated ! I will look into WxPython to understand how to find a reliable fixed width font.

bluebird75 avatar Jul 15 '20 14:07 bluebird75

If you feel like fixing this, that would be of great help since you can investigate the problem directly. On Windows, the problem does not show up even if I force a non existing font. I just get text with a non fixed font, so Windows probably has a bettter default mechanism for this.

bluebird75 avatar Jul 15 '20 15:07 bluebird75

Can you check with the version I just committed ? The font lookup is now more generic, it should fix the problem.

bluebird75 avatar Jul 16 '20 07:07 bluebird75