Weblog Archive

Small caps

Fri, 25 Jul 2008 at 23:41 • Chyetanya Kunte • Filed under Plugins

If you have ever read the Economist’s print edition, you will have noticed the elegance of those small capitalized words, which fit right in the flow of text. Or if you’re in the print business, and you’re a typography nut, then I’m sure you use Ctrl+Shift+K in Microsoft Word to transform certain select words into small caps.

You can also achieve this for web typography by defining a simple style, like the following.

abbr { font-variant:small-caps }

If the text you’re trying to style has already been typed in capitals, then this above style does nothing. To overcome this, you’d do the following:

abbr { text-transform:lowercase; font-variant:small-caps }

The only problem with this though is that all capitalized words need to be enclosed within abbr tags. On my site, I have over a few hundred posts that have capitalized words. I don’t have the energy to sift through them all just to update the markup. I searched for a WordPress plugin. Apparently there aren’t any. So, I wrote one.

This plugin looks for capitalized words with 2 or more letters, and then applies the opening and closing abbr tags to such words. Now, all I have to do is add the abbr styling to my style.css to make it look small capitalized.

Let me digress here to put forth a couple of assumptions.

  1. I use abbr, since most capitalized words I use are primarily abbreviations.
  2. I apply acronym to those capitalized words that require an explanation.

Download: the small caps plugin from WordPress Plugin Directory.

Install and use

  1. Extract and upload the small-caps.php file to your WordPress plugin folder (wp-content/plugins/). Go to Plugins page and activate “Small caps” plugin.
  2. Styling: Copy-paste the following to your current WordPress theme’s style.css file: abbr { text-transform:lowercase; font-variant:small-caps }

FAQ

  1. This plugin applies the abbr tag to words already in capitals. (Without adding the styling above, the plugin does not by itself automatically apply styling—and this is intentional.)
  2. On the web, I think, small caps probably look best in serif fonts larger than 13pixels in size.
  3. Due to the way it looks up a word within white spaces using REGEX, some linked capitalized words are not transformed to small caps—depending upon the punctuation used prior to or after the word.

[ Ads ]

Related posts

Following list is auto-generated, based on this post's context as possibly related. You may, however, occasionally find some in this list unrelated, but nevertheless, we sincerely hope that you'll enjoy them too.

Respond privately

Comments are closed, but you may respond privately to “Small caps.” (Your response will not be published.)