Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

SET ANNOTATION TEXT ALIGNMENT(3P)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

SET ANNOTATION TEXT ALIGNMENT − create a structure element to set the current text alignment attribute

SYNOPSIS

C Syntax

void
pset_anno_align ( text_align )
Ptext_align∗text_align;text alignment

Required PHIGS Operating States

(PHOP, ∗, STOP, ∗)

DESCRIPTION

Purpose

SET ANNOTATION TEXT ALIGNMENT creates a structure element containing a value for the current annotation text alignment attribute, which positions the annotation text string in relation to the annotation text position.  This attribute applies to the output primitives:

• ANNOTATION TEXT RELATIVE

• ANNOTATION TEXT RELATIVE 3

If the current edit mode is INSERT, a SET ANNOTATION TEXT ALIGNMENT element is inserted into the currently open structure after the element pointed to by the current element pointer.  If the edit mode is REPLACE, then the new SET ANNOTATION TEXT ALIGNMENT element replaces the element pointed to by the element pointer.  In either case, the element pointer is updated to point to the new element. 

C Input Parameter

text_align
A pointer to the text alignment structure, defined as follows:

typedef struct {
Phor_text_alignhor; horizontal component
Pvert_text_alignvert; vertical component
} Ptext_align;

text_align->hor is the horizontal component.  This is an enumerated value, and may be one of:

PHOR_NORMNORMAL
PHOR_LEFTLEFT
PHOR_CTRCENTER
PHOR_RIGHTRIGHT

text_align->vert is the vertical component.  This is an enumerated value, and may be one of:

PVERT_NORM NORMAL
PVERT_TOPTOP
PVERT_CAPCAP
PVERT_HALFHAFL
PVERT_BASEBASE
PVERT_BOTTOM BOTTOM

Execution

When the SET ANNOTATION TEXT ALIGNMENT element is traversed, the current annotation text alignment entry in the traversal state list is set to annotation text alignment.  This attribute is used to position text strings from annotation text output primitives that follow in the structure network, in relation to the text position provided with each text output primitive.  The two components of the alignment can be considered individually. 

Imagine first rendering the text string using all other text attributes, and then moving the entire text string to place the text extent parallelogram that surrounds the character bodies into the correct position in relation to the text position.  (The size and shape of the text is entirely specified by the other attributes.)  This movement is oriented by the annotation text character up vector and the annotation text character base vector.  (Consider the direction of the character up vector to be vertical and that of the character base vector to be horizontal.) 

The horizontal alignment of LEFT or RIGHT requires the corresponding side of the parallelogram to pass through the text position.  The horizontal alignment of CENTER causes the text position to lie midway between the left and right sides of the parallelogram. 

The vertical alignment corresponds to one of the five horizontal lines through the definition of a character.  (These lines are in the same location for every character in a single font.)  The vertical alignment of TOP or BOTTOM requires the corresponding side of the parallelogram to pass through the text position.  The vertical alignment of CAP causes the text position to lie on the capline of the string (when the annotation text path is LEFT or RIGHT) or on the cap line of the topmost character in the string (when the annotation text path is UP or DOWN).  The vertical alignment of BASE causes the text position to lie on the base line of the entire string (when the annotation text path is LEFT or RIGHT) or on the base line of the bottom character in the string (when annotation text path is UP or DOWN).  The vertical alignment of HALF causes the text position to lie on the half line of the entire string (when the annotation text path is LEFT or RIGHT) or on a line midway between the half lines of the top and bottom characters (when annotation text path is UP or DOWN). 

The Normal value of either annotation text alignment component causes an effect equivalent to one of the other values of the same component.  PHIGS defines which other value is used as the natural alignment for the annotation text path value used:

Annotation Text Path ValueEquivalent (Horizontal, Vertical) Alignment
RIGHTLeft, Base
LEFTRight, Base
UPCenter, Base
DOWNCenter, Top

The default annotation text alignment is (NORMAL, NORMAL); the default annotation text path is RIGHT. 

Example

(CENTER, TOP) annotation text alignment might be used with annotation text path RIGHT to center a chart’s x-axis label under the x-axis, without calculating the combined size of the characters in the string.  (RIGHT, CENTER) might be used with annotation text path DOWN to center the right edge of a chart’s y-axis label along the y-axis.  Each character faces normally, but the characters in the string would proceed down the display, to the left of the y-axis. 

ERRORS

005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)

SEE ALSO

ANNOTATION TEXT RELATIVE 3 (3P)
SET TEXT ALIGNMENT (3P)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026