« Wilfred Emmanuel-Jones | Main | Yes, but what do we do now?? »

September 23, 2006

Making pages clearer - easy Disability Discrimination Act Compliance

Welcome to the new, clearer, Horse's Mouth. You should spot that the text size is slightly larger, and contrasts better against the background. And if you're not keen on the new look, you are now empowered to change it to suit your own preference - simply click on the "customise" link on the right of the main page, and you'll be able to choose the colour combination and font size you want in another window, then choose "reload" that's just to the right of customise. If you're viewing this page on the archive, then the "Accessibility" menu will let you make a new selection ... and whichever way your selection is made, it'll be remembered for subsequent pages via a cookie.

The MovableType software that I use for this daily update is an excellent piece of software - but it's written and updated outside Europe, and doesn't necessarily conform to UK and European requirements. If this update provides a service, and I guess it does, then I'm required under DDA to make all practical efforts to make it equally assessible to everyone if asked, be they colour blind, or if they find a tiny text hard to read. Plenty more information from folks like the RNIB.

I could, probably, have claimed that I'm not providing a service when asked - that this is just a personal daily note. But I don't feel that's morally the correct position to take. Nor is it the correct long term business position to take - I want readers, and happy, non-struggling readers too.

Our main site and business is already DDA compliant - we've taken all reasonable steps to provide a level playing field, or one that's biased in favour of people with a disability ... but how to do it with a standard piece of software? It turns out that PHP and style sheets come to the rescue; the HTML pages are unchanged, but the style sheet is dynamically generated to meet the individual's request.

Here's part of the top of the style sheet code :

<?php
header("content-type: text/css");
if ($_COOKIE["whcmy"]) {
  @mysql_pconnect((database login info));
  @mysql_select_db($sqlaccount);
  $q = @mysql_query(
    "select * from whcmy where userkey = '$_COOKIE[whcmy]'");
  if ($row = @mysql_fetch_assoc($q)) {
    $fontsize = $row[fontsize];
  }
}
$bfsize = 12;
if ($fontsize == 4) $bfsize = 10;
?>

And within the CSS code, you'll find things like:

#banner h1 {
font-size: <?= $bfsize+12 ?>px;

If you want to learn more about using style sheets in this way, the RNIB offer abasic course at the HTML and CSS level - see here, and we at Well House Consultants can provide you with PHP training, MySQL database training, and so on so that you can automate and integrate DDA compliance. Not only does it makes legal sense ... it also makes moral and business sense.

Posted by gje at September 23, 2006 09:32 AM

Comments

Why not use relative units instead of fixed such as pixels?

Posted by: Cait at September 23, 2006 03:07 PM

Good question! I guess I'm personally more comfortable having more detailed control, and I wanted to leave the way open to provide a single very large font size for all the text should that be required by anyone in the future.

Posted by: Graham Ellis at September 23, 2006 03:19 PM

Mozilla and Opera products already support a user set minimum font size option. IE 7 (from what I've read) will allow users to override font sizes specified in pixels with View -> Text Size -> Small, Medium, Large. It seems to me that font sizes in pixels will eventually become a thing of the past as users gain more control of their browser settings.

My favourite method of setting sizes has been with a %/em combination (http://www.thenoodleincident.com/tutorials/typography/index.html). Been using it for quite some time and it's showed consistent results cross-platform/cross-browser (with the exception of Netscape/IE 4, for which I use the @import trick to serve them pixels).

So if I use a stylesheet switcher to offer a change in font size, it can be done with one change to the body's font-size, from 76% to a larger percentage.

Posted by: Cait at September 24, 2006 06:18 AM

Post a comment




Remember Me?


Well House Consultants Ltd. Copyright 2008