|
|
DataMuseum.dkPresents historical artifacts from the history of: ICL Comet 32 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about ICL Comet 32 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1219 (0x4c3)
Types: TextFile
Notes: UNIX file
Names: »cinquiry.c«
└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
└─⟦28c352965⟧ »/a« UNIX Filesystem
└─⟦this⟧ »usr/src/gks/comet/cinquiry.c«
#include "../h/vdi.h"
#include "../h/vdii.h"
dt1ite(p, s, cat, tr) /* Inquire text extent.*/
Nc *p;
String s;
Nc *cat;
Nrect *tr;
{ int n;
Int i, ii, iii;
Real l, ll, lll, llll;
/* Get number of characters in string.*/
n = 0;
while (s[n] != '\0')
n++;
/* Compute length of string, inter-character space, inter-line
space, and convert to NDC.*/
i = n*ws->csp.a_x;
l = i/ws->wtr.xm;
ii = ws->csp.a_x - ws->csz.a_x;
ll = ii/ws->wtr.xm;
iii = ws->csp.a_y - ws->csz.a_y;
lll = iii/ws->wtr.ym;
llll = ws->csz.a_y/ws->wtr.ym;
/* Compute x values of concatenation point and text rectangle.*/
switch (ws->cha)
{
case LEFT:
tr->n_ll.n_x = p->n_x;
break;
case CENTRE:
tr->n_ll.n_x = p->n_x - (l - ll)/2;
break;
case RIGHT:
tr->n_ll.n_x = p->n_x - (l - ll);
break;
}
cat->n_x = tr->n_ll.n_x + l;
tr->n_ur.n_x = cat->n_x - ll;
/* Compute y values of concatenation point and text rectangle.*/
switch (ws->cva)
{
case BOTTOM:
cat->n_y = p->n_y + lll;
break;
case BASE:
cat->n_y = p->n_y;
break;
case HALF:
cat->n_y = p->n_y - llll/2;
break;
case CAP:
case TOP:
cat->n_y = p->n_y - llll;
break;
}
tr->n_ll.n_y = cat->n_y - lll;
tr->n_ur.n_y = cat->n_y + llll;
}