Module #04.02.03.03 : Inquire text extent

All PVT documentation can be found under PHIGS Validation Tests - Overview. You may also return to the hierarchical table of topics covered by the PVT. For an explanation of the format of the individual module documentation, please see section 2.5 of the User's Guide.


DESCRIPTION: This module tests the behavior of the <inquire text
extent> function.  In the SR's, all references to text attributes
refer to the parameters of the function, not to elements within
the CSS or to text bundle tables.

SEMANTIC REQUIREMENTS:

*** *** ***   Input parameters   *** *** ***


SR1. Text font specifies which font of the given workstation type is used to generate the virtual text string from which the text extent rectangle is computed.
#F 269
#D 6.12.1.1 6.12.1.2
#S 4.5.5/45/2 4.5.7/55/7
#T P01/1 P01/2 P01/3 P01/4 P01/5 P05/1 P05/2 P05/3 P05/5 P05/6 P05/8
#T P05/9

SR2. For all text fonts, a character body in TLC is a rectangle generally surrounding the character, aligned such that the top, cap, half, base, and bottom lines are all parallel to the TLC x-axis and the left, centre, and right lines are all parallel to the TLC y-axis.
#F
#D
#S 4.5.5/48/6 4.5.5/48/7
#T P01/4 P01/5 P04/3 P04/4 P05/1 P05/2 P05/3 P05/5 P05/6 P05/8 P05/9
#T P06/1 P06/2 P06/3 #C A small part of a kerned character may lie slightly outside
its character body.

SR3. All text fonts are either monospaced or proportionately spaced. All character bodies within a monospaced font have the same font nominal height and the same font nominal width. All character bodies within a proportionately spaced font have the same font nominal height.
#F
#D
#S 4.5.5/48/6
#T P01/1 P01/2 P01/4 P05/1 P05/2 P05/3 P05/5 P05/6 P05/8 P05/9 #C In monospaced fonts, the nominal height need not equal the
nominal width. Font nominal height and width is the size, in
TLC, of the character bodies of a given font as set by the
character height and width aspects.

SR4. Text font 1 is monospaced.
#F 269
#D
#S 4.5.5/48/5 4.5.5/48/6 4.14/113/3
#T P01/1 P01/2 P01/5

SR5. For text font 1, the results are workstation independent.
#F 269
#D
#S 4.5.7/55/7
#T P01/5

SR6. The magnitude of the character expansion factor specifies the amount by which the font nominal width/height ratio of individual TLC character bodies is multiplied to yield the actual TLC width/height ratio.
#F 269
#D
#S 4.5.5/45/2 4.5.5/45/4 5.4.2/138/6
#T P02/1 P02/2 P02/3 P02/4 P02/5 P02/6 P02/15 P02/16 P02/17 P02/18
#T P02/19 P02/20 P02/21 P02/22 P02/23 P03/1 P03/2 P03/3 P03/4 P03/5
#T P03/6 P03/15 P03/16 P03/17 P03/18 P03/19 P03/20 P03/21 P03/22 P03/23
#T P05/4 P05/5 P05/6 P05/7 P05/8 P05/9 P06/1 P06/2 P06/3

SR7. Character spacing specifies the TLC distance (positive) or overlap (negative) between adjacent character bodies, expressed in units of the font nominal character height.
#F 269
#D
#S 4.5.5/45/3 4.5.5/51/1 4.5.5/52/1 4.5.7/57/1
#T P02/13 P02/14 P02/15 P02/16 P02/17 P02/18 P02/19 P02/20 P02/21
#T P02/22 P02/23 P03/13 P03/14 P03/15 P03/16 P03/17 P03/18 P03/19
#T P03/20 P03/21 P03/22 P03/23 P05/5 P05/6 P05/8 P05/9 P06/1 P06/2
#T P06/3

SR8. The magnitude of the character height specifies, in TLC, the font nominal height (from baseline to capline) of a capital letter.
#F 269
#D
#S 4.5.5/45/2 4.5.5/46/1 4.5.5/48/7 5.4.2/140/1
#T P02/7 P02/8 P02/9 P02/10 P02/11 P02/12 P02/15 P02/16 P02/17 P02/18
#T P02/19 P02/20 P02/21 P02/22 P02/23 P03/7 P03/8 P03/9 P03/10 P03/11
#T P03/12 P03/15 P03/16 P03/17 P03/18 P03/19 P03/20 P03/21 P03/22
#T P03/23 P04/1 P05/4 P05/5 P05/6 P05/7 P05/8 P05/9 P06/1 P06/2 P06/3 #C Character height is measured in TLC, along the character up
vector.

SR9. The font nominal width in TLC of a character within a text primitive is given by the font's intrinsic width to height ratio for that character times the magnitude of the character height.
#F 269
#D 6.12.1.2.1
#S 4.5.5/44/9 4.5.5/45/2 5.4.2/140/1
#T P01/4 P02/7 P02/8 P02/9 P02/10 P02/11 P02/12 P02/15 P02/16 P02/17
#T P02/18 P02/19 P02/20 P02/21 P02/22 P02/23 P03/7 P03/8 P03/9 P03/10
#T P03/11 P03/12 P03/15 P03/16 P03/17 P03/18 P03/19 P03/20 P03/21
#T P03/22 P03/23 P05/5 P05/6 P05/8 P05/9 #C Since character height also sets the character width
attribute, it is in effect a scaling factor for the entire
character.

SR10. The text path specifies the writing direction within the TLC text plane for the text string (i.e. the direction in which successive character bodies are appended) as follows: RIGHT: positive x-axis, LEFT: negative x-axis, UP: positive y-axis, DOWN: negative x-axis.
#F 269
#D
#S 4.5.5/45/2
#T P01/1 P01/2 P01/4 P02/2 P02/4 P02/6 P02/8 P02/10 P02/12 P02/14
#T P02/16 P02/18 P02/20 P02/22 P03/2 P03/4 P03/6 P03/8 P03/10 P03/12
#T P03/14 P03/16 P03/18 P03/20 P03/22 P04/3 P04/4 P04/5 P04/6 P04/7
#T P05/4 P05/5 P05/6 P05/7 P05/8 P05/9 P06/1 P06/2 P06/3

SR11. The text alignment specifies which horizontal and vertical location within the text rectangle is to coincide with the TLC origin by shifting the text rectangle within the text plane. For all text paths, alignments LEFT, RIGHT, BOTTOM, and TOP refer to the left, right, bottom, and top edges of the rectangle, and CENTRE refers to the horizontal location midway between the left and right edges. For horizontal text paths, CAP, HALF, and BASE refer to the capline, halfline, and baseline of the whole text string. For vertical text paths, CAP refers to the capline of the topmost character, BASE refers to the baseline of the bottommost character, and HALF refers to the vertical location midway between the halflines of the topmost and bottommost characters.
#F 269
#D
#S 4.5.5/45/4 4.5.5/45/6 4.5.5/46/1
#T P04/1 P04/2 P04/3 P04/4 P04/5 P04/6 P04/7 P05/5 P05/6 P05/8 P05/9
#T P06/2 P06/3

SR12. The effect of NORMAL as the horizontal or vertical component of text alignment is equivalent to one of the other defined values for text alignment and depends on text path as follows: text path | (horizontal, vertical) -----------+------------------------ RIGHT | (LEFT, BASE) LEFT | (RIGHT, BASE) UP | (CENTRE, BASE) DOWN | (CENTRE, TOP)
#F 269
#D
#S 4.5.5/46/3 4.5.5/47/1
#T P04/3 P04/4 P04/5 P04/6 P06/3

*** *** ***   Implicit text attributes   *** *** ***


SR13. In <inquire text extent>, the implicit text position is (0,0), the implicit character up vector is (0,1), and the implicit text precision is STROKE.
#F 269
#D
#S 4.5.7/55/7 4.5.7/56/1
#T P01/3 P02/1 P02/2 P02/3 P02/4 P02/5 P02/6 P02/7 P02/8 P02/9 P02/10
#T P02/11 P02/12 P02/13 P02/14 P02/15 P02/16 P02/17 P02/18 P02/19
#T P02/20 P02/21 P02/22 P02/23 P03/1 P03/2 P03/3 P03/4 P03/5 P03/6
#T P03/7 P03/8 P03/9 P03/10 P03/11 P03/12 P03/13 P03/14 P03/15 P03/16
#T P03/17 P03/18 P03/19 P03/20 P03/21 P03/22 P03/23 P04/3 P04/4 P04/5
#T P04/6 P04/7 P05/5 P05/6 P05/8 P05/9

SR14. For text precision = STROKE, text is displayed with all text aspects applied exactly.
#F 269
#D
#S 4.5.5/48/1 4.5.5/49/5
#T P02/3 P02/4 P02/5 P02/6 P02/9 P02/10 P02/11 P02/12 P03/3 P03/4
#T P03/5 P03/6 P03/9 P03/10 P03/11 P03/12 P05/5 P05/6 P05/8 P05/9 #C Minima and maxima for character expansion factor and character
height are not applied.
*** *** ***   Output parameters   *** *** ***


SR15. For horizontal text paths, the left (right) edge of the text extent rectangle (expressed in TLC) coincides with the left (right) edge of the leftmost (rightmost) character of the text string, as it would be generated for the implicit and specified attributes and workstation type. Its top and bottom edges coincide with the top and bottom edges of the character bodies.
#F 269
#D 6.12.1.2.1
#S 4.5.5/45/4 4.5.7/55/7 4.5.7/56/2
#T P01/1 P01/4 P01/5 P02/1 P02/3 P02/5 P02/7 P02/9 P02/11 P02/13 P02/15
#T P02/17 P02/19 P02/21 P02/23 P04/3 P04/4 P05/1 P05/3 P05/4 P05/5
#T P06/1 #C The height of the character bodies for the specified font is
determined by the character height parameter. Within a font, all
character bodies have the same nominal height, but not
necessarily the same nominal width; see SR3. Since the data type
of the returned rectangle is B (bounds), the first value in each
dimension is always less than or equal to the second. Since the
characters are aligned on the baseline, their top (bottom) edges
are all colinear.

SR16. For vertical text paths, the top (bottom) edge of the text extent rectangle (expressed in TLC) coincides with the top (bottom) edge of the topmost (bottommost) character of the text string, as it would be generated for the implicit and specified attributes and workstation type. Its width is the width of the widest character body within the font as determined by character height and as modified by the character expansion factor parameter. Its left and right edges are equidistant from the centreline along which the character bodies are aligned.
#F 269
#D 6.12.1.2.1
#S 4.5.5/45/4 4.5.7/55/7 4.5.7/56/2
#T P01/2 P01/4 P01/5 P03/1 P03/3 P03/5 P03/7 P03/9 P03/11 P03/13 P03/15
#T P03/17 P03/19 P03/21 P03/23 P04/3 P04/4 P04/6 P04/7 P05/1 P05/2
#T P05/7 P05/8 P06/1 #C Within a font, all character bodies have the same height, but
not necessarily the same width; see SR3. Since the data type of
the returned rectangle is B (bounds), the first value in each
dimension is always less than or equal to the second. Note that
the width of a vertical rectangle depends on the text font as a
whole and not directly on the various sizes of the individual
characters contained in the text string.


SR17. The location of the concatenation point (CP), expressed in TLC, for zero character spacing depends on text path as follows: ------------------------------------------------------------------- text path | horizontal-CP vertical-CP -----------+------------------------------------------------------- RIGHT | right edge of text extent text-position (zero) LEFT | left edge of text extent text-position (zero) DOWN | text-position (zero) bottom edge of text extent UP | text-position (zero) baseline of next character
#F 269
#D
#S 4.5.7/56/3 4.5.7/56/4 4.5.7/57/1
#T P02/2 P02/4 P02/6 P02/8 P02/10 P02/12 P02/14 P02/16 P02/18 P02/20
#T P02/22 P03/2 P03/4 P03/6 P03/8 P03/10 P03/12 P03/14 P03/16 P03/18
#T P03/20 P03/22 P04/5 P05/4 P05/6 P05/7 P05/9 P06/3 #C "Baseline of next character" means that if the text string had
contained one additional character at its end, this would be the
location of the baseline of that character. This is implied
because the program must specify a NORMAL vertical component for
text alignment for vertical text paths to perform concatenation
properly. For text path = UP, this means that the next text
string will be aligned on the baseline of the next character.

SR18. The location of the concatenation point includes character spacing after the last character in text string in the direction of the TEXT PATH.
#F 269
#D
#S 4.5.7/56/3 4.5.7/57/1
#T P02/14 P02/16 P02/18 P02/20 P02/22 P03/14 P03/16 P03/18 P03/20
#T P03/22 P04/5 P05/4 P05/6 P05/7 P05/9 P06/3


LOCAL DICTIONARY:

  Functions ---
  269: pqtxx   <inquire text extent>
 
  Data Structures ---
  6  ...  workstation_description_table
  6.12  ...  text_entry
  6.12.1  ...  text_facilities
  6.12.1.1  ...  number_of_text_font_and_precision_pairs
  6.12.1.2  ...  list_of_text_font_and_precision_pairs
  6.12.1.2.1  ...  text_font_and_precision_pair
 
SEMANTIC CROSS-REFERENCES:
  02.03.03/SR15

LOCAL SUBROUTINES: The programs in this module use the following
subroutines:

CHTXRC: Computes expected results for various parameter values
which affect the size of the text extent rectangle and the
concatenation point.  Computation is based on deviation from
nominal width and length of entire string.  Therefore, CHTXRC may
be used for non-monospaced fonts.

CHMONO: Computes expected results for various parameter values
which affect the size of the text extent rectangle and the
concatenation point.  Computation is based on deviation from
nominal character size in text path dimension and thickness of
entire string in other dimension.  Therefore, CHMONO is valid
only when every character in the string has the same size.

TXCOMP: Compares actual and expected values for results of
<inquire text extent> and reports results in two logical
variables.  TXCOMP tests both text paths for the given
orientation, i.e. LEFT and RIGHT for horizontal, UP and DOWN
for vertical.



PROGRAM 1: Text font in <inquire text extent>

You may inspect either the design or code for this program.


PROGRAM 2: Text rectangle size and concatenation point for horizontal text orientation

You may inspect either the design or code for this program.


PROGRAM 3: Text rectangle size and concatenation point for vertical text orientation

You may inspect either the design or code for this program.


PROGRAM 4: Text alignment

You may inspect either the design or code for this program.


PROGRAM 5: Text extent results derived from nominal character sizes

You may inspect either the design or code for this program.


PROGRAM 6: Appearance of text extent rectangle

You may inspect either the design or code for this program.

End of documentation for 04.02.03.03