Latest 1.0.2
License MIT
Platforms ios 8.0, tvos 9.0, requires ARC

Load fonts in your iOS app without any hassle

Swift Support Platform CocoaPods



  • you want an effortless way of adding and using custom fonts in your iOS projects

  • you want to load fonts from your custom Bundle(s)

  • you want to load and use fonts not bundled with the app

then Elefont is what you need.


  • [x] Imports fonts from Bundle.main
  • [x] Imports fonts from custom Bundle(s)
  • [x] Imports fonts from any local URL or path
  • [x] CocoaPods Support



pod 'Elefont'


  1. Download Elefont.
  2. Copy Sources/Elefont.swift into your project.


A typical custom font integration without Elefont goes like this:

  1. Include your fonts to the Xcode project;
  2. Create a list with those fonts and update the Info.plist file;
  3. Use the fonts in the Storyboard/Xib or programmatically with
    UIFont(name: "<font-postscript-name>", size: <size>)

If you’ve integrated custom fonts in your iOS projects (I’m assuming you did given that you looked for a better solution here), then you know what a hassle step 2 (ex: wrong font file names) and step 3 (wrong font PostScript names, which is not the font file names).

Luckily, Elefont solves those two annoyances with this line:

which will load all the fonts in Bundle.main, completely removing step 2 and providing the PostScript names for the loaded fonts.

But what if your fonts are in a custom Bundle? Well, no problem: <custom_bundle_object>)

I’ve mentioned earlier that Elefont can load fonts from local URL or path. Here’s how you can do that:
// or

Each of the methods above can be called with a completion handler, in case you need a list of all of the loaded fonts generated by the load operation:* arguments */) { fonts in

If you need to debug font loading, set debugEnabled = true:

Elefont.debugEnabled = true

Public API

Below are all the possible variations of Elefont usage (fonts is an array of Strings containing PostScript font names):

// 1. Load from main Bundle without callback

// 2. Load from main Bundle with callback { fonts in

// 3. Load from custom Bundle without callback

// 4. Load from custom Bundle with callback { fonts in

// 5. Load from local URL without callback

// 6. Load from local URL with callback { fonts in

// 7. Load from local path without callback

// 8. Load from local path with callback { fonts in

Demo Project

You can use the ElefontDemo/ElefontDemo.xcodeproj project to see Elefont for loading fonts from main Bundle and from a URL path.
Press "Load fonts" button to see the texts update with their corresponding fonts.

Created and maintained by

Mihai Cristian Tanase

Latest podspec

    "name": "Elefont",
    "version": "1.0.2",
    "swift_version": "4.2",
    "summary": "Load fonts in your iOS app without any hassle.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Mihai Cristian Tanase": "[email protected]"
    "description": "Load fonts from main Bundle, custom Bundle or any local path on the device with only one line.",
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0"
    "source": {
        "git": "",
        "tag": "1.0.2"
    "source_files": "Sources/",
    "requires_arc": true

Pin It on Pinterest

Share This