home *** CD-ROM | disk | FTP | other *** search
- /* In the example which follows two PIL files are shown. One describes pages
- 1 and 2, the other describes the display ad placed on page 2. The PIL file
- for pages 1 and 2 would have been generated by a page layout system, that
- for the display ad by an ad makeup system.
-
- Additional, content files are needed to fully describe the pages and the
- ad. These files are not included in the example.
- */
-
-
- /* ---------------------------------------------- */
- /* FILE DESCRIBING PAGES 1 & 2: /Pages/1_2/P00001 */
- /* ---------------------------------------------- */
-
- pil-layout-5.00 "N PAGE 1" {
-
- /* The name table associates entity names with the types of the
- entities and their location. The format for each name table entry
- is "name", "type", "domain", and "value". The name is the way
- by which the entity is identified in a pil-layout; the "type" is
- the data format of the entity, and the domain and value, taken
- together are used to locate the entity where it is stored, e.g.,
- on a file system or database. Thus, the renderable content for the
- headline and photo are defined as "postscript" and "tiff" respectively.
- The editable content for the FIRE story body text is "ascii-text".
-
- The renderable and editable content locations are specified as "lcd-
- filenames". "lcd" stands for "least common denominator". It requires
- that the files are in the same directory as the PIL itself and that
- the names can be represented as DOS filenames. The domain and value of
- "inline" means that the entity appears later in this file. */
-
- name-table {
- "N FIRE HD 1" postscript lcd-filename "R00001"
- "N FIRE PH 1" tiff lcd-filename "R00002"
- "N FIRE BT" ascii-text lcd-filename "E00001"
- "N PAGE 2" pil-layout inline inline
- }
-
- /* The canvas is the root of the hierarchy. The subordinates are the
- following objects which appear in imaging order from lowest to
- highest.
-
- "units" specifies how to interpret dimensions, both for
- the current object and for those objects which do not re-specify
- the units of measure. Thus, units of measure are inherited, down
- the tree. In this case units of measure is chosen such that 1 unit
- equals 1/1000th of an inch.
-
- "dimensions" provides the horizontal and vertical width of the
- canvas. This is the physical imaging area for all content rendered
- on the canvas. So, content is clipped to the canvas size. In this
- case an 8.5 by 11 inch page is indicated.
-
- "user-name" is an arbitrary string which is not used for final
- rendering. Its typical use is to provide a name for the canvas
- which is meaningful to a user, and may be used to label an object
- when it is drawn in dummy or outline mode.
-
- In addition to these items, a canvas type, clipper and application
- specific attributes may be specified. These are not used in this
- example. */
-
- canvas {
- dimensions { 8500 11000 }
- units 25400
- user-name "Page 1"
- }
-
- /* Objects are used to specify the content which must be rendered
- on the canvas. This object represents the headline of the FIRE
- story.
-
- The origin coordinates specify the position for the object.
- The origin is specified relative to the coordinate system
- of the canvas.
-
- The dimensions, along with the origin coordinates, define the
- bounding rectangle of the area the object's content is rendered
- into. The content is scaled to fit into this area.
-
- An object can also be rotated, and a clip shape defined. In
- this example, the default rotation of 0 degrees is taken,
- and no clip shape is specified.
-
- Note that z-order is implied by the order of the objects; the
- first object is bottommost and the last object is topmost.
-
- Several other attributes can be specified in the body of an object.
- These are an identifier, units, type, rotation, clipper, container,
- graphic, and application specific attributes. Subsequent examples
- indicate the use of these.
-
- The bounding box is defined in the native content space. So,
- for PostScript, electronic points are used. The content is
- scaled to fit within the rectangle defined by the origin
- coordinates and dimensions. The bounding box specifies the
- portion of the content that is to be drawn into this rectangle.
-
- Bounding-box is optional. If omitted, the renderer will have
- to determine the information from the content itself. For
- example, a tagged content architecture might specify the
- bounding rectangle as one of its tags. One particular case
- is when the content is itself a PIL layout. Here the
- dimensions of the referenced PIL canvas provide the bounding
- box.
-
- rc-name gives the name for the entity containing the content
- ("rc" stands for "renderable content"). The entity name table
- associates this name with the physical location. In this case
- the entity name is "N FIRE HD 1". The name table indicates that
- the content is contained by a PostScript file, "R00001", in
- the same directory as the PIL file.
-
- The rc-type indicates the kind of data to be rendered.
- This is a union of "text", "structured-graphics", "lineart",
- and "image". If available, this information can be used by a
- renderer to make processing decisions. */
-
- object {
- origin { 750 500 }
- dimensions { 7000 1500 }
- user-name "Fire Story Headline"
- bbox { 0 108 252 108 }
- rc-name "N FIRE HD 1"
- rc-type { text }
- }
-
- /* This next object describes the photograph for the FIRE story.
- It illustrates the use of some additional PIL constructs. These
- are a clipper and a graphic. */
-
- object {
- origin { 2500 4450 }
- dimensions { 3500 3500 }
- user-name "Fire Story Photo"
-
- /* A clipper is used to clip the content of the object.
- Note that it is only the content which is clipped -- in
- particular the object graphic is not clipped. The clipper
- is a shape defined in the object coordinate system. In this
- case a clipper is defined to crop the photograph. */
-
- clipper {
- rectangle { 0 0 3500 3500 }
- }
-
- /* The object-graphic can be used to render simple graphics at the
- object level. Examples are rules and boxes. In this case the
- graphic is used to render a trap rule for the photograph. The
- trap rule is a 1-point wide square. */
-
- graphic {
- color-model pantone
- render-op stroke
- render-attributes {
- stroke-color "192"
- position outside
- width 14
- cap butt-cap
- join miter-join
- miter-limit 10
- }
- rectangle { 0 0 3500 3500 }
- }
- bbox { 0 0 350 350 }
- rc-name "N FIRE PH 1"
- rc-type { image }
- }
-
- /* The next two objects define the body text columns of the FIRE story.
- These illustrate the use of container shapes and identifiers.
-
- A container shape is used to define a shape for composing content.
- A single, closed shape may be specified. This restriction avoids the
- problem of defining z-order for multiple, overlapping shapes.
-
- Linkage of containers into flow sequences is specified with the
- "text-flow" construct. This construct specifies a series of objects
- which are to be linked into a flow sequence. The objects are
- identified by their id's. */
-
- object {
- id "I FIRE BT 1"
- origin { 750 2600 }
- dimensions { 3400 8400 }
- user-name "Fire Story Body Column 1"
- container {
- polygon {
- { 0 0 } { 3400 0 }
- { 3400 2300 } { 1700 2300 }
- { 1700 5900 } { 3400 5900 }
- { 3400 8400 } { 0 8400 }
- }
- }
- }
-
- object {
- id "I FIRE BT 2"
- origin { 4350 2600 }
- dimensions { 3400 8400 }
- user-name "Fire Story Body Column 2"
- container {
- polygon {
- { 0 0 } { 3400 0 }
- { 3400 8400 } { 0 8400 }
- { 0 5900 } { 1700 5900 }
- { 1700 2300 } { 0 2300 }
- }
- }
- }
-
- /* This text flow defines the layout and content which forms the
- body of the FIRE story. The layout sequence jumps from PAGE 1 to
- PAGE 2. This is specified by the "to" entry. */
-
- text-flow {
- flow-label "L FIRE BT"
- objects { "I FIRE BT 1" "I FIRE BT 2" }
- to {"N PAGE 2"}
- content { "N FIRE BT" }
- }
-
- }
-
-
- /* The following layout describes PAGE 2. */
-
- pil-layout-5.0 "N PAGE 2" {
-
- /* The ad content location is given as a full path name on a Unix file
- system. The ad is going to be created by another system. The generator
- of this PIL file expects that system to put the ad PIL and content
- files in the specified location. The systems have to agree on this
- by some interoperability mechanism. */
-
- name-table {
- "N AD 0175" pil-layout unix-filename "/Ads/0175/P00001"
- "N PAGE 1" pil-layout inline inline
- "N FIRE BT" ascii-text lcd-filename "E00001"
- }
-
- /* This canvas illustrates the use of application specific attributes.
- These are intended to be grouped and named according to the application
- which generates them. Each attribute consists of a name and a value. Values
- may be integers, floating point numbers, strings, or lists of these things.
- It is up to individual applications to define their own valid combinations
- of these pairs. */
-
- canvas {
- dimensions { 8500 11000 }
- units 25400
- user-name "Page 1"
- application {
- app-name "ATEX-Widget 2.0"
- uint8 { page-wrap 2 }
- uint32 { page-columns { 3400 3400 } }
- uint32 { page-gutters { 200 } }
- }
- application {
- app-name "ATEX-WotsitPlus"
- string { last-modified "Tue Oct 30 16:51:06 EST 1990" }
- }
- }
-
-
- /* This object describes the last column of body text on PAGE 2. A
- container shape is used to define the shape for composing text. */
-
- object {
- id "I FIRE BT 3"
- origin { 750 500 }
- dimensions { 2200 4900 }
- user-name "Fire Story Body Column 3"
- container {
- rectangle { 0 0 2200 4900 }
- }
- }
-
- /* The next two objects define the columns of the WIND story. */
-
- object {
- id "I WIND BT 1"
- origin { 5150 500 }
- dimensions { 2200 4900 }
- user-name "Wind Story Body Column 1"
- container {
- rectangle { 0 0 2200 4900 }
- }
- }
-
- object {
- id "I WIND BT 2"
- origin { 7550 500 }
- dimensions { 2200 4900 }
- user-name "Wind Story Body Column 2"
- container {
- rectangle { 0 0 2200 4900 }
- }
- }
-
- /* This object defines the display ad. Notice how the generator of the
- PIL specification need only know the destination size and entity
- name in order to write this specification.
-
- By looking in the entity name table we can see that the ad is
- actually described via a pil-layout entity. The actual dimensions
- of the ad will be determined from that entity.
-
- This is an example of one PIL description referencing another. We
- shall see more of how this referencing mechanism works in the PIL
- definition for the display ad itself. */
-
- object {
- origin { 750 5600 }
- dimensions { 7000 4900 }
- user-name "Honest Joe's Used Car Ad"
- rc-name "N AD 0175"
- rc-type {}
- }
-
- /* This text flow defines the layout and content which forms the
- body of the FIRE story. The layout sequence jumps from PAGE 1 to
- PAGE 2. This is specified by the "from" entry. The flow name
- allows the text flows on page 1 and page 2 to be matched up. */
-
- text-flow {
- flow-label "L FIRE BT"
- objects { "I FIRE BT 3" }
- from {"N PAGE 1"}
- content { "N FIRE BT" }
- }
-
- /* The second text flow defines just the layout for the body of the
- WIND story. In this case no content is provided. The layout is
- contained entirely within PAGE 2 so the flow name is unnecessary
- and there are no to or from entries. */
-
- text-flow {
- objects { "I WIND BT 1" "I WIND BT 2" }
- }
-
- }
-
-
- /* ---------------------------------------- */
- /* FILE DESCRIBING THE AD: /Ads/0175/P00001 */
- /* ---------------------------------------- */
-
- pil-layout-5.0 "N AD 0175" {
-
- name-table {
- "N TEXT 1" eps lcd-filename "R00001"
- "N TEXT 2" eps lcd-filename "R00002"
- "N IMAGE 1" tiff lcd-filename "R00003"
- }
-
- /* The canvas definition for the display ad is much like that for the
- pages. A different size is specified so that the ad is 7 by 4.9
- inches. Note that all content is clipped to these dimensions. */
-
- canvas {
- dimensions { 7000 4900 }
- units 25400
- user-name "Honest Joe's Used Car Ad"
- }
-
- /* The bottom-most object describes the car image and the ellipse which
- frames it. */
-
- object {
- id "I IMAGE 1"
- origin { 750 2750 }
- dimensions { 5000 2500 }
- user-name "Car Image"
-
- /* The rotation of the content and ellipse is effected by a 30 degree
- counter-clockwise rotation of the object space. */
-
- rot-angle 30
- rot-point { 0 0 }
-
- /* The object graphic is used to render the ellipse. Note that this
- ellipse is drawn in object space. Object space has been rotated
- thus the ellipse is also rotated. */
-
- graphic {
- color-model device-cmyk
- render-op stroke
- render-attributes {
- stroke-color { 0.6 0.2 0 0 }
- position centered
- width 14
- cap butt-cap
- join miter-join
- miter-limit 10
- }
- ellipse { -250 -1250 5250 4500 }
- }
- bbox { 0 0 50 250 }
- rc-name "N IMAGE 1"
- rc-type { image }
- }
-
- /* The second object describes the rotated logo text. Note
- the use of a rotation point and rotation angle. This results
- in a 90 degree counter-clockwise rotation of the logo by
- transforming the object coordinate space. */
-
- object {
- id "I TEXT 2"
- origin { 6000 4500 }
- dimensions { 4000 500 }
- user-name "Joe's Logo"
- rot-angle 90
- rot-point { 0 0 }
- bbox { 0 36 288 36 }
- rc-name "N TEXT 2"
- rc-type { text }
- }
-
- /* This object describes the text for "Honest Joe
- presents the 1990 Mazda". This object is similar to the one
- describing the headline for the FIRE story on PAGE 1. */
-
- object {
- id "I TEXT 1"
- origin { 500 500 }
- dimensions { 3000 1500 }
- user-name "1990 Mazda"
- rc-type { text }
- rc-name "N TEXT 1"
- bbox { 0 108 216 108 }
- }
-
- /* The group construct can be used to build hierarchic groupings of
- objects and other groups. The objects to be grouped are specified
- by their ids. In order to include a group within another group,
- it is given an id and listed as one of the objects. This example
- groups the two text objects together, and then groups them
- with the image. Grouping does not affect how objecst are drawn.
- Also, the order in which objects are specified is irrelevant. */
-
- group {
- id "I GROUP 1"
- objects { "I TEXT 1" "I TEXT 2" }
- }
- group {
- objects { "I IMAGE 1" "I GROUP 1" }
- }
- }