Skip to content

dcoufal/DECResizeFontToFitRect

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
Pod
 
 
 
 
 
 
 
 
 
 

DECResizeFontToFitRect

A simple library that can calculate the required point size for a font to fit any given string in any given rectangle, maximizing the size of the string (within the specified maximum and minimum point sizes).

This code has been used since 2010 in the Just Big Text product.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

DECResizeFontToFitRect is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DECResizeFontToFitRect"

Author

David Coufal, dcoufal@alum.mit.edu

License

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

Release History

1.0 - Initial Public Release - March 2016

1.1 - Update to Swift 3 - November 2016

About

A simple iOS algorithm to calculate the optimal font size given a font, a rectangle and a string. Written in swift. Available as a cocoapod.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published