예제 #1
0
 def chooseFont_(self, sender):
     fm = NSFontManager.sharedFontManager()
     basicAttrs = getBasicTextAttributes()
     fm.setSelectedFont_isMultiple_(basicAttrs[NSFontAttributeName], False)
     fm.orderFrontFontPanel_(sender)
     fp = fm.fontPanel_(False)
     fp.setDelegate_(self)
예제 #2
0
 def chooseFont_(self, sender):
     fm = NSFontManager.sharedFontManager()
     basicAttrs = getBasicTextAttributes()
     fm.setSelectedFont_isMultiple_(basicAttrs[NSFontAttributeName], False)
     fm.orderFrontFontPanel_(sender)
     fp = fm.fontPanel_(False)
     fp.setDelegate_(self)
예제 #3
0
 def textFontChanged_(self, notification):
     basicAttrs = getBasicTextAttributes()
     font = basicAttrs[NSFontAttributeName]
     self.fontPreview.setFont_(font)
     size = font.pointSize()
     if size == int(size):
         size = int(size)
     s = u"%s %s" % (font.displayName(), size)
     self.fontPreview.setStringValue_(s)
예제 #4
0
 def textFontChanged_(self, notification):
     basicAttrs = getBasicTextAttributes()
     font = basicAttrs[NSFontAttributeName]
     self.fontPreview.setFont_(font)
     size = font.pointSize()
     if size == int(size):
         size = int(size)
     s = u"%s %s" % (font.displayName(), size)
     self.fontPreview.setStringValue_(s)
예제 #5
0
 def changeFont_(self, sender):
     oldFont = getBasicTextAttributes()[NSFontAttributeName]
     newFont = sender.convertFont_(oldFont)
     if oldFont != newFont:
         setTextFont(newFont)
예제 #6
0
 def changeFont_(self, sender):
     oldFont = getBasicTextAttributes()[NSFontAttributeName]
     newFont = sender.convertFont_(oldFont)
     if oldFont != newFont:
         setTextFont(newFont)