beremiz

Parents 33071a451021
Children a56362c818a3
use nice and pretty mono font in graphical languages (SFC, FBD, LD) as well

it looks like that was original idea, but some bug squashed in and
default font was used for POU.

at the same time fix use of mono font in the header of Variable panel
for SFC/FBD/LD POUs.
--- a/editors/Viewer.py Tue Sep 25 19:00:03 2018 +0300
+++ b/editors/Viewer.py Wed Sep 26 12:13:23 2018 +0300
@@ -764,15 +764,14 @@
self.ElementRefreshList_lock = Lock()
dc = wx.ClientDC(self.Editor)
- font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"])
- dc.SetFont(font)
- width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- while width > 260:
- faces["size"] -= 1
+ while True:
font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"])
dc.SetFont(font)
width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- self.SetFont(font)
+ if width < 260:
+ break
+ faces["size"] -= 1
+ self.Editor.SetFont(font)
self.MiniTextDC = wx.MemoryDC(wx.EmptyBitmap(1, 1))
self.MiniTextDC.SetFont(wx.Font(faces["size"] * 0.75, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["helv"]))