GithubHelp home page GithubHelp logo

arnavgupta180 / avfonts Goto Github PK

View Code? Open in Web Editor NEW
194.0 7.0 18.0 183 KB

AVFonts for change/swap fontname throughout app.

License: MIT License

Ruby 11.55% Swift 88.45%
avfonts font font-awesome font-size font-face fonts fontawesome font-end dynamicfontresize dynamicfont

avfonts's Introduction

AVFonts

CI Status Version License Platform

What's that for

AVFonts allows you to do anything you want to do with the fonts anywhere and everywhere in the app.

Why should you use this?

AVFonts can easily swap the system font or specific font you are using with the new font throughout the app. You can increment or decrement font size if needed, too. Now there's no need to select custom fonts in the Interface Builder. Save time by simply configuring its size and style, and then change "system font" to your "new font" everywhere with a single line of code. It's that easy.

Usage

1. import AVFonts to AppDelegate.

2. In didFinishLaunchingwithOptions change the font :

a) This will swap/change font from system or currentFontName to newFontName everywhere in the app.

AVFonts.changeFont(toFont: "Avenir-Heavy")
AVFonts.swapFont(currentFont: "Avenir-Light", toFont: "Avenir-Heavy")

b) Font swap/change for types provided i.e. [ .button, .label, .textField, .textView] throughout the app.

AVFonts.changeFont(toFont: "Avenir-Heavy", [.button, .label])
AVFonts.swapFont(currentFont: "Avenir-Light", toFont: "Avenir-Heavy", [.button, .label])

c) increment/decrement your orignal font size.

AVFonts.changeFont(toFont: "Avenir-Heavy", [.button,.label,.textfield], increment: 2)
AVFonts.changeFont(toFont: "Avenir-Heavy", [.button,.label,.textfield], increment: -2)

AVFonts.swapFont(currentFont: "Avenir-Light", toFont: "Avenir-Heavy", [.button, .label, .textfield], increment: 2)
AVFonts.swapFont(currentFont: "Avenir-Light", toFont: "Avenir-Heavy", [.button, .label, .textfield, .textview], increment: -2)

3. Call AVFonts.applyAVFonts() to apply all the changes.

Example

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

Requirements

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 10.2
  • Swift 5.0

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build AVFonts.

To integrate AVFonts into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
pod "AVFonts"
end

Then run the following command:

$ pod install

Author

Arnav Gupta, [email protected]

License

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

avfonts's People

Contributors

arnavgupta180 avatar nikans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

avfonts's Issues

can't use custom font

i have custom font configed in info.plist like below:
UIAppFonts

Canada Type - Gibson-Bold.otf
Canada Type - Gibson-BoldItalic.otf
Canada Type - Gibson-Italic.otf
Canada Type - Gibson-Light.otf
Canada Type - Gibson-SemiboldIt.otf
Canada Type - Gibson-SemiBold.otf
Canada Type - Gibson-Regular.otf
Canada Type - Gibson-LightIt.otf

code:
AVFonts.changeFont(toFont: "Gibson-Bold")

but console output: You entered an invalid Font Name .Please check your font name

not support custom font?

Method names do not follow Swift guidelines

Hi,

Looking at the readme:

AVFonts.changeFont( toFont: "Avenir-Heavy")
AVFonts.swapFont(currentFont: “Avenir-Light”, toFont: "Avenir-Heavy")

Those do not follow the Swift guidelines.

Consider the alternatives:

AVFonts.changeFont(to: “Avenir-Heavy")
AVFonts.change(toFont: “Avenir-Heavy")
AVFonts.swapFont(from: “Avenir-Light”, to: “Avenir-Heavy”)
AVFonts.swap(fromFont: “Avenir-Light”, toFont: “Avenir-Heavy”)

Not work in iPad

When using this library, Application stuck in splash screen. When comment the AVFonts.applyAVFonts() all works perfect. What would be the issue?

when i pause the debugger it stops here:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.