Design: 04.02.03.01/P04

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 4: Character height and expansion factor

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

NEGATIVE CHARACTER HEIGHT AND EXPANSION FACTOR: All lines but one
should contain normal text - i.e. the characters should be
right-side up and not reversed left to right (mirror image).
Identify the line whose text is not normal.

DESIGN:

<inquire text facilities> to determine
naht = # available character heights
minht = minimum character height
maxht = maximum character height

TEST: #SR 53
      "Maximum character height should not be less than the
       minimum character height."
pass/fail depending on (maxht >= minht)

TEST: #SR 53 54
      "The minimum and maximum character heights should be
       positive."
pass/fail depending on (minht and maxht > 0)

TEST: #SR 53 55 57
      "The reported number of available character heights
       should be at least 0."
pass/fail depending on (naht >= 0)

TEST: #SR 3 4 5 6 7 8 28 29 30 36 37 56 57 59 61
      "Test cases for the visual effect of approximated text
       attributes (character height and character expansion
       factor) in STRING and CHAR precision are not yet
       available."
pass

TEST: #SR 11 14 34 35 36 52 58 59
      "Only the magnitude of character expansion factor and
       character height should affect the text primitive."

perm = permute 1 thru 5
chmag = magnitude of character height
cxmag = magnitude of character expansion factor
chstr = some non-symmetric characters = "2P4Q5R7"
label text lines
do ix = 1 to 5
   this = perm(ix)
   if (this < 3) then
      chht = -chmag
   else
      chht = +chmag
   endif

   if (mod(this,2) = 0) then
      chxp = -cxmag
   else
      chxp = +cxmag
   endif

   if (this = 5) then
      yup = -1 (reverse up and down)
   else
      yup = 1
   endif

   set character height    = chht
   set character expansion = chxp
   set character up        = 0,yup
   draw text chstr on line #ix
next ix

OPQA/NEGATIVE CHARACTER HEIGHT AND EXPANSION FACTOR: Which line
  does NOT have normally oriented characters?
pass/fail depending on (operator indicates line with reversed text)

END PROGRAM 4