Menu
  • HOME
  • TAGS

How to set heading, subheading, body, footnote, and captions font for dynamic type text styles in Swift?

ios,swift,dynamic-typing,textkit,text-styling

This tutorial had some code samples that showed how to do it. @IBOutlet weak var textView: UITextView! @IBAction func applyHeadlineStyle(sender: AnyObject) { textView.font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline) } @IBAction func applySubHeadlineStyle(sender: AnyObject) { textView.font = UIFont.preferredFontForTextStyle(UIFontTextStyleSubheadline) } @IBAction func applyBodyStyle(sender: AnyObject) { textView.font = UIFont.preferredFontForTextStyle(UIFontTextStyleBody) } @IBAction func applyFootnoteStyle(sender: AnyObject) {...

How to strikeout text of QStandardItem in Qt/PyQt?

qt,pyqt,pyside,text-styling,qstandarditem

setStrikeOut returns void and you should not pass it as the argument for setFont. You should pass an instance of QFont there. It would be better to retrieve the font of the item in question, set its strikeout property, and then set this revised QFont as the new font of...

Two different colors in one word in an NSAttributedString

ios,swift,cocoa-touch,nsattributedstring,text-styling

It took me a day to ponder, but \0 was the trick. NSMutableAttributedString(string: text) var words:[NSString] = text.componentsSeparatedByString("\0")...

Stylizing text within a div

html,css,css3,text,text-styling

If this is an unusual font you should probably stick to using an image. If a user doesn't have the font you specify in CSS its going to default to something that is ugly. YES - you can embed the font into CSS by using @font-face in CSS3. But you...

JavaFX 8 - How to change the color of the prompt text of a NOT editable combobox via CSS?

css,combobox,stylesheet,javafx-8,text-styling

When the ComboBox is not editable, there is no TextField, and the property -fx-prompt-text-fill is no longer valid, since the control displayed instead, a ListCell, doesn't extend TextInputControl. In order to set the style of this cell, we can provide our custom styled ListCell: @Override public void start(Stage primaryStage) {...