CHAPTER 1 Introduction

Glyphs


Since Fresco is a user interface system, we are interested in building with it things such as dialog boxes, word processors, graphical drawing editors--things that you interact with on the display. In Fresco, such things are built by composing glyphs1 into a structure. The glyph is a fundamental type in Fresco, and there are many different types of glyphs: glyphs that draw themselves, glyphs that draw shadows or frames around other glyphs, glyphs that compose and layout children glyphs, glyphs that apply graphical transformations, and so forth. A viewer in Fresco is a glyph that deals with user input events. Objects such as buttons, dialog boxes, and drawing editors are typically implemented as viewers.

Figure 1-1 gives an example of some different types of glyphs. Here, two character glyphs, big G and little g, are composed into an hbox along with a "space" glyph and a car. The hbox is a glyph that performs a TeX-like2 layout algorithm on its children: it tiles its children horizontally and aligns them vertically. The hbox aligns the pre-defined origins of each child along a common baseline. Hboxes are typically used in word processor programs to compose text characters into lines. Its cousin, the vbox, is then used to compose the lines (which are hboxes) into pages (which are vboxes.) Note in figure 1-1, since the car is a glyph, the layout algorithm handles the car just as it would any other glyph.

Figure 1-2 shows the glyph structure for the hbox of figure 1-1. Notice that the car is made up of a structure of graphical glyphs. Such glyphs use transformation matrices for translation, scale, and rotation. For example, if we applied a scale transformation to the main "group" representing the car, then the car would get bigger. This, in turn, would cause the hbox to shift the car up slightly, since its alignment algorithm always positions the car above the baseline.

Few toolkits, if any, allow this mixing of layout objects with graphical objects. With Fresco, the mixing is arbitrary. The car, for example, can itself contain layout objects--which can be arbitrarily transformed--and they can contain more graphical objects. In addition, the mixing extends beyond just layout glyphs. Any kind of glyph, including viewers that handle input, can mix arbitrarily with graphical glyphs.


Copyright (c) 1994 by Steve Churchill
Comments or questions? Contact Steve Churchill (stevec@faslab.com)

Generated with CERN WebMaker