README.md
1Gumby FitText
2=============
3
4This module resizes text to fill the available space. Refactored into a Gumby UI module from the awesome [FitText.js](http://fittextjs.com/). For more detailed documentation please check out the [Gumby docs](http://gumbyframework.com).
5
6Installation
7------------
8
9A bower package is available to install this module into your project. We recommend using this method to install Gumby and any extra UI modules, however you can alternatively move the individuals files into your project.
10
11 $ bower install gumby-fittext
12
13Include gumby.fittext.js in the same fashion as your other UI modules, after gumby.js and before gumby.init.js. In production you should minify JavaScript files into a single optimized gumby.min.js file, ensuring the order (gumby.js, UI modules, gumby.init.js) is retained.
14
15 <!--
16 Include gumby.js followed by UI modules.
17 Or concatenate and minify into a single file-->
18 <script src="/bower_components/gumby/js/libs/gumby.js"></script>
19 <script src="/bower_components/gumby/js/libs/ui/gumby.skiplink.js"></script>
20 <script src="/bower_components/gumby/js/libs/ui/gumby.toggleswitch.js"></script>
21 <script src="/bower_components/gumby-images/gumby.images.js"></script>
22 <script src="/bower_components/gumby/js/libs/gumby.init.js"></script>
23
24 <!-- In production minifiy and combine the above files into gumby.min.js -->
25 <script src="js/gumby.min.js"></script>
26 <script src="js/plugins.js"></script>
27 <script src="js/main.js"></script>
28
29Usage
30-----
31Using the FitText module is simple. Add the class `.fittext` to any element for the module to initialize with default settings. There are two optional attributes that can be used to customize the behaviour. Specify the rate at which the font size changes using `gumby-rate`, this is an exact copy of [FitText.js's](http://fittextjs.com/) Compressor value. You can also specify minimum and maximum font sizes using the `gumby-sizes` attribute, specify `min|max` sizes separated by a pipe.
32
33 <h1 class="fittext" gumby-rate="0.8" gumby-sizes="14|60">Hello this text will resize to fill the available area</h1>
34
35
36**MIT Open Source License**
37
38Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
39documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
40rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
41persons to whom the Software is furnished to do so, subject to the following conditions:
42
43The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
44Software.
45
46THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
47WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
48COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
49OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50
51
52
53