def apply_callback(self, sender): hairspace = int(self.w.hairspace_value.get()) thinspace = int(self.w.thinspace_value.get()) thickspace = int(self.w.thickspace_value.get()) figurespace = int(self.w.figurespace_value.get()) # boolstring = (False, True) if self.font is not None: # print info print 'creating space glyphs...\n' print '\thair space: %s units' % hairspace print '\tthin space: %s units' % thinspace print '\tthick space: %s units' % thickspace print '\tfigure space: %s units' % figurespace print '\tzero-width space: 0' # hair space self.font.newGlyph('hairspace') self.font['hairspace'].width = hairspace self.font['hairspace'].unicode = unicode_hexstr_to_int('uni200A') self.font['hairspace'].update() # thin space self.font.newGlyph('thinspace') self.font['thinspace'].width = thinspace self.font['thinspace'].unicode = unicode_hexstr_to_int('uni2009') self.font['thinspace'].update() # thick space self.font.newGlyph('thickspace') self.font['thickspace'].width = thickspace self.font['thickspace'].unicode = unicode_hexstr_to_int('uni2004') self.font['thickspace'].update() # figure space self.font.newGlyph('figurespace') self.font['figurespace'].width = figurespace self.font['figurespace'].unicode = unicode_hexstr_to_int('uni2007') self.font['figurespace'].update() # zero-width space self.font.newGlyph('zerowidthspace') self.font['zerowidthspace'].width = 0 self.font['zerowidthspace'].unicode = unicode_hexstr_to_int('uni200B') self.font['zerowidthspace'].update() # done self.font.update() print print '...done.\n' else: print no_font_open
def apply_callback(self, sender): _hairspace = int(self.w._hairspace_value.get()) _thinspace = int(self.w._thinspace_value.get()) _thickspace = int(self.w._thickspace_value.get()) _figurespace = int(self.w._figurespace_value.get()) # boolstring = (False, True) if self.font is not None: # print info print 'creating space glyphs...\n' print '\thair space: %s units' % _hairspace print '\tthin space: %s units' % _thinspace print '\tthick space: %s units' % _thickspace print '\tfigure space: %s units' % _figurespace print '\tzero-width space: 0' # hair space self.font.newGlyph('hairspace') self.font['hairspace'].width = _hairspace self.font['hairspace'].unicode = unicode_hexstr_to_int('uni200A') self.font['hairspace'].update() # thin space self.font.newGlyph('thinspace') self.font['thinspace'].width = _thinspace self.font['thinspace'].unicode = unicode_hexstr_to_int('uni2009') self.font['thinspace'].update() # thick space self.font.newGlyph('thickspace') self.font['thickspace'].width = _thickspace self.font['thickspace'].unicode = unicode_hexstr_to_int('uni2004') self.font['thickspace'].update() # figure space self.font.newGlyph('figurespace') self.font['figurespace'].width = _figurespace self.font['figurespace'].unicode = unicode_hexstr_to_int('uni2007') self.font['figurespace'].update() # zero-width space self.font.newGlyph('zerowidthspace') self.font['zerowidthspace'].width = 0 self.font['zerowidthspace'].unicode = unicode_hexstr_to_int('uni200B') self.font['zerowidthspace'].update() # done self.font.update() print print '...done.\n' else: print 'No font selected, please close the dialog and try again.\n'
def apply_callback(self, sender): hairspace = int(self.w.hairspace_value.get()) thinspace = int(self.w.thinspace_value.get()) thickspace = int(self.w.thickspace_value.get()) figurespace = int(self.w.figurespace_value.get()) # boolstring = (False, True) if self.font is not None: # print info print "creating space glyphs...\n" print "\thair space: %s units" % hairspace print "\tthin space: %s units" % thinspace print "\tthick space: %s units" % thickspace print "\tfigure space: %s units" % figurespace print "\tzero-width space: 0" # hair space self.font.newGlyph("hairspace") self.font["hairspace"].width = hairspace self.font["hairspace"].unicode = unicode_hexstr_to_int("uni200A") self.font["hairspace"].update() # thin space self.font.newGlyph("thinspace") self.font["thinspace"].width = thinspace self.font["thinspace"].unicode = unicode_hexstr_to_int("uni2009") self.font["thinspace"].update() # thick space self.font.newGlyph("thickspace") self.font["thickspace"].width = thickspace self.font["thickspace"].unicode = unicode_hexstr_to_int("uni2004") self.font["thickspace"].update() # figure space self.font.newGlyph("figurespace") self.font["figurespace"].width = figurespace self.font["figurespace"].unicode = unicode_hexstr_to_int("uni2007") self.font["figurespace"].update() # zero-width space self.font.newGlyph("zerowidthspace") self.font["zerowidthspace"].width = 0 self.font["zerowidthspace"].unicode = unicode_hexstr_to_int("uni200B") self.font["zerowidthspace"].update() # done self.font.update() print print "...done.\n" else: print no_font_open