762 |
762 |
763 self.ElementRefreshList = [] |
763 self.ElementRefreshList = [] |
764 self.ElementRefreshList_lock = Lock() |
764 self.ElementRefreshList_lock = Lock() |
765 |
765 |
766 dc = wx.ClientDC(self.Editor) |
766 dc = wx.ClientDC(self.Editor) |
767 font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"]) |
767 while True: |
768 dc.SetFont(font) |
|
769 width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
|
770 while width > 260: |
|
771 faces["size"] -= 1 |
|
772 font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"]) |
768 font = wx.Font(faces["size"], wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["mono"]) |
773 dc.SetFont(font) |
769 dc.SetFont(font) |
774 width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
770 width, _height = dc.GetTextExtent("ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
775 self.SetFont(font) |
771 if width < 260: |
|
772 break |
|
773 faces["size"] -= 1 |
|
774 self.Editor.SetFont(font) |
776 self.MiniTextDC = wx.MemoryDC(wx.EmptyBitmap(1, 1)) |
775 self.MiniTextDC = wx.MemoryDC(wx.EmptyBitmap(1, 1)) |
777 self.MiniTextDC.SetFont(wx.Font(faces["size"] * 0.75, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["helv"])) |
776 self.MiniTextDC.SetFont(wx.Font(faces["size"] * 0.75, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["helv"])) |
778 |
777 |
779 self.CurrentScale = None |
778 self.CurrentScale = None |
780 self.SetScale(ZOOM_FACTORS.index(1.0), False) |
779 self.SetScale(ZOOM_FACTORS.index(1.0), False) |