• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

morizotter/SwiftFontName: OS font complements library. Localized font supported.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

morizotter/SwiftFontName

开源软件地址(OpenSource Url):

https://github.com/morizotter/SwiftFontName

开源编程语言(OpenSource Language):

Swift 91.6%

开源软件介绍(OpenSource Introduction):

SwiftFontName

SwiftFontName is font name complements and supports localized font library.

You don't need to search font name any more with SwiftFontName. When using UIFont, you sometimes search font name string because UIFont needs string font name value. Font family name and font name don't have organized naming rule, so it's painful to search correct string. With SwiftFontName, font name candidates shows up when you put first word of font family name.

Version License Platform Carthage compatible

Helvetica

Features

  • Complements for all font names in OS version.
  • Localized font name support.

Usage

Font Name

To start using SwiftFontName, write the following line wherever you want to user font complements:

import SwiftFontName

Then:

FontName.HelveticaNeueLight // HelveticaNeue-Light

It is really simple!

Localized Font Name

And you can select localized font:

LocalizedFontName(FontName.Copperplate, ["ja": FontName.HiraKakuProNW6, "en": FontName.HelveticaNeueLight])

It means that when preferredLanguage is Japanese, use HiraKakuProNW6. And when preferredLanguage is English, use HelveticaNeue-Light. And in other case, use Copperplate.

Requirements

  • iOS8.0 or later
  • Xcode 10.2
  • Swift 5

Installation

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

CocoaPods:

use_frameworks!
pod 'SwiftFontName', '~> 4.0.0'

Carthage:

github "morizotter/SwiftFontName" ~> 4.0

Manually

To copy FontName.swift and LocalizedFontName.swift in SwiftFontName directory, you can use this library, too.

Contribution

  1. Fork
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

Naoki Morita, [email protected]

License

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap