當前位置: 首頁>>代碼示例>>Python>>正文


Python NSFont.boldSystemFontOfSize_方法代碼示例

本文整理匯總了Python中AppKit.NSFont.boldSystemFontOfSize_方法的典型用法代碼示例。如果您正苦於以下問題:Python NSFont.boldSystemFontOfSize_方法的具體用法?Python NSFont.boldSystemFontOfSize_怎麽用?Python NSFont.boldSystemFontOfSize_使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AppKit.NSFont的用法示例。


在下文中一共展示了NSFont.boldSystemFontOfSize_方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: attributed_text_at_size

# 需要導入模塊: from AppKit import NSFont [as 別名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 別名]
def attributed_text_at_size(text, size):
	paragraph_style = NSMutableParagraphStyle.new()
	paragraph_style.setAlignment_(NSCenterTextAlignment)
	attrs = {
		NSParagraphStyleAttributeName: paragraph_style,
		NSFontAttributeName: NSFont.boldSystemFontOfSize_(size),
		NSForegroundColorAttributeName: NSColor.whiteColor()
	}
	return NSAttributedString.alloc().initWithString_attributes_(text, attrs)
開發者ID:0x73,項目名稱:Flashlight,代碼行數:11,代碼來源:large_text.py

示例2: _set_defaults

# 需要導入模塊: from AppKit import NSFont [as 別名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 別名]
 def _set_defaults(self):
     self._inner_padding = WIZARD_BOX_PADDING
     self.titleCell().setLineBreakMode_(NSLineBreakByWordWrapping)
     self.setTitleFont_(NSFont.boldSystemFontOfSize_(14))
     self.titleCell().setTextColor_(Colors.black)
     self.titleCell().setAlignment_(NSLeftTextAlignment)
     self.setBackgroundColor_(Colors.setup_wizard_background)
     self.setBorderColor_(Colors.setup_wizard_border)
     self._resize_content_view()
開發者ID:,項目名稱:,代碼行數:11,代碼來源:

示例3: __init__

# 需要導入模塊: from AppKit import NSFont [as 別名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 別名]
    def __init__(self, dimensions, font):
        font_name = font.info.familyName
        attribution = "{} by {}".format(font_name, font.info.designer)
        attribution_attributes = {
            NSFontAttributeName: NSFont.systemFontOfSize_(NSFont.systemFontSize()),
            NSForegroundColorAttributeName: NSColor.whiteColor()
        }
        formatted_attribution = NSMutableAttributedString.alloc().initWithString_attributes_(attribution, attribution_attributes)
        formatted_attribution.addAttribute_value_range_(NSFontAttributeName, NSFont.boldSystemFontOfSize_(NSFont.systemFontSize()), [0, len(font_name)])

        super(AttributionText, self).__init__(dimensions, formatted_attribution)
開發者ID:ghostlines,項目名稱:ghostlines-robofont,代碼行數:13,代碼來源:attribution_text.py

示例4: layout

# 需要導入模塊: from AppKit import NSFont [as 別名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 別名]
    def layout(self):
        self._thumbnail = ThumbnailBoxView.alloc().initWithFrame_(NSZeroRect)
        self._thumbnail.setImage_(Images.Box64)
        self._thumbnail.setImageAlignment_(NSImageAlignCenter)
        self._thumbnail.setImageScaling_(NSScaleToFit)
        self._thumbnail.setFrameSize_(self.THUMBNAIL_SIZE)
        self._thumbnail.setFrameOrigin_(self.THUMBNAIL_ORIGIN)
        self._thumbnail.setShadowOffset_(self.SHADOW_OFFSET)
        self._thumbnail.setShadowBlurRadius_(self.SHADOW_BLUR)
        self._thumbnail.setShadowColor_(NSColor.blackColor().colorWithAlphaComponent_(0.3))
        self._label = NSTextField.createLabelWithText_font_('', NSFont.boldSystemFontOfSize_(13))
        self._label.setFrameOrigin_(self.LABEL_ORIGIN)
        self._progress_bar = NSProgressIndicator.alloc().initWithFrame_(NSRect(self.PROGRESS_ORIGIN, self.PROGRESS_SIZE))
        self._progress_bar.setStyle_(NSProgressIndicatorBarStyle)
        self._progress_bar.setIndeterminate_(YES)
        self._progress_bar.setFrameOrigin_(self.PROGRESS_ORIGIN)
        self._estimate = NSTextField.createLabelWithText_font_('', NSFont.systemFontOfSize_(NSFont.smallSystemFontSize()))
        self._estimate.setFrameOrigin_(self.ESTIMATE_ORIGIN)
        self._hide_button = self.addNormalRoundButtonWithTitle_action_(MiscStrings.hide_button, self.handleHideButton_)
        self._hide_button.setKeyEquivalent_(ENTER_KEY)
        self._hide_button.alignRightInSuperview()
        self._hide_button.alignBottomInSuperview()
        self._cancel_button = self.addNormalRoundButtonWithTitle_action_(MiscStrings.cancel_button, self.handleCancelButton_)
        self._cancel_button.placeLeftOfButton_(self._hide_button)
        self.addSubview_(self._thumbnail)
        self.addSubview_(self._label)
        self.addSubview_(self._progress_bar)
        self.addSubview_(self._estimate)

        @message_sender(AppHelper.callAfter)
        def handleMessage(message):
            self._label.setStringValue_(message)
            self._label.sizeToFit()

        @message_sender(AppHelper.callAfter)
        def handleTotalBytes(total_bytes):
            self._progress_bar.setIndeterminate_(YES if total_bytes == 0 else NO)
            self._progress_bar.setMinValue_(0.0)
            self._progress_bar.setMaxValue_(total_bytes)
            self._progress_bar.setDoubleValue_(self.ui.cur_bytes.get())

        @message_sender(AppHelper.callAfter)
        def handleCurBytes(cur_bytes):
            self._progress_bar.setDoubleValue_(cur_bytes)
            self._estimate.setStringValue_(self.ui.get_remaining_message())
            self._estimate.sizeToFit()

        @message_sender(AppHelper.callAfter)
        def handleLastPhoto(path):
            if path:
                if time.time() - self.last_photo_time > self.THUMBNAIL_TIMEOUT:
                    image = NSImage.alloc().initByReferencingFile_(unicode(path))
                    if image.isValid():
                        self._thumbnail.setBorder_(True)
                        self._thumbnail.setImage_(image)
                        self.last_photo_time = time.time()
            else:
                self._thumbnail.setBorder_(False)
                self._thumbnail.setImage_(Images.Box64)

        handleMessage(self.ui.message.get())
        handleTotalBytes(self.ui.total_bytes.get())
        handleCurBytes(self.ui.cur_bytes.get())
        handleLastPhoto(self.ui.last_photo.get())
        self.ui.message.register(handleMessage)
        self.ui.total_bytes.register(handleTotalBytes)
        self.ui.cur_bytes.register(handleCurBytes)
        self.ui.last_photo.register(handleLastPhoto)
開發者ID:,項目名稱:,代碼行數:70,代碼來源:

示例5: bold

# 需要導入模塊: from AppKit import NSFont [as 別名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 別名]
 def bold(size):
     return {NSFontAttributeName: NSFont.boldSystemFontOfSize_(size)}
開發者ID:jackjennings,項目名稱:Mechanic,代碼行數:4,代碼來源:text.py

示例6: DefconAppKitTopAnchoredNSView

# 需要導入模塊: from AppKit import NSFont [as 別名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 別名]
class DefconAppKitTopAnchoredNSView(NSView):

    def isFlipped(self):
        return True


# title attributes
shadow = NSShadow.alloc().init()
shadow.setShadowColor_(NSColor.colorWithCalibratedWhite_alpha_(1, 1))
shadow.setShadowBlurRadius_(1.0)
shadow.setShadowOffset_((1.0, -1.0))
titleControlAttributes = {
    NSForegroundColorAttributeName: NSColor.colorWithCalibratedWhite_alpha_(.4, 1),
    NSShadowAttributeName: shadow,
    NSFontAttributeName: NSFont.boldSystemFontOfSize_(NSFont.systemFontSizeForControlSize_(NSSmallControlSize))
}


# all script and language tags
_scriptTags = """arab
armn
beng
bopo
brai
byzm
cans
cher
hani
cyrl
DFLT
開發者ID:andyclymer,項目名稱:defconAppKit,代碼行數:32,代碼來源:openTypeControlsView.py


注:本文中的AppKit.NSFont.boldSystemFontOfSize_方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。