本文整理汇总了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)
示例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()
示例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)
示例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)
示例5: bold
# 需要导入模块: from AppKit import NSFont [as 别名]
# 或者: from AppKit.NSFont import boldSystemFontOfSize_ [as 别名]
def bold(size):
return {NSFontAttributeName: NSFont.boldSystemFontOfSize_(size)}
示例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