Design: 04.02.04.01/P09

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 9: Annotation text character up vector

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

ANNOTATION TEXT CHARACTER UP FOR HORIZONTAL ANNOTATION TEXT PATH:
The display should be a set of annotation text primitives
arranged as radii of a circle, all but one aligned in a dotted
annotation text extent rectangle with a dashed baseline.
Identify the single non-aligned annotation text primitive.

ANNOTATION TEXT CHARACTER UP FOR VERTICAL ANNOTATION TEXT PATH:
Same as for ANNOTATION TEXT CHARACTER UP FOR HORIZONTAL
ANNOTATION TEXT PATH, except the dashed line is a centerline, not
a baseline.

DESIGN:

throughout, use STROKE precision
use font#1 for horizontal path
txstr = "Going up?"

use <inquire text extent> on horizontal txstr to determine:
  ntxwd  = nominal width of annotation text extent rectangle
  ntxht  = nominal height of annotation text extent rectangle
  htab(ix) = normalized widths for horizontal alignments
  vtab(ix) = normalized heights for vertical alignments

numstr = number of strings to display = 7
ngstr = incorrect string identifier = random from 1-7
irad = inner radius of circle for display of annotation text strings
     = calculate from numstr and ntxht
orad = outer radius of circle for display of annotation text strings
     = calculate from irad and ntxwd
set up transform to fit annotation text circle on screen, centered at
  origin, with radius orad

annotation text alignments to be used:
   algnh    algnv
   ------   ------
1: center   base
2: left     cap
3: right    top
4: left     bottom
5: center   half
6: right    half
7: left     cap

set annotation text path = RIGHT
for ix = 1,numstr
   txang = angle for annotation text string = ix*2*pi / numstr
   draw and label as #ix a rectangle for expected position of
      annotation text string, based on txang, irad, orad
   txpos = requested annotation text position, based on txang,irad, and
      annotation text alignment to be requested.
   set annotation text alignment to (algnh(ix), algnv(ix))
   if (ix = ngstr) txang = txang +or- 0.125*2*pi/numstr
   chupx = cos(txang); chupy = sin(txang)
   set annotation text character up = chupx,chupy
   draw txstr at txpos
next ix

TEST: #SR 1 2 5 9 19 23 57 58 60 65 66 71 72
      "An annotation text primitive with STROKE precision and a
       horizontal annotation text path should be rotated
       according to the annotation text character up vector."

OPQA/ANNOTATION TEXT CHARACTER UP FOR HORIZONTAL ANNOTATION TEXT
  PATH: Which annotation text primitive is NOT aligned within the
  dotted annotation text extent rectangle on the dashed baseline?
pass/fail depending on (operator identifies annotation text #ngstr)

use font#2 for vertical path
txstr = "Up&@M"

use <inquire text extent> on horizontal txstr to determine:
  ntxwd  = nominal width of annotation text extent rectangle
  ntxht  = nominal height of annotation text extent rectangle
  htab(ix) = normalized widths for horizontal alignments
  vtab(ix) = normalized heights for vertical alignments

numstr = number of strings to display = 7
ngstr = incorrect string identifier = random from 1-7
irad = inner radius of circle for display of annotation text strings
     = calculate from numstr and ntxwd
orad = outer radius of circle for display of annotation text strings
     = calculate from irad and ntxht
set up transform to fit annotation text circle on screen, centered at
  origin, with radius orad

annotation text alignments to be used:
   algnh    algnv
   ------   ------
1: center   base
2: left     cap
3: right    top
4: left     bottom
5: center   half
6: right    half
7: left     cap

set annotation text path = DOWN
for ix = 1,numstr
   txang = angle for annotation text string = ix*2*pi / numstr
   draw and label as #ix a rectangle for expected position of
      annotation text string, based on txang, irad, orad
   txpos = requested annotation text position, based on
      txang,irad, and annotation text alignment to be requested.
   set annotation text alignment to (algnh(ix), algnv(ix))
   if (ix = ngstr) txang = txang +or- 0.125*2*pi/numstr
   chupx = cos(txang); chupy = sin(txang)
   set annotation text character up = chupx,chupy
   draw txstr at txpos
next ix

TEST: #SR 1 2 5 9 19 23 57 58 59 65 66 71 72
      "An annotation text primitive with STROKE precision and a
       vertical annotation text path should be rotated according
       to the annotation text character up vector."

OPQA/ANNOTATION TEXT CHARACTER UP FOR VERTICAL ANNOTATION TEXT
  PATH: Which annotation text primitive is NOT aligned within the
  dotted annotation text extent rectangle on the dashed
  centerline?
pass/fail depending on (operator identifies annotation text #ngstr)

END PROGRAM 9