Latest 1.0.1
Homepage https://github.com/bornbrie/FontBook
License MIT
Platforms ios 9.0, requires ARC
Authors

An easy, swifty, and enum(ey) font manager for iOS

Prerequisites

  • Xcode 9+
  • Swift 4+
  • Access to font files to embed in project

Installation

Cocoapods

pod 'FontBook'

Manually

Copy FontBook.swift (link) into your Xcode project. Make sure to add it to your app’s target in Xcode.

Setup

First, copy the font files you want to use into your project. FontBook uses UIFont at its core so it accepts all standard font file formats. Be sure to select the relevent target and make sure that "Copy items if needed" option is checked.

Usage

import FontBook

Create an enum with a raw value of FontBook. For each font that you copied into your project, add a case and name it appropriately. Give each case a raw value matching the font file’s name.

enum Fonts: FontBook {
    case arial = "Arial"
    case arialItalic = "Arial Italic"
    case arialBold = "Arial Bold"
    case arialBoldItalic = "Arial Bold Italic"

    case helveticaNeue = "HelveticaNeue"
}

To access UIFont:

let font = Fonts.arial.rawValue.of(size: 12, color: .black)

Versioning

This project uses SemVer for versioning semantics. For all the available versions, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License – see the LICENSE.md file for details

Latest podspec

{
    "name": "FontBook",
    "version": "1.0.1",
    "swift_version": "4.0",
    "cocoapods_version": ">= 0.36",
    "authors": {
        "Brianna Lee": "[email protected]"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/bornbrie/FontBook",
    "source": {
        "git": "https://github.com/bornbrie/FontBook.git",
        "tag": "v1.0.1",
        "submodules": true
    },
    "summary": "An easy, swifty, and enum(ey) font manager for iOS",
    "requires_arc": true,
    "ios": {
        "frameworks": "UIKit"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "FontBook/**/*.{h,swift}"
}

Pin It on Pinterest

Share This