(self)
Load current configuration settings for the font options.

        Retrieve current font with idleConf.GetFont and font families
        from tk. Setup fontlist and set font_name.  Setup sizelist,
        which sets font_size.  Set font_bold.  Call set_samples.
Load current configuration settings for the font options.
Load current configuration settings for the font options .
def load_font_cfg(self):
        """Load current configuration settings for the font options.

        Retrieve current font with idleConf.GetFont and font families
        from tk. Setup fontlist and set font_name.  Setup sizelist,
        which sets font_size.  Set font_bold.  Call set_samples.
        """
        configured_font = idleConf.GetFont(self, 'main', 'EditorWindow')
        font_name = configured_font[0].lower()
        font_size = configured_font[1]
        font_bold  = configured_font[2]=='bold'

        # Set sorted no-duplicate editor font selection list and font_name.
        fonts = sorted(set(tkfont.families(self)))
        for font in fonts:
            self.fontlist.insert(END, font)
        self.font_name.set(font_name)
        lc_fonts = [s.lower() for s in fonts]
        try:
            current_font_index = lc_fonts.index(font_name)
            self.fontlist.see(current_font_index)
            self.fontlist.select_set(current_font_index)
            self.fontlist.select_anchor(current_font_index)
            self.fontlist.activate(current_font_index)
        except ValueError:
            pass
        # Set font size dropdown.
        self.sizelist.SetMenu(('7', '8', '9', '10', '11', '12', '13', '14',
                               '16', '18', '20', '22', '25', '29', '34', '40'),
                              font_size)
        # Set font weight.
        self.font_bold.set(font_bold)
        self.set_samples()
def load_font_cfg ( self ) : configured_font = idleConf . GetFont ( self , 'main' , 'EditorWindow' ) font_name = configured_font [ 0 ] . lower ( ) font_size = configured_font [ 1 ] font_bold = configured_font [ 2 ] == 'bold' # Set sorted no-duplicate editor font selection list and font_name. fonts = sorted ( set ( tkfont . families ( self ) ) ) for font in fonts : self . fontlist . insert ( END , font ) self . font_name . set ( font_name ) lc_fonts = [ s . lower ( ) for s in fonts ] try : current_font_index = lc_fonts . index ( font_name ) self . fontlist . see ( current_font_index ) self . fontlist . select_set ( current_font_index ) self . fontlist . select_anchor ( current_font_index ) self . fontlist . activate ( current_font_index ) except ValueError : pass # Set font size dropdown. self . sizelist . SetMenu ( ( '7' , '8' , '9' , '10' , '11' , '12' , '13' , '14' , '16' , '18' , '20' , '22' , '25' , '29' , '34' , '40' ) , font_size ) # Set font weight. self . font_bold . set ( font_bold ) self . set_samples ( )