def _scan_callback(self, sender):
        font = CurrentFont()
        if font is not None:
            glyph_names = get_glyphs(font)
            if len(glyph_names) > 0:
                # get resolution
                gridsize = int(self.w.spinner.value.get())
                res = (gridsize, gridsize)
                print "scanning glyphs...\n"
                for glyph_name in glyph_names:
                    glyph = font[glyph_name]
                    R = RasterGlyph(glyph)
                    R.scan(res=res)
                # done
                font.update()
                print "...done.\n"
            # no glyph selected
            else:
                print no_glyph_selected
        # no font open
        else:
            print no_font_open
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/dialogs/glyphs/elements_rasterize.py/rasterizeGlyphDialog._scan_callback/original