A simple RubyMotion wrapper for iOS's Dynamic Type to make it easier to set the fonts, as well as getting the information you need and notifications for responding to the layout changes.
The only reason I can keep making gems and keep them up to date is because lovely people like yourself support me. I create the Motion in Motion subscription series which you can purchase monthly or by the year, I also have an entire school for Mobile (RubyMotion) development. All support, even small amounts really helps.
Add this line to your application's Gemfile:
gem 'motion-dynamic-type'
And then execute:
$ bundle
Or install it yourself as:
$ gem install motion-dynamic-type
Anything on RubyGems should be stable and fine to use, as this is early days though, the API is prone to change.
This is the available functionality so far. Eventually this will be a helpful tool for heavily simplifying all the things required for integrating Dynamic Type into your app, including responding to the size changing and working out sizing.
These methods get a font matching up the the text style. They're just a very simple wrapper around UIFont.preferredFontForTextStyle
, check out the source code.
MDT::Font.large_title
MDT::Font.title_one
MDT::Font.title_two
MDT::Font.title_three
MDT::Font.headline
MDT::Font.subhead
MDT::Font.body
MDT::Font.caption_one
MDT::Font.caption_two
MDT::Font.footnote
- Fork it ( http://github.com/wndxlori/motion-dynamic-type/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Test your changes (
rake spec
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request