Design: 04.02.03.03/P02
This is an abstract, language-independent design. Grim
details may be found in the
corresponding source code.
You may return to the
documentation
for the module containing this program design, or to the
entire hierarchical table of
topics covered by the PVT.
PROGRAM 2: Text rectangle size and concatenation point
for horizontal text orientation
CHARACTERISTICS: ynnn
OPERATOR SCRIPT: passive test.
DESIGN:
Open primary workstation
Establish specwt = specific primary workstation type
Throughout, use variable names:
wktype: workstation type
font: text font
chxp: character expansion factor
chsp: character spacing
chh: character height
txp: text path
txal: text alignment
str: character string
<inquire text facilities> to determine:
mnchxp = minimum character expansion factor
mxchxp = maximum character expansion factor
mnchh = minimum character height
mxchh = maximum character height
<Inquire text extent> with:
wktype = specwt
font = a randomly selected font; non-monospaced if possible
chxp = 1.0
chsp = 0.0
chh = 1.0
txp = RIGHT
txal = LEFT, BOTTOM
str = "Inquire text extent"
to determine:
nomw = nominal width = abs (txexrx(2) - txexrx(1))
nomh = nominal height = abs (txexry(2) - txexry(1))
*** *** *** character expansion factor *** *** ***
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 1.7
chsp = 0
chh = 1.0
to determine: rectok, ccpok
TEST: #SR 6 13 15
"The width of a text rectangle with zero character spacing
and a horizontal text path should expand in
proportion to the character expansion factor."
pass/fail depending on (rectok)
TEST: #SR 6 10 13 17
"With zero character spacing and a horizontal text path, the
concatenation point of a text rectangle should reflect its
expansion in proportion to the character expansion factor."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 1.7 * mxchxp
chsp = 0
chh = 1.0
to determine: rectok, ccpok
TEST: #SR 6 13 14 15
"The width of a text rectangle with zero character spacing
and a horizontal text path should expand in proportion to
the character expansion factor, even when it exceeds the
maximum for the workstation type."
pass/fail depending on (rectok)
TEST: #SR 6 10 13 14 17
"With zero character spacing and a horizontal text path, the
concatenation point of a text rectangle should reflect its
expansion in proportion to the character expansion factor,
even when it exceeds the maximum for the workstation type."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 0.6 * mnchxp
chsp = 0
chh = 1.0
to determine: rectok, ccpok
TEST: #SR 6 13 14 15
"The width of a text rectangle with zero character spacing
and a horizontal text path should expand in proportion to
the character expansion factor, even when it is less than
the minimum for the workstation type."
pass/fail depending on (rectok)
TEST: #SR 6 10 13 14 17
"With zero character spacing and a horizontal text path, the
concatenation point of a text rectangle should reflect its
expansion in proportion to the character expansion factor,
even when it is less than the minimum for the workstation
type."
pass/fail depending on (ccpok)
*** *** *** character height *** *** ***
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 1.0
chsp = 0
chh = 1.9
to determine: rectok, ccpok
TEST: #SR 8 9 13 15
"The size of a text rectangle with character spacing = 0,
character expansion factor = 1, and a horizontal text path
should expand in proportion to the character height."
pass/fail depending on (rectok)
TEST: #SR 8 9 10 13 17
"With character spacing = 0, character expansion factor =
1, and a horizontal text path, the concatenation point of a
text rectangle should reflect its expansion in proportion
to the character height."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 1.0
chsp = 0
chh = 1.9 * mxchh
to determine: rectok, ccpok
TEST: #SR 8 9 13 14 15
"The size of a text rectangle with character spacing = 0,
character expansion factor = 1, and a horizontal text path
should expand in proportion to the character height,
even when it exceeds the maximum for the workstation
type."
pass/fail depending on (rectok)
TEST: #SR 8 9 10 13 14 17
"With character spacing = 0, character expansion factor =
1, and a horizontal text path, the concatenation point of a
text rectangle should reflect its expansion in proportion
to the character height, even when it exceeds the maximum
for the workstation type."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 1.0
chsp = 0
chh = 0.6 * mnchh
to determine: rectok, ccpok
TEST: #SR 8 9 13 14 15
"The size of a text rectangle with character spacing = 0,
character expansion factor = 1, and a horizontal text path
should expand in proportion to the character height,
even when it is less than the minimum for the workstation
type."
pass/fail depending on (rectok)
TEST: #SR 8 9 10 13 14 17
"With character spacing = 0, character expansion factor =
1, and a horizontal text path, the concatenation point of a
text rectangle should reflect its expansion in proportion
to the character height, even when it is less than the
minimum for the workstation type."
pass/fail depending on (ccpok)
*** *** *** character spacing *** *** ***
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 1.0
chsp = 0.3
chh = 1.0
to determine: rectok, ccpok
TEST: #SR 7 13 15
"The width of a text rectangle with character expansion
factor = 1, character height = 1, and a horizontal text
path should increase by the character spacing times one
less than the number of characters."
pass/fail depending on (rectok)
TEST: #SR 7 10 13 17 18
"With character expansion factor = 1, character height = 1,
and a horizontal text path, the concatenation point of a
text rectangle should reflect its increased size due to
character spacing."
pass/fail depending on (ccpok)
*** *** *** combined attributes *** *** ***
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 35.3
chsp = 6.2
chh = 21.1
to determine: rectok, ccpok
TEST: #SR 6 7 8 9 13 15
"The size of a text rectangle with a horizontal text path
should reflect the combined effects of large values for
character expansion factor, character spacing, and
character height."
pass/fail depending on (rectok)
TEST: #SR 6 7 8 9 10 13 17 18
"With large values for character expansion factor,
character spacing, and character height, and a horizontal
text path, the concatenation point of a text rectangle
should reflect its increased size."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = .035
chsp = .0062
chh = .021
to determine: rectok, ccpok
TEST: #SR 6 7 8 9 13 15
"The size of a text rectangle with a horizontal text path
should reflect the combined effects of small values for
character expansion factor, character spacing, and
character height."
pass/fail depending on (rectok)
TEST: #SR 6 7 8 9 10 13 17 18
"With small values for character expansion factor,
character spacing, and character height, and a horizontal
text path, the concatenation point of a text rectangle
should reflect its decreased size."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = -8.035
chsp = -.51
chh = .021
to determine: rectok, ccpok
TEST: #SR 6 7 8 9 13 15
"The size of a text rectangle with a horizontal text path
should reflect the combined effects of negative values for
character expansion factor and character spacing."
pass/fail depending on (rectok)
TEST: #SR 6 7 8 9 10 13 17 18
"With negative values for character expansion factor and
character spacing, and a horizontal text path, the concatenation
point of a text rectangle should reflect its altered size."
pass/fail depending on (ccpok)
call CHTXRC with: nomw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 28.035
chsp = -2.13
chh = -.021
to determine: rectok, ccpok
TEST: #SR 6 7 8 9 13 15
"The size of a text rectangle with a horizontal text path
should reflect the combined effects of negative values for
character spacing and character height."
pass/fail depending on (rectok)
TEST: #SR 6 7 8 9 10 13 17 18
"With negative values for character spacing and character
height, and a horizontal text path, the concatenation point of
a text rectangle should reflect its altered size."
pass/fail depending on (ccpok)
*** *** *** Excessive character spacing *** *** ***
<Inquire text extent> with:
wktype = specwt
font = 2
chxp = 1.0
chsp = 0.0
chh = 1.0
txp = RIGHT
txal = LEFT, BOTTOM
str = "qqqq"
to determine:
nomcw = nominal character width = abs (txexrx(2) - txexrx(1)) / 4
nomh = nominal string height = abs (txexry(2) - txexry(1))
call CHMONO with: nomcw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = 6.35
chsp = -8.51 * abs(chxp * nomcw)
chh = -.021
to determine: rok1, ccpok1
call CHMONO with: nomcw, nomh, specwt, font, str unchanged
txor = horizontal
chxp = -.065
chsp = -1.01 * abs(chxp * nomcw)
chh = -7.21
to determine: rok2, ccpok2
TEST: #SR 6 7 8 9 13 15
"The size of a text rectangle with a horizontal text path
should reflect the effect of negative character spacing
of greater magnitude than the expanded width of a single
character."
pass/fail depending on (rok1 and rok2)
END PROGRAM 2