11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Forth 201dows <strong>and</strong> Macintosh usually come with an assortment <strong>of</strong>fonts, <strong>and</strong> applications can register additional fonts to makethem available to the system.Fonts are <strong>of</strong>ten presented as a “family” that includesthe same type design with different attributes such as boldface<strong>and</strong> italic. The spacing <strong>of</strong> letters could be uniform(monospace) as in the Courier font <strong>of</strong>ten used for printingcomputer program code or proportional (as with most textfonts). For proportional fonts the design can include kerning,or the precise fitting together <strong>of</strong> adjacent letters for amore attractive appearance. Fonts are also described as serifif they have small crossbars on the ends <strong>of</strong> letters such as atthe end <strong>of</strong> the crossbar on a T in the Times Roman font.Other fonts such as Arial lack the tiny bars <strong>and</strong> are calledsans serif (without serif).There are two basic ways to store font data in thecomputer system. Bitmapped fonts store the actual pattern<strong>of</strong> tiny dots that make up the letters in the font. Thishas the advantage <strong>of</strong> allowing each letter in each pointsize to be precisely designed. The primary disadvantageis the amount <strong>of</strong> memory <strong>and</strong> system resources requiredto store a font in many point sizes. In practice, this considerationresults in only a relatively few fonts <strong>and</strong> sizesbeing available.The alternative, an outline or vector font uses a “pagedescription language” such as Adobe PostScript or TrueTypeto provide graphics comm<strong>and</strong>s that specify the drawing<strong>of</strong> each letter in a font. When the user specifies a font,the text is rendered by processing the graphics comm<strong>and</strong>sin an interpreter. Since the actual bitmap doesn’t need to bestored <strong>and</strong> all point sizes <strong>of</strong> a font can be generated fromone description, outline fonts save memory <strong>and</strong> disk space(although they require additional processor resources forrendering). While sophisticated scaling techniques are usedto maintain a pleasing appearance as the font size changes,outline fonts will not look as polished as bitmapped fontsthat are h<strong>and</strong>-designed at each point size. (For use <strong>of</strong> fontssee typography, computerized.)Strictly speaking, a particular type design is called a typeface, <strong>and</strong>a font is a rendering <strong>of</strong> a typeface with specified characteristicssuch as height in points <strong>and</strong> possibly width or pitch in charactersper inch. Thus there are usually many fonts for each typeface.Further ReadingAaron, B. TrueType Display Fonts. San Francisco: Sybex, 1993.Adobe Systems. Adobe Type Library Reference Book. 2nd ed. MountainView, Calif.: Adobe Press, 2003.Headley, Gwyn. The <strong>Encyclopedia</strong> <strong>of</strong> Fonts. London: Cassell Illustrated,2005.Lupton, Ellen. Thinking with Type: A Critical Guide for Designers,Writers, Editors & Students. New York: Princeton ArchitecturalPress, 2007.Micros<strong>of</strong>t Typography. Available online. URL: http://www.micros<strong>of</strong>t.com/typography/default.mspx. Accessed August 4, 2007.TrueType Typography. Available online. URL: http://www.truetype-typography.com/. Accessed August 4, 2007.ForthThe unusual Forth programming language was designedby Charles H. Moore in 1970. An astronomer, Moore wasinterested in developing a compact language for controllingmotors to drive radio telescopes <strong>and</strong> other equipment.Language StructureForth has a very simple structure. The Forth system consists<strong>of</strong> a collection <strong>of</strong> words. Each word is a sequence <strong>of</strong>operations (which can include other existing words). Forexample, the DUP word makes a copy <strong>of</strong> a data value. Datais held by a stack. For example, the arithmetic expressionwritten as 2 + 3 in most languages would be written inForth as + 2 3. When the + operator (which in Forth is apre-defined word) executes, it adds the next two numbersit encounters (2 <strong>and</strong> 3) together, <strong>and</strong> puts the sum on thestack (where in turn it might be fetched for further processingby the next word in the program (see stack). This representationis also called postfix notation <strong>and</strong> is familiar tomany users <strong>of</strong> scientific calculators.The words in the dictionary are “threaded” or linked sothat each word contains the starting address <strong>of</strong> the next one.The Forth interpreter runs a simple loop where it fetchesthe next token (one or more characters delimited by spaces)<strong>and</strong> scans the dictionary to see if it matches a defined word(including variables). If a word is found, the code in theword is executed. If no word is found, the interpreter interpretsthe token as a numeric constant, loads it on the stack,<strong>and</strong> proceeds to the next word.A key feature <strong>of</strong> Forth is its extensibility. Once you havedefined a word, the new word can be used in exactly the sameway as the predefined words. The various forms <strong>of</strong> definingwords allow for great control over what happens when a newword is created <strong>and</strong> when the word is later executed. (Inmany ways Forth anticipated the principles <strong>of</strong> object-orientedprogramming, with words as objects with implicit constructors<strong>and</strong> methods. A well-organized Forth program builds upfrom “primitive” operations to the higher-level words, withthe program itself being the highest-level word.)Forth has always attracted an enthusiastic following <strong>of</strong>programmers who appreciate a close communion with theflow <strong>of</strong> data in the machine <strong>and</strong> the ability to preciselytailor programs. The language is completely interactive,since any word can be typed at the keyboard to executeit <strong>and</strong> display the results. Forth was also attractive in the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!