|
Instructional Module W20d
|
|
||
| |
|---|
|
Information on the World Wide Web is made up primarily of text and images. The majority of text is written in the "roman" alphabet, though there are many other writing systems in use on the Web (see module W22f, "Odd Characters in HTML"). This module discusses the basic issues involved in putting text into Web pages: typography, sizes, and graphics. |
| |
|
|---|---|
|
What is Typography?
|
According to the Britannica Concise Encyclopedia Online, typography is the "Design or selection of letter forms to be organized into words and sentences and printed or displayed electronically." So what we're discussing here is the selection of letter forms - the shapes and sizes - of the letters we use for building words and sentences on Web pages. |
|
What is a Font?
|
The term font is used a lot in discussions of typography. The term originated during the early years of printing (late 14th and early 15th centuries) to refer to a set of letters designed to harmonize in appearance with each other. These were stored in a fons (from Latin, meaning 'source' and brought to English as font) usually made up of a pair of wooden cases. When the two cases making up a font were set up for use, one case was mounted somewhat higher than the other (see illustration at left); the upper case contained the capital letters, while the lower case - easier to reach - contained the more frequently used small letters. From this tradition, we get the terms uppercase meaning capital letters, and lowercase meaning small letters. |
|
Aspects of Type
|
In order to use letters effectively on the Web, we don't have to understand everything about typography,but there are several aspects we do need to understand...
|
|
What Do Fonts Communicate?
|
Let's start with the communication issue: after all, why shouldn't we just use whatever default font a browser supplies? sub·lim·i·nal [2] : existing or functioning below the threshold of consciousness <the subliminal mind> <subliminal advertising>. Merriam-Webster Online Dictionary. The answer is that different font-families carry different subliminal messages. Each of the illustrations below consists of the same words; ask yourself in what ways the different fonts make a different impression..
|
| |
|||||
|---|---|---|---|---|---|
|
The Flexibility Issue
Stanley Morison, designer of the Times Roman font
from Linotype Library |
Here's the central dilemma of typography on the Web:
These two aspects clash when a designer chooses a particular font, but the font is not available on all users' computers. The rules of the Web state that if a designer-requested font is not available on a user's computer, the browser will substitute its default font.
The parallel texts here discuss and illustrate both the advantages and the drawbacks of Times New Roman. As you read the two texts, notice differences in readability and size:
The display on the left, which should be in Times New Roman, takes up less space but is slightly less readable. On the right should be Georgia, which was design specifically for computer screens. It is somewhat more readable, but pays for its readability by taking slightly more space. Georgia was developed in 1997-8 by type designer Matthew Carter, under contract for Microsoft. Along with Georgia, Carter designed sans-serif Verdana specifically for use on computer screens. Because they have been distributed free of charge with Microsoft's Internet Explorer browser, these two fonts are widely available. Bottom line: Use Georgia as your normal serif font, and Verdana for your sans-serif applications. | ||||
|
Options for Showing Type
|
So, given the lack of control a designer has over fonts on the Web, what are the options?
Like many decisions made by Web designers, this one involves trade-offs. A good Web designer is one who uses a combination of techniques appropriate for each Web document. A good combination of techniques for many situations is to...
|
||||
| |
|||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
W3C Generic Font-families
|
Font-families can be grouped in many ways, but as Web designers it's important to note the ways CSS classifies them. W3C recommends that we specify a "generic font" at the end of each list of font-family options, so we need to know what W3C considers the generic families to be. These are the generic classifications recognized in both CSS-1 and CSS-2 specifications; they are not formally defined, but examples are given:
See also W3C's "CSS tips & tricks: Font Families". These can be applied like this:
|
||||||||||||||||||||||||||||||||||||||||||||||
|
What's behind the Classifications
|
What do each of these terms mean?
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Other Aspects of Fonts
|
There are several other aspects of fonts that are important in Web work:
We'll look at the first three briefly in this section, and cover font sizes in the next. Font WeightFonts are classified as "heavy" (bold) or "light" depending on the thickness of their lines. Heavy fonts have thicker lines than light fonts. CSS allows several ways of controlling font weight, but in most cases only two weights are actually available: normal and bold. Weighty WordsFour words can be used to denote desired font-weight: lighter, normal, bold, and bolder
Comparing these three variants, the first and second probably look the same, as do the third and fourth, because the font-family in use doesn't have a "lighter" or a "bolder" variant. When that happens, the browser uses the normal version for "lighter" and the bold version for "bolder". Numeric WeightsTo allow more precision in setting weights, CSS allows the use of numbers as values for the font-weight property. The only numbers allowed are 100, 200, 300, 400, 500, 600, 700, 800, and 900, which correspond to numbers used in font representations like OpenType. Here's how the numbers work:
While it's nice to know that CSS allows nine different font-weight variants, it doesn't do much good since the vast majority of font-families on personal computers have only two weights. Bottom line: stick to font-weight: normal or font-weight: bold. Font StylesThree possible font-styles are defined in CSS: normal, italic, and oblique.
Practically no font-families have both oblique and italic variants, so if an italic variant is requested and only oblique is available in that font-family, browsers use the oblique; if oblique is requested but not available, the italic will be used.
Bottom line: stick to font-style: normal or font-style: italic. Font VariantsThe only font variants specified by CSS are normal and small-caps. Normal is the default, of course. Text in small caps replaces lower-case letters with capitals in a smaller font-size.
|
||||||||||||||||||||||||||||||||||||||||||||||
| |
||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
What Needs to be Measured
|
Measuring text can be pretty complex, because there are several aspects of letters that are measured. In addition to the letters themselves, the space above and below the letters, and between the lines, is also measured. Measuring LettersHere are the aspects of letters that are commonly measured; some can be used in CSS to set the font-size, or the size of various entities relative to the current font-size.
Measuring the Boundaries of TypeUsing CSS, it's possible to set the size of "boundaries" around two aspects of type:
(This is relates to what is known as the "CSS box model".) The illustration here shows these boundaries in a short paragraph.
In this illustration, the empty spacing is represented by dotted or dashed lines; borders which can be visible lines are solid. The number 7 relates to the line-height illustration above. CSS allows us to set values for three kinds of "Boundaries":
Each of these boundaries - padding, border, and margin - forms a rectangle. But you can set the properties to each of the four sides of the rectangle individually: top, right, bottom, and left:
|
|||||||||||||||||||||||||||||||||||||||||||
|
Size Units
|
One advantage offered by CSS over HTML is the variety of units of measurement offered - only pixel and percent are available in HTML. These units can be used not only for text, but for all other aspects of the page that can be measured. This table summarizes CSS measures; some need clarification and are discussed in more detail below: Overview
Relative vs. Absolute UnitsAbsolute units are those that are defined in the "real" (non-computer) world. They all share a serious problem: they don't translate well to computer screens. The reason is this: screen images are built up of tiny dots ("pixels") whose actual size can be controlled by the end-user by setting the screen's resolution. Unfortunately, there is no feed-back loop to let browsers know how big the pixels are. Older screens used approximately 72 pixels per inch (ppi), but newer screens are routinely configured show 104 or more pixels per inch. The ppi of a screen depends on the resolution (for example, 800 x 600 or 1024 x 768) and the monitor size (for example 17 or 21 inches). With screen size and settings unavailable to browsers, it is very unlikely that any of these absolute units will "measure up" to reality when displayed on users' screens. Relative units depend on the size of entities of which they are a part - or, in the case of text, on the default size of text in a browser. They have the apparent disadvantage of lacking precise control, but actually their dependence on the viewing environment fits nicely with the original intent of the Web, to adapt itself to multiple viewing environments. Notes and Definitions
Bottom line: Use percent % to specify the size of fonts, and do not set the default size in absolute units for the body as a whole - let the users' preference, set in the browser default, determine the basic size of text for the page. |
|||||||||||||||||||||||||||||||||||||||||||
| |
|
|---|---|
|
When to use Graphic Text
|
Graphic text is writing represented by images - that is, something that appears to be text, but is actually a GIF or JPEG. Because graphic images take longer to download than the same amount of text, graphic text should be avoided unless there are good reasons for using it. When is graphic text worth the cost of slower download?
Since graphic text "costs" bandwidth, it's important to use it carefully:
And when graphic text is created, it should always be carefully exported to use the most efficient storage format consistent with its appearance. The alt attribute should be the same as the graphic text, so that when the graphic is not visible, viewers will be able to see exact same text instead. What is graphic text best for?
But graphic text cannot be edited with normal HTML editing tools - it must be edited with graphics tools. So it's much less convenient to update and correct than normal HTML text. In the next section, we take a look at graphic tools for creating text. |
|
Tools for Building Graphic Text
|
Though somewhat less convenient, tools for building graphic text are abundant. Here is a summary:
Tips for Building Graphic Text
|
|
How to Include Graphic Text
|
This is the easy part! Once your graphic text is created, treat it pretty much like any other graphic image. Just a little more attention needs to be paid to the alt, height, width, and align attributes.
|
| |
|
|---|---|
|
Audience
|
|
| Objectives |
On successful completion of this module, you will be able to:
|
| Module W20d: Web Typography |
This document is part of a modular instruction
series in Computer Instruction. For more information, see the overview
or the list of modules in this series, W: World Wide Web.
This document has been used in the following classes: INP
140, 150.
|
| History |
Original: 16 September 2004, by Laurence J. Krieg
Last modification: Friday, 18-Mar-2005 09:11:40 EST |
| Copyright |
Copyright © 2004, Laurence
J. Krieg, Washtenaw Community College
Instructors: You may point to this file in your Web-based materials; however, its location may change without notice. Students: You are welcome to make a copy for your personal use. All other uses: Please contact the author, Laurence J. Krieg, for permission: krieg@ieee.org. |