# HG changeset patch # User lbessard # Date 1201515324 -3600 # Node ID 8a770e8d745a90adbd3916722c782cb46f51640d # Parent e4e8bc2e3e1a8fa10dcd7ae4ca6544e75258140e Adding support for Viewer font diff -r e4e8bc2e3e1a -r 8a770e8d745a Viewer.py --- a/Viewer.py Mon Jan 28 10:48:16 2008 +0100 +++ b/Viewer.py Mon Jan 28 11:15:24 2008 +0100 @@ -44,14 +44,14 @@ 'mono' : 'Courier New', 'helv' : 'Arial', 'other': 'Comic Sans MS', - 'size' : 10, + 'size' : 20, } else: faces = { 'times': 'Times', 'mono' : 'Courier', 'helv' : 'Helvetica', 'other': 'new century schoolbook', - 'size' : 12, + 'size' : 20, } #------------------------------------------------------------------------------- @@ -317,12 +317,12 @@ dc = wx.ClientDC(self) self.Font = wx.Font(faces["size"], wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = faces["mono"]) dc.SetFont(self.Font) - width, height = dc.GetTextExtent("A") - while height > 17: + width, height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ") + while width > 260: faces["size"] -= 1 self.Font = wx.Font(faces["size"], wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = faces["mono"]) dc.SetFont(self.Font) - width, height = dc.GetTextExtent("A") + width, height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ") # Link Viewer event to corresponding methods self.Bind(wx.EVT_PAINT, self.OnPaint) diff -r e4e8bc2e3e1a -r 8a770e8d745a examples/example.xml --- a/examples/example.xml Mon Jan 28 10:48:16 2008 +0100 +++ b/examples/example.xml Mon Jan 28 11:15:24 2008 +0100 @@ -12,7 +12,7 @@ contentDescription="Example of PLCOpenEditor usage"/> @@ -245,7 +245,7 @@ - + @@ -707,10 +707,10 @@ - - - - + + + + @@ -729,20 +729,20 @@ - - - - + + + + - - - - - + + + + + @@ -754,13 +754,13 @@ - + - + - + @@ -784,17 +784,17 @@ - - - - + + + + - - + + @@ -813,17 +813,17 @@ - - - - + + + + - - + + @@ -842,29 +842,29 @@ - - - - + + + + - - - - - + + + + + - + - - + + @@ -875,22 +875,22 @@ - + - - + + - + - - + + @@ -898,19 +898,19 @@ - + - - + + - + @@ -923,14 +923,14 @@ - + - + @@ -943,7 +943,7 @@ - + @@ -967,13 +967,13 @@ - - + + - - + + @@ -1006,33 +1006,33 @@ - - - - + + + + - + - - + + - + - - + + - - + +