# HG changeset patch # User Andrey Skvortsov # Date 1537953203 -10800 # Node ID 94045bfa2d9482bba7bf256f09bda7f2434a401e # Parent 33071a4510215e3d0569de1e1926b9e957fb8beb 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. diff -r 33071a451021 -r 94045bfa2d94 editors/Viewer.py --- 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"]))