def apply_callback(self, sender):
        # get fonts
        try:
            f1 = self.all_fonts[self.w._f1_font.get()]
            f2 = self.all_fonts[self.w._f2_font.get()]
            f3 = self.all_fonts[self.w._f3_font.get()]
            glyph_names = get_glyphs(f1)
            if len(glyph_names) > 0:
                # get factors
                x = float(self.w._factor_x.value.get())
                y = float(self.w._factor_y.value.get())
                # print info
                print 'interpolating glyphs...\n'
                boolstring = (False, True)
                print '\tmaster 1: %s' % get_full_name(f1)
                print '\tmaster 2: %s' % get_full_name(f2)
                print '\ttarget: %s' % get_full_name(f3)
                print
                print '\tfactor x: %s' % x
                print '\tfactor y: %s' % y
                # print '\tproportional: %s' % boolstring[self.proportional]
                print
                print '\t',
                self.w.bar.start()
                # interpolate glyphs
                for glyph_name in glyph_names:
                    # check glyphs
                    if f2.has_key(glyph_name):
                        f3.newGlyph(glyph_name, clear=True)
                        # prepare undo
                        f3[glyph_name].prepareUndo('interpolate')
                        # interpolate
                        print glyph_name,
                        f3[glyph_name].interpolate((x, y), f1[glyph_name], f2[glyph_name])
                        f3[glyph_name].update()
                        # create undo
                        f3[glyph_name].performUndo()
                    else:
                        print '\tfont 2 does not have glyph %s' % glyph_name
                f3.update()
                # done
                self.w.bar.stop()
                print
                print '\n...done.\n'
            # no glyph selected
            else:
                print no_glyph_selected
        # no font open
        except:
            print no_font_open
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/dialogs/glyphs/interpolate.py/interpolateGlyphsDialog.apply_callback/original