def GetFontDictionary(self, default=True): """Does a system lookup to build a default set of fonts using ten point fonts as the standard size. @keyword default: return the default dictionary of fonts, else return the current running dictionary of fonts if it exists. @type default: bool @return: font dictionary (primary, secondary) + (size, size2) """ if hasattr(self, 'fonts') and not default: return self.fonts font = Profile_Get('FONT1', 'font', None) if font is not None: mfont = font else: mfont = wx.Font(10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) Profile_Set('FONT1', mfont, 'font') primary = mfont.GetFaceName() font = Profile_Get('FONT2', 'font', None) if font is None: font = wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) Profile_Set('FONT2', font, 'font') secondary = font.GetFaceName() faces = { self.FONT_PRIMARY : primary, self.FONT_SECONDARY : secondary, self.FONT_SIZE : mfont.GetPointSize(), self.FONT_SIZE2 : font.GetPointSize(), self.FONT_SIZE3 : mfont.GetPointSize() - 2 } return faces
def __init__(self, parent): outbuff.OutputBuffer.__init__(self, parent) # Setup font = Profile_Get('FONT1', 'font', wx.Font(11, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.SetFont(font) style = (font.GetFaceName(), font.GetPointSize(), "#FFFFFF") self.StyleSetSpec(SearchResultList.STY_SEARCH_MATCH, "face:%s,size:%d,fore:#000000,back:%s" % style) self.StyleSetHotSpot(SearchResultList.STY_SEARCH_MATCH, True)
def __init__(self, parent): eclib.OutputBuffer.__init__(self, parent) # Attributes self._filter = SHOW_ALL_MSG self._srcs = list() self.SetLineBuffering(2000) # Setup font = Profile_Get('FONT1', 'font', wx.Font(11, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.SetFont(font) style = (font.GetFaceName(), font.GetPointSize(), "#FF0000") self.StyleSetSpec(LogBuffer.ERROR_STYLE, "face:%s,size:%d,fore:#FFFFFF,back:%s" % style) # Subscribe to Editra's Log ed_msg.Subscribe(self.UpdateLog, ed_msg.EDMSG_LOG_ALL)