BonMot
BonMot copied to clipboard
Beautiful, easy attributed strings in Swift
Some languages interpret certain character sets differently. `NSAttributedString` supports this with `kCTLanguageAttributeName` as the key and a string language specifier line `"en"` as the value. This should be fairly easy...
hi is it possible to add `NSStrokeColorAttributeName` , `NSStrokeWidthAttributeName` and `NSShadowAttributeName` to StringStyle? thanks
You can use `UIFontDescriptorCharacterSetAttribute` to exclude certain character sets from a font, forcing the text system to use a fallback system for drawing. In the example from WWDC 2013 session...
It's a useful way to add support for your favorite OpenType feature without needing BonMot to support it natively.
Given this type of style: ``` swift let string = try? NSAttributedString.composed( ofXML: content, baseStyle: .style( .font(UIFont(name: "GillSans-Light", size: 20)!), .lineHeightMultiple(1.8), .color(.darkGray)), rules: [ .style("black", .style( .color(.white), .backgroundColor(.black), .font(UIFont(name: "SuperClarendon-Black",...
From UIKitBonMotTests.swift: ``` swift func writeTestSegmentedControl() {} func writeTestNavigationBar() {} func writeTestToolbar() {} func writeTestViewController() {} func writeTestBarButtonItem() {} ```
Asks: - Ability to highlight a given range of text - Ability to adjust the size / padding of the highlighting rect - Should work for the supported text alignment...
If you embed an image in a string, and shift the image down with `.baselineOffset(-10.0f)` (for example), the next line in wrapped text will be farther away from the line...
Example: ![Image of Yaktocat](http://cdn.raizlabs.com/dev/wp-content/uploads/sites/10/2015/08/anatomy-of-type.gif) The text would perhaps be drawn on tap or selection.
From the iOS 8.3 `UILabel` documentation: > To turn on auto-kerning in the label, set `NSKernAttributeName` of the string to `[NSNull null]`. To research - What exactly does "auto-kerning" mean...