How to adjust font sizes in Drupal 7.x

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
KeithH's picture

Hi folks.
I was wondering something.
Last night, when I had someone visit my website wich you all may review at:
http://keithnet.dyndns.org
I was told seriously that the font is not optimal for people with low vision.
As I have committed myself to insureing my site is optimized for low vision users as well as screen reader users, hear is what I need to know.
It should be noted that I'm using Druapl Core without modification, I.e. No eextra themes, etc.
What I'm using is the default Draupl core layout as designed after an installation witht he bartic theme.
Is there any way that I can adjust the font used through out the entire website?
According to my screen reader, it's all in font 8 and such.
What settings would be considered optimal?
Any ideas would help.
If you have useful vision, that would help as well. Please do let me know what you recommend I do.
If it involves heavy PHP code, I don't know enough code to do what must be done.
So i hope it is somewhere in the core interface and that a screenr eader only user mlike myself will be up to the task.
I cannot aford to pay a person anythign at all to help, so whatever you tel me to do I hope that what I am told is doable by a single person without any assistance, etc.
Thanks.

Comments

Fonts and Readabiity

leigen's picture

There is a wealth of scientific literature on readability for people who have "limited" or "partial" vision--about 20% of the American Adult Population.

I will summarize the important points for computer / screen visibility,

Size is the most important factor. 8 pt is TERRIBLE. 12 point is MINIMAL. 14-16 pt is usual,

If user is in Windows 7, the font size can be increased to 125% or 150%. If user does this, the 11 point font is reasonably readable.

Both Explorer and Foxfire late versions have ability to enlarge fonts. Limited vision users are forced to use this method with most websites. It still caused problems when some fonts are not changeable by browser or when there is type in graphics.

Next to size, inter-letter spacing is the next critical variable.

Then comes line spacing. 1.20 to 1.80 times font size seems to be the desirable range,

Serif or Sans-Serif does not seem to make a difference.

Very thin strokes like Avant Guard are harder to read.

Color however is VERY important--not the color per se, but the degree of contrast between foreground and background is critical. Color blindness affects reading rarely. However many drupal themes which have instructions in a grey on a white background are not so good. A yellow on grey might seem distinctive but if they have the same degree of contrast, they are hard to read. Black on white is obviously best contrast, but any dark color on white works. Reverse type is OK provided you do not have a thin font. If font is bold in any light color, that usually works well with any dark background. Always go for contrast.

THere is a Special Font that has been designed by the American Printing House for the Blind. It is called A-Phont. It already optimizes a number of variables like the inter-letter spacing See

http://www.aph.org/products/aphont.html

It is FREE if you are using it to increase readability. For the basic fonts of a theme, A-Phont and nothing else improves the readability a great deal.

People with normal vision have often reported that it is EASIER to read low vision prepared material without ever knowing what that was.

A-PHont

mgifford's picture

I'm curious to know if you've implemented A-PHont on the web. You have to hand over your contact information to them before you get the font and they hold the rights to change the copyright at any time, so I wasn't very keen to invest much time in it.

However, it would be very interesting to see how it looks online. Their own site uses: Verdana,"Bitstream Vera Sans","DejaVu Sans","Liberation Sans",Geneva,sans-serif

I sent them a not encouraging them to change their licensing & distribute it through http://www.fontsquirrel.com so that it might be used in more web fonts.

For text resizing widgets there's always this list of modules than include two - http://drupal.org/node/394252

Also a long thread about this issue here - http://groups.drupal.org/node/85254

Modifying Themes

ao5357's picture

I haven't modified a theme in D7 yet, but if it's like D6 there is a right way and a fast way.

The Right-ish Way: Copy down the Bartik theme from your /themes directory. Rename the theme (to something one-worded and easy to find/replace), then replace the word Bartik in all files with your new theme name. Once you've done that, upload the newly-named theme to your /sites/all/themes directory. Your theme is now its own separate entity, no longer updated along the Bartik maintenance path. This means that your edits won't get wiped out when you update Drupal — but you'll want to watch the Bartik commits for security issues that might need manual patching. Just go to the theme administration page and switch to your new theme.

The fast way: change one line in the core Bartik CSS. This is wrong because you should not hack core. Updates to Drupal will wipe out your changes if you're not careful. And you never know how many single-line mods you'll want to make.

Either way that you decide to go, you'll want to open bartik/css/style.css
After line 12, paste in:

body{font-size:1.2em;}

Where 1.2 can be replaced with any numerical value to increase the size of the text throughout the site. I gotta tell you, though, the body text on your site actually renders at a default 14px, which is perfectly acceptable. Additionally, screen readers don't care about font size. Browsers do, but most browsers include zoom functionality, so your differently-abled users have their own choice to magnify the page or the text.

Hope this helps.

Sub-theme technique

bowersox's picture

Another right-ish way is to create a sub-theme. The advantage is that you only need to put the things that you want to change or override into your sub-theme. You don't need to copy and rename all the files, since they are inherited from the parent theme. So in your sub-theme you could just put a little additional CSS or just one different template file (page.tpl.php). Having duplicate copies of all the other files is a maintenance liability for you as the original files change over time.

Here is one set of step-by-step instructions for creating a sub-theme that I found with a quick search:
http://opensourcecms.pro/drupal/howto-drupal-7-sub-theme-creation-step-b...

Watch out for absolute positioning

Charles Belov's picture

I'm not familiar with the specific theme, but here's a general gotcha.

Any CSS using absolute positioning risks that some content will get cut off or overprint other content when the site is viewed with a larger font size, as opposed to whole-page zooming.

Additionally, it can make overlapping links difficult or impossible to click. It can also make links within content revealed by rollovers impossible to click because the rollover goes away on the cursor's way there.

Finally, there is the issue of the ratio between the smallest font size used and the largest. If I zoom in order to enlarge fonts that are too small, fonts that are too large can become awkwardly large and overrun their containers. That's why, instead of zooming, I have set Firefox to use a minimum font size of 18 points. This setting can also be made in Safari.

IE has a setting Accessibility > Ignore font sizes set by websites which, I believe, uses semantic markup to set font sizes.

Webmasters cannot simply point their visitors to instructions on how to increase the font size on their browser. They must test that following those instructions results in their website still being usable. And they must test that all the ways of enlarging fonts work, since nobody is going to want to follow special instructions just for their website (and won't read the instructions if they already know how to make fonts bigger).

Charles Belov
Webmaster
San Francisco Municipal Transportation Agency (SFMTA)

Slogan

TheDom4224's picture

I have a slightly different problem:
The text size on my site is fine, but the slogan is a bit big. How can I change this???!!!

Thanx

Accessibility

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week