diff --git a/README.md b/README.md
index 329216c..9fbabaf 100644
--- a/README.md
+++ b/README.md
@@ -7,29 +7,31 @@ We'll start with some really basic markup:
Some Title
After including jQuery, [download and include the minified version of Lettering.js](http://github.com/davatron5000/Lettering.js/downloads), then a script block with the magical `.lettering()` method:
-
+
-
+
The resulting code will churn your `.fancy_title` and output the following:
- S
- o
- m
- e
-
- T
- i
- t
- l
- e
+ S
+ o
+ m
+ e
+
+ T
+ i
+ t
+ l
+ e
-Magical. Now the text is easy to manipulate in your CSS using an ordinal `.char#` pattern. This plugin assumes basic counting skills, but it's a pretty fast and easy way to get control over every letter.
+Magical. Now the text is easy to manipulate in your CSS using an ordinal `.char#` or alpha-numeric `.char-x` pattern. This plugin assumes basic counting and reading skills, but it's a pretty fast and easy way to get control over every letter.
+
+Special cases such as unicode characters or spaces are URL-escaped so a space has the class `.char-u20` and an ampersand will have the class `.char-u26`.
## Consult the Wiki, Pls
@@ -42,6 +44,12 @@ If you have an idea for the wiki, file an issue and we'll try and write somethin
## Best Practices & Kerning
We've found this to be a pretty quick and elegant solution to create typographical CSS3 posters. It's also a great solution for really custom type headings, while keeping the text selectable.
+You can create kerning pairs using the following CSS syntax as a guide:
+
+ .char-A + .char-V,
+ .char-V + .char-A { margin-left: -0.1em; }
+ .char-T + .char-o { margin-left: -0.1em; }
+
### Best Practices
Be smart and use sparingly. You'll probably break your browser if you try to wrap every letter on your page in a `span` tag, so don't do that. Look to use this in your Headings, Blockquotes, Asides, etc.
diff --git a/examples/index.html b/examples/index.html
index 97283ce..1e5a6a5 100644
--- a/examples/index.html
+++ b/examples/index.html
@@ -1,5 +1,5 @@
-
-
+
+
@@ -15,7 +15,7 @@
-
+
@@ -48,8 +50,9 @@
$("#demo1 h1").lettering();
$("#demo2 h1").lettering('words');
$("#demo3 p").lettering('lines');
- $("#demo4 h1").lettering('words').children("span").lettering();
- $("#demo5 h1").lettering().children("span").css({'display':'inline-block', '-webkit-transform':'rotate(-25deg)'});
+ $("#demo4 p").lettering('dropcap');
+ $("#demo5 h1").lettering('words').children("span").lettering();
+ $("#demo6 h1").lettering().children("span").css({'display':'inline-block', '-webkit-transform':'rotate(-25deg)'});
});
@@ -62,7 +65,7 @@
Lettering.JS
The following are some hokey examples of how you can implement LETTERING.JS.
-
+
Letters
@@ -82,7 +85,7 @@
The Result
Rainbow
-
+
@@ -105,31 +108,69 @@
The Result
+
+
Dropcap
+
$("#demo4 p").lettering('dropcap');
+
+
The Result
+
+
This is an amazing revolution in Typography. The possibilities are endless: a whole alphabet of dropcap class names like .dropcap-t.
The options object can be passed to any method and has 3 properties:
+
+
rgxp
+
Regular Expression
+ The first capturing parentheses determine what text gets wrapped in spans. You can customise it if desired, in the example above only the letters a-g will be wrapped in spans.
+
klass
+
String
+ This is used as the base of the CSS class name used in the span. Use this if you run into conflicts with existing class names or just prefer something else.
+
classes
+
Object
+ An object with 3 properties that determine the CSS class names applied to the spans:
+
+
klass: if true adds the plain base class name eg.<span class="letter">
+
text: if true adds a class containing the matched text eg.<span class="letter-a">
+
num: if true adds a class containing the numeric order of the letter eg.<span class="letter3">
+
+ All the above together would give you a class name like this: <span class="letter letter-a letter3"<
+