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. @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 __SetupFonts(self): """Create the font settings for the shell by trying to get the users prefered font settings used in the EdStc """ fonts = { 'size': 11, 'lnsize': 10, 'backcol': '#FFFFFF', 'calltipbg': '#FFFFB8', 'calltipfg': '#404040', } font = Profile_Get( 'FONT1', 'font', wx.Font(11, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) if font.IsOk() and len(font.GetFaceName()): fonts['mono'] = font.GetFaceName() fonts['size'] = font.GetPointSize() fonts['lnsize'] = max(0, fonts['size'] - 1) font = Profile_Get( 'FONT2', 'font', wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) if font.IsOk() and len(font.GetFaceName()): fonts['times'] = font.GetFaceName() fonts['helv'] = font.GetFaceName() fonts['other'] = font.GetFaceName() return fonts
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)