Skip to content

Instantly share code, notes, and snippets.

@aclissold
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aclissold/978672aed0eefca34942 to your computer and use it in GitHub Desktop.
Save aclissold/978672aed0eefca34942 to your computer and use it in GitHub Desktop.
Font Playground
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>

Font Playground

A tiny Playground for UIFont. Inspect title to visualize attributes.

Usage: clone this gist and rename the folder to Fonts.playground.

import UIKit
UIFont.familyNames()
UIFont.fontNamesForFamilyName("Avenir Next")
let attributes = [NSFontAttributeName: UIFont(name: "AvenirNext-UltraLightItalic", size: 28.0)]
let text = NSMutableAttributedString(string: "the quick brown fox jumps over the lazy dog", attributes: attributes)
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=20&amp;CharacterRangeLoc=15&amp;EndingColumnNumber=21&amp;EndingLineNumber=2&amp;StartingColumnNumber=1&amp;StartingLineNumber=2&amp;Timestamp=435558329.975895">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=44&amp;CharacterRangeLoc=36&amp;EndingColumnNumber=45&amp;EndingLineNumber=3&amp;StartingColumnNumber=1&amp;StartingLineNumber=3&amp;Timestamp=435558329.975895">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=4&amp;CharacterRangeLoc=183&amp;EndingColumnNumber=9&amp;EndingLineNumber=7&amp;StartingColumnNumber=5&amp;StartingLineNumber=7&amp;Timestamp=435558329.975895">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment