#include "rle_config.h"
#include <stdio.h>
#include "types.h"
#include "conv.h"
#include "dviclass.h"
#include "dvicodes.h"
#include "error.h"
#include "fio.h"
#include "font.h"
#include "gripes.h"
#include "dvistate.h"
#include "dvirle.h"
Go to the source code of this file.
#define ABS |
( |
|
n | ) |
((n) >= 0 ? (n) : -(n)) |
#define CHECK |
( |
|
cond, |
|
|
|
msg, |
|
|
|
flag |
|
) |
| |
Value:
error(0, 0, warn, msg); \
flag = 1; \
} \
goto ignore; \
}
#define InitialChars 4000 /* initial number of chars to allocate */ |
void BeginPage |
( |
i32 * |
count | ) |
|
Definition at line 221 of file dvirle1.c.
227 (void) putc(
' ', stderr);
228 (void) fprintf(stderr,
"[%d", (
int)count[0]);
229 (void) fflush(stderr);
Definition at line 386 of file dvirle1.c.
392 error(0, 0,
"Warning: character code %ld too big",
void ComputeCWidths |
( |
struct font * |
f | ) |
|
Definition at line 96 of file dvirle1.c.
99 register struct glyph *
g;
102 for (i = 0; i < 128; i++) {
105 g->g_pixwidth = fromSP(g->g_tfmwidth);
struct font* DefineFont |
( |
char * |
name, |
|
|
i32 |
dvimag, |
|
|
i32 |
dvidsz |
|
) |
| |
Definition at line 173 of file dvirle1.c.
177 register struct font *f;
183 error(1, 0,
"too many fonts (%d) used", next);
185 f = GetRasterlessFont(name, dvimag, dvidsz,
"versatec", &path);
187 GripeCannotGetFont(name, dvimag, dvidsz,
"versatec", path);
191 (void) fprintf(stderr,
"[%s -> %s]\n", Font_TeXName(f), path);
192 (void) fflush(stderr);
199 PutLong(stdout, 300);
200 PutLong(stdout, ds.ds_usermag);
201 PutLong(stdout, ds.ds_num);
202 PutLong(stdout, ds.ds_denom);
203 PutLong(stdout, ds.ds_dvimag);
206 PutLong(stdout, f->f_checksum);
207 PutLong(stdout, dvimag);
208 PutLong(stdout, dvidsz);
210 PutLong(stdout, len);
211 (void) fputs(name, stdout);
213 f->f_un.f_int = next++;
void ComputeCWidths(struct font *f)
void DoSpecial |
( |
i32 |
len | ) |
|
Definition at line 310 of file dvirle1.c.
314 error(0, 0,
"warning: ignoring \\special");
315 (void) fseek(ds.ds_fp, (
long) len, 1);
Definition at line 248 of file dvirle1.c.
References Chars, Debug, fcp, HFlag, MaxChars, PageHeight, PageWidth, SFlag, and yx.
250 register int i, *
y, *f, t, v, oldv;
259 (void) fflush(stderr);
269 fprintf( stderr,
"oldv: %ld, yx: %lx (%d,%d), fcp: %lx\n",
270 oldv, *y, (*y >> 16), (*y & 0xffff), *f );
274 t = (t << 16) | (*y++ & 0xffff);
285 t = *f++ & 0x7fffffff;
Definition at line 113 of file dvirle1.c.
References Chars, fcp, MaxChars, nextfcp, nextyx, and yx.
115 register unsigned newsize;
119 if ((yx = (
int *) realloc((
char *) yx, newsize)) == NULL)
120 GripeOutOfMemory(newsize,
"yx array");
121 if ((
fcp = (
int *) realloc((
char *)
fcp, newsize)) == NULL)
122 GripeOutOfMemory(newsize,
"fcp array");
void main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 684 of file dvirle1.c.
696 ds.ds_usermag = 1000;
700 while ((c =
getopt(argc, argv,
"cd:hm:sD")) != EOF) {
708 ds.ds_maxdrift = atoi(
optarg);
716 ds.ds_usermag = atoi(
optarg);
728 (void) fprintf(stderr,
"\
729 Usage: %s [-c] [-h] [-m mag] [-s] [file]\n",
ProgName);
730 (void) fflush(stderr);
737 error(1, -1,
"can't open %s", argv[optind]);
740 if (MakeSeekable(stdin))
742 "unable to copy input to temp file (see the manual)");
753 putbyte(stdout, *s++);
771 error(1, 0,
"text object too high!");
773 error(1, 0,
"text object too wide!");
776 error(1, 0,
"text object too wide!");
786 cannot center (page too wide); placing flush left instead");
810 "Page too high (%d bits), truncated to %d bits\n",
822 "Page too wide (%d bits), truncated to %d bits\n",
831 ds.ds_fresh.hh = lmargin;
833 ds.ds_fresh.h = toSP(ds.ds_fresh.hh);
834 ds.ds_fresh.v = toSP(ds.ds_fresh.vv);
839 GripeOutOfMemory(
InitialChars *
sizeof *yx,
"yx array");
841 GripeOutOfMemory(
InitialChars *
sizeof *fcp,
"fcp array");
int getopt(int argc, argv, char *optstring)
#define DefaultBottomMargin
#define MinimumLeftMargin
#define DefaultLeftMargin
struct font * DefineFont(char *name, i32 dvimag, i32 dvidsz)
Definition at line 404 of file dvirle1.c.
References BottomEMsg, Chars, HFlag, LeftEMsg, nextyx, and TopEMsg.
406 static struct font NoFont;
409 register struct font *f = &NoFont;
410 register FILE *
fp = ds.ds_fp;
411 int doingpage = 0, advance;
413 static char warn[] =
"\
414 WARNING: text object(s) run off %s of page; ignored";
415 #define CHECK(cond, msg, flag) \
418 error(0, 0, warn, msg); \
435 register struct glyph *
g;
436 register int ulcx, ulcy,
height;
447 ulcy = dvi_vv + g->g_height - g->g_yorigin;
448 ulcx = dvi_hh - g->g_xorigin;
449 height = g->g_height;
455 ulcy = dvi_hh + g->g_width - g->g_xorigin;
457 (dvi_vv + g->g_height - g->g_yorigin);
468 for (c = 0; height > 0; c++) {
471 *
nextyx++ = (ulcy << 16) | ulcx;
479 dvi_h += g->g_tfmwidth;
480 dvi_hh += g->g_pixwidth;
488 GripeUnexpectedDVIEOF();
493 switch (DVI_OpLen(c)) {
533 panic(
"DVI_OpLen(%d) = %d", c, DVI_OpLen(c));
567 GripeUnexpectedOp(
"BOP (already in page)");
574 GripeUnexpectedOp(
"EOP (no BOP)");
579 *ds.ds_sp++ = ds.ds_cur;
583 ds.ds_cur = *--ds.ds_sp;
605 if (F_SMALLH(f, p)) {
610 dvi_hh = fromSP(dvi_h);
632 if (F_SMALLV(f, p)) {
637 dvi_vv = fromSP(dvi_v);
641 f = DVIFindFont((i32)(c - DVI_FNTNUM0));
657 GripeUnexpectedOp(
"PRE");
662 GripeUnexpectedOp(
"POST (no EOP)");
668 GripeUnexpectedOp(
"POSTPOST");
676 panic(
"DVI_DT(%d) = %d", c, DVI_DT(c));
void SetRule(int h, int w)
void BeginPage(i32 *count)
#define CHECK(cond, msg, flag)
Definition at line 331 of file dvirle1.c.
364 error(0, 0,
"WARNING: rule(s) off page edge; clipped to fit");
367 for (y = ymax; y > ymin; y -= h) {
368 for (x = xmin; x < xmax; x += w) {
375 *
nextyx++ = (y << 16) | x;
376 *
nextfcp++ = (1 << 31) | (x << 16) | (h << 8) | w;
Definition at line 134 of file dvirle1.c.
References Chars, fcp, and yx.
136 register int i, j, k, delta, *
y, *f;
145 while (9 * delta + 4 <
Chars)
146 delta = 3 * delta + 1;
148 for (i = delta; i <
Chars; i++) {
149 if (y[j = i - delta] < y[i]) {
150 register int t1 = y[
i];
151 register int t2 = f[
i];
159 }
while (j >= 0 && y[j] < t1);
char rcsid[] = "$Id: dvirle1.c,v 3.0.1.3 1992/02/28 22:12:53 spencer Exp $" |
|
static |