File: vfset.c

package info (click to toggle)
dvi2ps 3.2j-9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,344 kB
  • ctags: 1,896
  • sloc: ansic: 12,767; sh: 938; makefile: 269
file content (54 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * setchar for virtual font
 */

#include	"defs.h"
#include	"commands.h"
#include	"dconv.h"
#include	"global.h"
#include	"set.h"

void
virf_setchar(c, Move)
int c;
BOOLEAN Move;
{
    int cw;

    chmove = Move;
    cw = DEV_setchar(c);
    if (Move)
	*move += cw;

#ifdef STATS
    Stnc += 1;
    curfontent->ncts += 1;
#endif
}

#define	STRLEN		256
void
virf_setstring(firstch)	/* read and set a consecutive string of chars */
int firstch;
{
    char s[STRLEN];
    char *sp;
    int c, len;

    /* read entire string of chars */
    /* ensure that all characters are loaded, */
    for (c = firstch, sp = s, len = 0;
	 c >= SETC_000 && c <= SETC_127 && len < STRLEN; len++) {
	*sp++ = c;
	c = DC_getcommand();
    }
    DC_backupone();

    chmove = TRUE;
    *move += DEV_setstring(s, len);

#ifdef STATS
    Stnc += len;
    curfontent->ncts += len;
#endif
}