Clagnut

Published in Brighton, UK

Whatever happened to font-stretch?

19 May 2009

5 comments

The font-stretch property was introduced in CSS 2.0 over ten years ago, but was culled in the transition to CSS 2.1. It now languishes in the CSS 3 Fonts module. The property instructed browsers to select a ‘normal, condensed, or extended face from a font family’. Its removal from CSS 2.1 was due to a complete lack of implementation by browsers. Unfortunately this leaves us with a gaping hole regarding font support.

Many professional typefaces are designed with extended and condensed styles. This is particularly prevalent in sans-serif faces such as Myriad Pro, Futura, Univers and of course Helvetica. Another such font is American Typewriter, which is shipped with Mac OS X and comes with a condensed style.

So how does one specify text to be rendered in American Typewriter Condensed? Using font-stretch we would have done this:

p {
  font-family:"American Typewriter", monospace;
  font-stretch:condensed; }

The font-stretch property is well defined. As you can see it takes keywords, covering the range from ultra-condensed to ultra-expanded. But as stated earlier, it is no longer in the CSS 2 spec, and hence (and because) it is not supported in any browser at the time of writing.

Using the methodology I described for font-weight, there is a workaround based on font-family. We can specify American Typewriter Condensed as follows:

p {
  font-family:"AmericanTypewriter-Condensed",
   "American Typewriter Condensed",
   "American Typewriter", monospace}

As with specifying font weights in this manner, there is a caveat that any widened or otherwise styled text will require a further font-family rule. There is also the caveat – in this case – that it doesn’t work at all on Firefox 3. See for yourself in the test case.

Because Firefox 3 respects font-family rules properly; that is to say it goes by the font family name, not the individual font name; it ignores the ‘Condensed’ font names. This inherently eliminates the possibility of displaying the condensed style using the font-family workaround.

So how will this situation be rectified? If font-stretch were still in CSS 2, browser makers would be trying to support it. But Microsoft won’t implement anything from CSS 3 until it is nailed down to a Candidate Recommendation. Webkit and Mozilla have higher CSS 3 priorities. And the CSS working group won’t reintroduce font-stretch to CSS 2 until someone implements it. Catch 22.

As I see it, our hopes lay at the feet of someone attending to either Webkit Bug 12530 or Mozilla Bug 3512. I would if I could. Can you?

more

A lovely spot for lunch

View A lovely spot for lunch on Flickr By the Thames in Richmond.

Five minute chocolate mug cake

8 May 2009 10 comments

Something for the weekend, or indeed any other time of the week; a version of this recipe seems to have achieved viral status. I made the recipe last night. It’s incredibly easy and it works a treat.

more

But why, some say, the moon?

1 May 2009 0 comments

Returning from speaking at the Web App Summit, we watched the brilliant Frost/Nixon and I was reminded of JFK’s fantastic 1962 Moon speech to Rice University.

more

Skillswap went typographic

7 April 2009 16 comments

Back in January I was part of a double bill with Jon Tan, entitled Skillswap goes typographic. It went down really well so I thought I’d better tie it all together here.

more

Web Typography panel at SxSW

30 March 2009 4 comments

I’m proud to have been part of the Web Typography panel at SxSW 2009 alongside Jon Tan, Ian Coyle, Elliot Jay Stocks & Samantha Warren. I’ve jotted down some of the topics we discussed, and some we talked about beforehand but didn’t have time for.

more

Microformats for business owners

13 March 2009 8 comments

An explanation of the practical benefits that microformats can bring to a business and its customers, written with the business owner in mind.

more

Ruminations Twitter

  • 2 days ago

    watching usability tests remotely and trying to not shout at the screen :-)

  • 4 days ago

    @sevenseconds noooooo not planning to leave us are you Cath?

  • 4 days ago

    @harrybr you should call it Steven (as in "Steven Seagul")

  • 6 days ago

    It appears my hangover decided to wait until today to show up. Feeling rough as the proverbial badger's. #richstag

  • 1 week ago

    heading to Bath for my stag do. Wish me luck... #richstag

Current listening Last.fm

Austin City Limits Music Festival 2005L.S.F. (Lost Souls Forever) · Kasabian

Blogmarks more blogmarks

One year ago in the Blog

Scripting Enabled conference/hack day

7 July 2008 0 comments

The estimable Christian Heilmann has announced Scripting Enabled, a combined accessibility conference and hackday being held in London this September.

more

Latest photos Flickr

  • The Don
  • Scaffolded house
  • Brighton Pier
  • Seagulls on Brighton Pier
  • Marcus and Oli
  • Marcus and Oli on the Pier
  • A lovely spot for lunch
  • At the baseball
  • At the baseball

Music purchases more bought music

mobile comment