ImagerDoc.tioga
Doug Wyatt, May 26, 1985 12:23:50 pm PDT
Michael Plass, June 27, 1986 11:35:49 am PDT
THE CEDAR IMAGER
CEDAR 6.1 — FOR INTERNAL XEROX USE ONLY
The Cedar Imager
Device-independent image generation in Cedar
Doug Wyatt
© Copyright 1985, 1986 Xerox Corporation. All rights reserved.
Abstract: Package for device-independent image generation in Cedar.
Created by: Michael Plass and Doug Wyatt
Maintained by: The Imager Implementors <ImagerImplementors^.pa>
Keywords: image, graphics, font, display, printing, device independence, Interpress
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
Introduction
The Imager is patterned strongly after the imaging facilities available in Interpress, so refer to these internal publications for a description of the semantics of the various Imager operations:
Interpress Electronic Printing Standard (Version 2.1, XSIS 048404, April 1984) (Chapter 4)
Interpress Electronic Printing Standard (Version 3.0, XNSS 048601, January 1986) (Chapter 4)
Full Interpress (Interpress Extension Strategy) (DRAFT June 1983) (Chapter 4)
Introduction to Interpress (Sproull & Reid, XSIG 038306, June 1983)
For examples of how to use the Imager, refer to ImagerExamples.df on CedarChest. CedarChest also contains packages for creating Imager contexts for different kinds of output.
Refer to Viewers for obtaining Contexts that output to the displays.
History
Imager is a successor to the Cedar Graphics package that was developed by John Warnock and Doug Wyatt. The design of Imager benefited from advice offered by Frank Crow, Butler Lampson, Scott McGregor, Ken Pier, Lyle Ramshaw, Bob Sproull, and Maureen Stone. The main designers and implementors of Imager were Michael Plass and Doug Wyatt.
Public Interfaces
Imager
The main one. Refer to the comments in the interface for a description of the various operations.
ImagerExtras
Additions for support of Interpress 3.0 semantics.
Vector2, ImagerTransformation, ImagerPath, ImagerFont, ImagerPixelArray, ImagerBox, ImagerColor, ImagerColorOperator
For dealing with particular data types that are used by Imager.
ImagerBackdoor
Operations that are not applicable to every kind of context.
ImagerOps
Extra handy operations.
Transformations
Device coordinates
The Device coordinate system is in whatever units are most convenient for the implementation, and is normally inaccessible to the client.
Surface coordinates
The Surface coordinate system covers the entire output medium, one unit per pixel, with the origin at the lower-left corner and x to the right, y up.
View coordinates
The View coordinate system is normally just a translation from the Surface coordinates. This is normally maintained by the window package, not by random clients. When reading Interpress documentation, read "View coordinates" wherever you see "Device Coordinates". The View has a clipping area associated with it, which is often (but not always) just a rectangle. The View clipping area, as well as the View transformation, are not affected by DoSave, or DoSaveAll.
Client coordinates
The Client coordinate system is the one the client thinks in terms of. Initially in meters, it may be changed by the client at any time to whatever is most convenient. (If the client is using a context provided by viewers, the initial client-to-view is the identity, which is in some ways less device-independent, but often more convenient.) The client-to-view transformation is accessible as context.state.T, for contexts that retain state.
The basic procedure for changing the current (client-to-view) transformation is:
Imager.ConcatT: PROC [context: Context, m: Transformation];
ConcatT premultiplies the current transformation by an arbitrary transformation. Procedures for building general transformations are in the ImagerTransformation interface. If you just want to do something simple, the convenience procedures ScaleT, Scale2T, RotateT, TranslateT may be handy. ScaleT applies a uniform scaling factor; Scale2T scales independently in x and y; RotateT applies a counterclockwise rotation (measured in degrees); and TranslateT translates the origin.
Fonts
Font names
Fonts are named using a hierarchical naming scheme, with the components of the name separated by slashes. Examples:
Xerox/XC1-2-2/Modern-bold
The first component in all our fonts says that this is a font in the Xerox portion of the hierarchical name space. See the address in the back of the Interpress standard for information about how the name space is administered.
The second component here, XC1-2-2, identifies the character codes in the font as conforming to a particular version of the Xerox Character Code Standard. This is a 16-bit code that provides for many more characters than the normal ASCII encoding. The face information is encoded as a postfix:
-bold
-italic
-bold-italic
Xerox/PressFonts/Modern-brr
This is an older font; the characters associated with the codes varies from font-to-font. Note that the PressFonts component is not offically registered; we just assume nobody else would want to use it. The face information is encoded as
-mrr Medium Roman Regular
-brr Bold Roman Regular
-mir Medium Italic Regular
-bir Bold Italic Regular
Xerox/TiogaFonts/Modern10B
This is a font designed for use on the display at a particular size; it may still be scaled and rotated, but it is likely to look good only at one size. This size is therefore part of the name. The face information is encoded as B, I, or BI at the end of the name, without dashes.
Xerox/XC1-2-2/Tioga-Modern-bold-10
This is similar, but it conforms to the Xerox Character Code Standard, and uses a more verbose encoding of the face information.
Font lookup
Font files live on subdirectories of []<>Fonts> on the local system volume. For instance,
[]<>Fonts>Xerox>PressFonts>Modern-brr.sd
is the file that describes Xerox/PressFonts/Modern-brr; the extension identifies the format ot the font files. The list of known extensions is currently
sd - spline font description
ac - aligned raster characters (normally used for printer resolution)
strike - raster characters at screen resolution; very old-fashioned format
ks - kerned strike; allows the escapement to differ from the bounding box
gf - general format; compressed raster font produced by Metafont
For details on all but the last, see [Cyan]<PrintingDocs>FontFormats.Press.
The XC*-*-* fonts in general need multiple files to describe all the characters, because of the limitations in the old font file formats we use. There is one file for each non-empty character set (block of 256 codes). Thus the collection of files
[]<>Fonts>Xerox>XC1-2-2>Modern-bold-c0.sd
[]<>Fonts>Xerox>XC1-2-2>Modern-bold-c41.sd
[]<>Fonts>Xerox>XC1-2-2>Modern-bold-c356.sd
[]<>Fonts>Xerox>XC1-2-2>Modern-bold-c357.sd
[]<>Fonts>Xerox>XC1-2-2>Modern-bold-c360.sd
[]<>Fonts>Xerox>XC1-2-2>Modern-bold-c361.sd
together describe the single font Xerox/XC1-2-2/Modern-bold.
There is also a way for fonts to exist without a corresponding file, so there are fonts that will work even when you can't find them in a list. Thus if you ask for Xerox/XC0-0-0/Modern-bold, you may actually get Xerox/XC1-2-2/Modern-bold, perhaps with the codes rearranged to conform to the older standard.