Issue #26673: Protect IDLE from Linux fonts with reported default size 0.

Such fonts on Linux prevented the configuration dialog from opening.
This commit is contained in:
Terry Jan Reedy 2016-05-22 14:35:24 -04:00
parent 0a91e43820
commit 5917f973ac
1 changed files with 1 additions and 1 deletions

View File

@ -720,7 +720,7 @@ class IdleConf:
actualFont = Font.actual(f) actualFont = Font.actual(f)
family = actualFont['family'] family = actualFont['family']
size = actualFont['size'] size = actualFont['size']
if size < 0: if size <= 0:
size = 10 # if font in pixels, ignore actual size size = 10 # if font in pixels, ignore actual size
bold = actualFont['weight']=='bold' bold = actualFont['weight']=='bold'
return (family, size, 'bold' if bold else 'normal') return (family, size, 'bold' if bold else 'normal')