Latest 0.1.0
Homepage https://github.com/DenisLitvin/DynamicFonts
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Usage

There are two static methods on UIFont:

  1. UIFont.fixSized(_ size: CGFloat, family: FontTextFamily) – creates fix sized font with required font size and font family
  2. UIFont.dynamicallySized(for textStyle: FontTextStyle, family: FontTextFamily) – creates dynamically sized font for certain text style.

Parameters for FontTextStyle:

  • head(type)
  • body(type)
  • caption(type)

type represents the type of text you can choose from the following:

  • extraSmall
  • small
  • medium
  • large

Parameters for FontTextFamily: All the embedded font families, if you want it to support custom one, add case to FontTextFamily enumeration

Also you can use .bolded and .italicized on the font.

Example

textLabel.font = .dynamicallySized(for: .head(.medium), family: .avenir).bolded

Installation

CocoaPods:

Add the line pod "DynamicFonts" to your Podfile

Manual:

Clone the repo and drag the file DynamicFonts.swift into your Xcode project.

Platform support

  • iOS 8 and above

Author

DenisLitvin, [email protected]

License

DynamicFonts is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DynamicFonts",
    "version": "0.1.0",
    "summary": "The easy way to support dynamic text",
    "description": "This library helps to create dynamic and fixed size fonts programmaticaly, with wide wariety of font sizes and easy way to make the font bold or italic.",
    "homepage": "https://github.com/DenisLitvin/DynamicFonts",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DenisLitvin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DenisLitvin/DynamicFonts.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "DynamicFonts/Classes/**/*",
    "pushed_with_swift_version": "4"
}

Pin It on Pinterest

Share This