WP-ragadjust – adjust your rag, WordPress style!

banner-772x250

Adjust your rag? What??

In typography, “rag” refers to the irregular or uneven vertical margin of a block of type. Usually it’s the right margin that’s ragged (as in the flush left/rag right setting), but either or both margins can be ragged
fonts.com

I’m a true nerd for all things typography and have often been known to bore Hayley by pointing out typefaces I see in the ‘real world’.

The level of detail Mark Boulton discussed in his 24 ways article this year really got me going (well worth a read if you’re a fellow typo-geek). And I was delighted to find, as I read on that Mr Nathan Ford had put theory into practise and written a nifty little script to address the typographical violations outlined in Marks post which can harm readability.

My immediate reaction was “I need to add this script to Highwind and our starter theme at WooThemes.”

But no. A big theme for me late 2013 (and continued into 2014) is the separation of code in our products, themes & plugins alike. Adding this script to one theme (which would then become 2, 3, 4 themes) makes no sense from a code management perspective. The theory is generic enough to be applied to almost any web site so duplicating code multiple times would only end one way; badly, with lots of my hair torn from my head lying on the floor. A plugin makes much more sense in this regard, as it does for so many other features we find ourselves building for WordPress these days.

And so, WP ragadjust was born. Catchy name, right? It’s by far one of the simplest plugins you’re ever going to see / use. Essentially all it does it enqueue a script with some filters for the customisation thereof. But the little things can make a big difference and for me, readability is just about the most important facet of a web site.

Good typographic design — on the web, in print; anywhere, in fact — relies on small, measurable improvements across an entire body of work.

So what exactly does ragadjust.js do? Put simply, it addresses each of the violations outlined in Marks post elegantly via the insertion of non-breaking spaces where appropriate. The result is improved readability .

So enjoy! You can install WP ragadjust from the dashboard by searching ‘wp ragadjust’ and you can even contribute on github if the mood takes you. You can also download directly from wp.org:

Download WP ragadjust

Caveat : ragadjust.js only supports English prepositions currently. If your site is written in a different language that part of the script isn’t going to work.