Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BonMot Lightning Talk @ AltConf 2016

BonMot Lightning Talk @ AltConf 2016

Learn about BonMot, a library for making beautiful typography on iOS.

Zev Eisenberg

June 23, 2016
Tweet

More Decks by Zev Eisenberg

Other Decks in Technology

Transcript

  1. 8:21 PM - 13 Mar 2015 NSAttributedString is great because

    it’s the result of years of research that have shown coupling between data and presentation to be ideal. @hyperspacemark Mark Adams
  2. let label = UILabel() let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineHeightMultiple =

    0.7 paragraphStyle.alignment = .Center let attributes = [ NSFontAttributeName: UIFont.systemFontOfSize(150), NSForegroundColorAttributeName: UIColor.whiteColor(), NSParagraphStyleAttributeName: paragraphStyle, ] label.attributedText = NSAttributedString( string: "Lightning talk", attributes: attributes) Lightning talk
  3. let label = UILabel() let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineHeightMultiple =

    0.7 paragraphStyle.alignment = .Center let attributes = [ NSFontAttributeName: UIFont.systemFontOfSize(150), NSForegroundColorAttributeName: UIColor.whiteColor(), NSParagraphStyleAttributeName: paragraphStyle, ] label.attributedText = NSAttributedString( string: "Lightning talk", attributes: attributes) Lightning talk
  4. let baseChain = BONChain() .color(.whiteColor()) .font(.systemFontOfSize(50)) let titleChain = baseChain

    .alignment(.Left) let yearChain = baseChain .alignment(.Right) Metropolis 1925 1984 1949 Fever 1973 2000 Peter Pan 1911 Catch-22 1961
  5. let baseChain = BONChain() .color(.whiteColor()) .font(.systemFontOfSize(50)) let titleChain = baseChain

    .alignment(.Left) let yearChain = baseChain .alignment(.Right) Metropolis 1925 1984 1949 Fever 1973 2000 Peter Pan 1911 Catch-22 1961
  6. let baseChain = BONChain() .color(.whiteColor()) .font(.systemFontOfSize(50)) let titleChain = baseChain

    .alignment(.Left) let yearChain = baseChain .figureSpacing(.Tabular) .alignment(.Right) Metropolis 1925 1984 1949 Fever 1973 2000 Peter Pan 1911 Catch-22 1961
  7. let baseChain = BONChain() .color(.whiteColor()) .font(.systemFontOfSize(50)) let titleChain = baseChain

    .alignment(.Left) .pointTracking(22) let yearChain = baseChain .figureSpacing(.Tabular) .alignment(.Right) M e t r o p o l i s 1925 1 9 8 4 1949 F e v e r 1 9 7 3 2000 P e t e r P a n 1911 C a t c h - 2 2 1961
  8. I went to AltConf, and it was not too cold!

    Je suis allé à AltConf, et il n’était pas trop froid!
  9. let string = "I went to AltConf, and it was

    <emphasis>not</emphasis> too cold!" I went to AltConf, and it was not too cold!
  10. let string = "I went to AltConf, and it was

    <emphasis>not</emphasis> too cold!" let chain = BONChain() .string(string) .font(.systemFontOfSize(50)) .color(.whiteColor()) .tagStyles([ "emphasis": BONChain() .font(.boldSystemFontOfSize(50)) .color(myBlue) ]) I went to AltConf, and it was not too cold!
  11. let string = "I went to AltConf, and it was

    <emphasis>not</emphasis> too cold!" let chain = BONChain() .string(string) .font(.systemFontOfSize(50)) .color(.whiteColor()) .tagStyles([ "emphasis": BONChain() .font(.boldSystemFontOfSize(50)) .color(myBlue) ]) I went to AltConf, and it was not too cold!
  12. let string = "I went to AltConf, and it was

    <emphasis>not</emphasis> too cold!" let chain = BONChain() .string(string) .font(.systemFontOfSize(50)) .color(.whiteColor()) .tagStyles([ "emphasis": BONChain() .font(.boldSystemFontOfSize(50)) .color(myBlue) ]) "Je suis allé à AltConf, et il <emphasis>n’</ emphasis>était <emphasis>pas</emphasis> trop froid!" I went to AltConf, and it was not too cold! Je suis allé à AltConf, et il n’était pas trop froid!