The authors are not responsible for the content of any external sites linked to from digitalmultimedia.org
All material on this site is ©2009–2013 MacAvon Media and may not be reproduced without permission.
Answers to Exercises, Chapter 9
These are answers to the exercises in the 3rd edition of Digital Multimedia (published February 2009) only. Do not try to use them in conjunction with the 2nd edition.
Buy the complete book in PDF for GBP £19.75 or individual chapters for GBP £1.99 each from the authors' own Web site MacAvon Media. MacAvon Media PDF is DRM-free and can be read with any program that opens PDF.
- The most visible uses of ASCII control characters occur in terminal emulators and command-line interfaces. For instance, on Unix systems, ^D is used to denote the end of input, ^C to interrupt a process, and so on. If you don't think that a command-line interface is part of a "modern computer system", one of the most commonly used control characters in graphical user interfaces is ESC, which is used among other things to cancel a dialogue box from the keyboard in Mac OS X and Windows. Another notable use of control characters is the use of NUL to mark the end of a string in programming languages. Of course, either or both of CR and LF are used to denote the end of lines and DEL is used to delete a character. TAB is used for several purposes, including moving the cursor between cells in a spreadsheet. The arrow keys on a keyboard, which are generally used to move the cursor, are sometimes mapped to control characters whose original function on teletypes is no longer relevant.
One area in which control codes are not used, although you might think they are, is in key equivalents for menu commands. On Windows and Unix, menu commands can be activated by holding down CTL at the same time as some other key. (On Macs, CMD is used for this purpose, but CTL is used as a modifier by some applications, to extend the range of possible key combinations.) Originally the CTL key was provided to allow control characters to be typed (e.g. CTL-g sent BEL), but only a few letter keys have corresponding control characters. In a modern system, the program that receives the key press will receive the code for the letter together with some flags indicating which, if any, modifier keys were held down. The control character is not sent.
- What are the alternatives? ASCII does not have a code for a multiplication operator, and most programming languages were devised before Unicode (which does) became available. A lower case letter x looks like a multiplication operator, and was often used for the purpose in typewritten manuscripts, but the same ASCII code would appear in the program source for the letter and the operator, which would mean that the compiler had to be able to distinguish between x used as a letter, for example in a name, and x used to denote multiplication. This is complicated, at best, and any disambiguating rules would be likely to confuse programmers. The same applies to the conventional mathematical convention of implicit multiplication (e.g. is xy a name or x times y?) although the designers of at least one early programming language (CPL) managed to devise a means of allowing implicit multiplication using fairly natural rules. The asterisk does not present these problems: it is present in ASCII and is not used in any other context that could be confused with its use for multiplication, and it looks a bit like the conventional multiplication sign. (It would be nice if modern languages allowed the use of the Unicode × sign as an alternative, though.)
- 8-bit character sets have not been adequate for computer applications since it became common for programs to manipulate written language. As we explain in the text, there are many languages which cannot be written down using ASCII characters and 8 bits is the minimum required for many languages based on alphabets consisting of letters for each sound. However, 8-bit character sets are completely inadequate for languages with ideographic alphabets, which may have many thousands of characters, and can only accommodate languages with closely related alphabets, such as all the Latin alphabets, or the Cyrillic alphabets. A single 8-bit character set does not permit languages with alphabets in different groups (such as Russian and French) to be used together (as they might need to be in a 19th century Russian novel). Many mathematical symbols are also left out of such a scheme. To accommodate all languages, character sets with more than 8 bits must be used.
- The argument which naive commentators put forward is that, for the reasons given in the preceding answer, ISO 10646 uses 32 bits for each character value, or Unicode uses 16, and for ASCII codes most of these bits will be zero, which is a complete waste of space. This is a misunderstanding of the way in which characters in these character sets are actually stored and transmitted. The 2 or 4 bytes of the complete value can be encoded in different ways. In particular, the UTF-8 UCS encoding packs each 16-bit Unicode value into a variable-length code comprising up to six bytes, in such a way that ASCII characters are always encoded in a single byte. In fact, the UTF-8 representation of an ASCII character is identical to the ASCII representation, so no space is wasted at all when storing documents whose textual content can be adequately represented in ASCII.
- A character is an abstract entity, which always carries the same information. For example, the second letter of the word "example" is the character "x", regardless of what it actually looks like when written. A character is the component of written language from which words are built. A glyph is a graphical representation of a character. Any character may be written down in many ways: x, x and
xare just three of the glyphs for the "x" character. Usually, the glyphs for a particular character look roughly the same (although there are, for example, two distinct glyphs for "r" in use), but they differ in details, just as one person's handwriting differs from another. In programming terms, a character is a value of some character data type, while a glyph is a small vector image displayed to represent the character.
- PDF (or, at a pinch, SWF) allows fonts to be embedded in the document. Most other formats, including Word or InDesign documents and XHTML use only the fonts which are installed on the user's machine and will substitute others if the fonts originally specified are not available.
- As you will see in Chapter 10, these are the characteristics used to identify fonts in CSS. However, strictly speaking, they are not adequate: some fonts (e.g. Univers) come in different widths, including condensed and extended forms, so the width should also be specified. However, this is sometimes taken to be part of the family name. For example, "Arial Narrow" is a condensed version of "Arial".
- x-height < cap height < body size < leading (See Figure 9.15, p. 347.)
We assume an alphabet with upper- and lower-case forms, so that the cap height makes sense. We also assume that the text is set for reading, not for a graphic effect. Sometimes graphic designers set type with leading equal to or less than the body height so that lines are squashed together or overlap. (Usually, it's not a great idea.)
- There are two main reasons why justification is not commonly used on Web pages. One is that Web browsers make a poor job of it, justifying each line in isolation, which leads to poor spacing and "rivers of white". There is no provision for hyphenation in Web browsers, which makes it hard to choose good line breaks. Secondly, justified text is normally used for extended passages that are intended to be read from beginning to end. Tradition holds that justification makes reading lines sequentially easier. On Web pages, much of the text is designed to be skimmed, or consists of short disjointed passages. In this case, little is gained by justification.
- The structure of a document is independent of its appearance. A heading is a short piece of text describing or identifying what follows it, irrespective of whether it is distinguished by being set in large bold type, or centred and underlined, or whatever. The chosen styling for headings expresses their structural nature, but the same structure can be expressed in many different ways. By using visual markup, you tie the structure to one particular visual representation. This means that you cannot easily change the appearance of all your headings, and it means that the structure is only perceptible by people who can see and interpret the appearance created by your markup. If the structure is made explicit by structural markup, and the appearance of each structural element is specified independently, it is easy to make global changes to the appearance. Perhaps more importantly, the structure can now be "perceived" by computer programs, which can more easily analyze documents or translate them into a form that can be used by people who are unable to see. For example, a screen reading program would be able to "speak" a heading with special emphasis, or preceded by the word "heading". A program could create an overview of a document by extracting all the headings. These points are taken up in later chapters in the book.
Discussion Topics: Hints and Tips
- This is an accidentally duplicated discussion topic. See under answers for Chapter 2, Discussion Topic 2.
- This distinction certainly is often made. It depends on a particular understanding of what "reading" is.
- The Computer Modern family of fonts, devised for use with the TeX typesetting system, did include an upright italic font. This was mostly done to demonstrate the possibilities of the MetaFont program used to create the Computer Modern fonts. If you have TeX, you can try setting some text in upright italic to see how it works.
- If the traditional distinction is not suitable, what distinctions could you make between the fonts appropriate for the different sorts of text displayed on a screen? For example, we don't normally use the same fonts for displaying code in an editor as for displaying a Web page.
- In thinking about this question, don't necessarily assume that invisible markup is visual and tags are structural.
Practical Tasks: Hints and Tips
- We asked you to compare and contrast the way fonts and layout are used in news stories and in advertisements in a printed newspaper in Chapter 2. Now do the same comparison on the online version of a paper and see whether fonts are used differently there. Note how the way in which advertisements use fonts influences the technology used to display them.
- The more fonts you have installed, the more valuable this exercise will be. Note that many fonts are installed with Adobe Creative Suite applications, if you have them, but in a default installation of versions prior to CS4, they were installed in special locations, not in the normal system font directories.
- You may very well argue that the existing Scrabble font is a "design classic", which cannot be improved. Nevertheless, try rethinking the design from scratch and see what you come up with. Think about the way in which the letters are used in Scrabble and how the game is played (often without a turntable), and make sure that the font you design is fit for the purpose. While doing this exercise, also explore font designs which are not suited for this purpose, and note why they do not work.
- This probably sounds easy but by the end you may have an increased respect for the skills of graphic designers.