--- xdvik-22.15-t1-beta1/texk/xdvik/Makefile.in.orig Wed Jul 19 13:53:17 2000 +++ xdvik-22.15-t1-beta1/texk/xdvik/Makefile.in Wed Jul 19 14:15:02 2000 @@ -55,7 +55,10 @@ # Extra xdvi-specific compiler options. ps_def = @PS_DEF@ -prog_cflags = $(LIBWWWCPPFLAGS) $(ps_def) -I../../libs/t1lib/lib -I../kpathsea $(x_cppflags) +dvi_filter = @DVIFILTERCMD@ +vflib_def = @VFLIB_DEF@ +xdviprint_def = @XDVIPRINT_DEF@ +prog_cflags = $(LIBWWWCPPFLAGS) $(ps_def) -I../../libs/t1lib/lib -I../kpathsea $(x_cppflags) $(dvi_filter) $(vflib_def) $(xdviprint_def) # We don't use alloca ourselves, but the X library might, and this way # we avoid buggy versions in -lPW or -lucb. @@ -64,15 +67,17 @@ objects = xdvi.o dvi-draw.o dvi-init.o events.o font-open.o \ gf.o pk.o psdps.o psgs.o psheader.o psnews.o special.o util.o vf.o sfDir.o \ sfDraw.o sfPath.o sfSelFile.o hypertex.o mime.o wwwfetch.o \ + zeit.o dnpzeit.o toc.o markpage.o markring.o print.o \ + paper.o tategaki.o vfontmap.o \ $(ALLOCA) t1.o dvips.o tfmload.o program = xdvi.bin programs = $(program) -default all: $(programs) xdvi.1 +default all: $(programs) xdvi.1 xdviprint $(program): $(kpathsea) $(objects) $(LIBWWWDEP) - $(kpathsea_link) $(objects) $(x_link) $(LOADLIBES) + $(kpathsea_link) $(objects) $(x_link) $(VFLIB) $(LOADLIBES) squeeze: squeeze.o $(link_command) squeeze.o $(LIBS) $(XLOADLIBES) --- xdvik-22.15-t1-beta1/texk/xdvik/dvi-draw.c.orig Wed Jul 19 13:53:19 2000 +++ xdvik-22.15-t1-beta1/texk/xdvik/dvi-draw.c Wed Jul 19 15:09:52 2000 @@ -1090,11 +1090,25 @@ break; } } +#ifdef ASCIIDNP + if (currinf.fontp == NULL) { + if (n >> 24) { + define_kanjifont(n); + change_font(n); + return; + } + tell_oops("non-existent font #%d", n); + } +#else /* ASCIIDNP */ if (currinf.fontp == NULL) tell_oops("non-existent font #%d", n); +#endif /* ASCIIDNP */ if (currinf.fontp->set_char_p == NULL) tell_oops("No procedure to set font #%d", n,currinf.fontp->fontname); maxchar = currinf.fontp->maxchar; +#ifdef ASCIIDNP + cur_TeXnumber = n; +#endif /* ASCIIDNP */ currinf.set_char_p = currinf.fontp->set_char_p; } @@ -1356,23 +1370,97 @@ return ERRVAL; /* previously flagged missing char */ open_font_file(currinf.fontp); Fseek(currinf.fontp->file, g->addr, 0); +#ifdef NTTZEIT + } +#endif /* NTTZEIT */ (*currinf.fontp->read_char)(currinf.fontp, ch); +#ifdef ASCIIDNP + if (cur_TeXnumber >> 24) + adj_kanjiwidth(currinf.fontp, cur_TeXnumber >> 24, ch); +#endif /* ASCIIDNP */ if (debug & DBG_BITMAP) print_char((ubyte) ch, g); currinf.fontp->timestamp = ++current_timestamp; } +#ifdef PTEX + if (g->tdir != TATE) { + int tmp; + if (TATE != currinf.fontp->dir) { + rotate_bitmap(&g->bitmap); + tmp = g->x; + g->x = g->bitmap.w - g->y; + g->y = tmp; + } + else { + reverse_rotate_bitmap(&g->bitmap); + tmp = g->x; + g->x = g->y; + g->y = g->bitmap.h - tmp; + } + g->tdir = TATE; + if (g->bitmap2.bits != NULL) { + free(g->bitmap2.bits); + g->bitmap2.bits = NULL; + } +#ifdef GREY + if (g->pixmap2 != NULL) { + free(g->pixmap2); + g->pixmap2 = NULL; + } +#endif + } +#endif /* PTEX */ #ifdef TEXXET dvi_h_sav = DVI_H; - if (currinf.dir < 0) DVI_H -= g->dvi_adv; + dvi_v_sav = DVI_V; + pxl_v_sav = PXL_V; +#if PS + ps_h_sav = PS_H; + ps_v_sav = PS_V; +#endif +#ifdef PTEX + if (! TATE && currinf.dir < 0) { +#else + if (currinf.dir < 0) { +#endif + DVI_H -= g->dvi_adv * bbox_matrix[0][0]; + DVI_V -= g->dvi_adv * bbox_matrix[1][0]; + PXL_V = pixel_conv(DVI_V); +#if PS + PS_H -= g->dvi_adv; +#endif + } if (scan_frame == NULL) { #endif + if (bbox_scaled) + bbox_scale_bitmap(g); + else if (g->bitmap3.bits) { + free(g->bitmap.bits); + g->bitmap = g->bitmap3; + g->bitmap3.bits = NULL; + g->x = g->x3; + g->y = g->y3; + if (g->bitmap2.bits != NULL) { + free(g->bitmap2.bits); + g->bitmap2.bits = NULL; + } +#ifdef GREY + if (g->pixmap2 != NULL) { + free(g->pixmap2); + g->pixmap2 = NULL; + } +#endif + } if (shrink_factor == 1) put_bitmap(&g->bitmap, PXL_H - g->x, PXL_V - g->y); else { #ifdef GREY if (use_grey) { if (g->pixmap2 == NULL) { + if (DefaultDepthOfScreen(SCRN) == 2) + shrink_glyph_NeXT(g); + else shrink_glyph_grey(g); } put_image(g, PXL_H - g->x2, PXL_V - g->y2); --- xdvik-22.15-t1-beta1/texk/xdvik/dvi-init.c.orig Wed Jul 19 13:53:19 2000 +++ xdvik-22.15-t1-beta1/texk/xdvik/dvi-init.c Wed Jul 19 14:59:25 2000 @@ -110,6 +110,34 @@ { struct font *f; struct glyph *g; +#if defined(KANJI) && !defined(ASCIIDNP) + int n, maxchar; + + for (f = font_head; f != NULL; f = f->next) + if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)) { + if (f->t1id>=0) { + /* Type1 font, all glyps in t1lib structures only */ + T1_DeleteAllSizes(f->t1id); + continue; + } + maxchar = (f->flags & FONT_KANJI) ? KTABLESIZE : f->maxchar + 1; + for (n = 0; n < maxchar; ++n) { + g = (f->flags & FONT_KANJI) ? f->kglyph[n] : &f->glyph[n]; + if (g != NULL) { + if (g->bitmap2.bits) { + free(g->bitmap2.bits); + g->bitmap2.bits = NULL; + } +#ifdef GREY + if (g->pixmap2) { + XDestroyImage(g->image2); + g->pixmap2 = NULL; + } +#endif + } + } + } +#else /* KANJI && !ASCIIDNP */ for (f = font_head; f != NULL; f = f->next) if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)) { @@ -135,6 +163,7 @@ #endif } /* inner for */ } +#endif /* KANJI && !ASCIIDNP */ } /* --- xdvik-22.15-t1-beta1/texk/xdvik/font-open.c.orig Wed Jul 19 13:53:19 2000 +++ xdvik-22.15-t1-beta1/texk/xdvik/font-open.c Wed Jul 19 14:31:33 2000 @@ -50,7 +50,24 @@ #endif *t1id=-1; +#ifdef KANJI + if (iskanjifont(font)) + { + name = kpse_find_tfm (font); + if (!name) + name = kpse_find_vf (font); + if (name) + { + *dpi_ret = dpi; + *font_ret = NULL; + } + + } + else + if (name && !isdnpfont(font)) { +#else /* !KANJI */ if (name) { +#endif /* KANJI */ /* VF fonts don't have a resolution, but load_font will complain if we don't return what it asked for. */ *dpi_ret = dpi; --- xdvik-22.15-t1-beta1/texk/xdvik/xdvi.h.orig Wed Jul 19 13:53:21 2000 +++ xdvik-22.15-t1-beta1/texk/xdvik/xdvi.h Wed Jul 19 14:28:34 2000 @@ -572,7 +572,7 @@ long checksum; /* checksum */ unsigned short timestamp; /* for LRU management of fonts */ ubyte flags; /* flags byte (see values below) */ -#ifdef Omega +#if defined(Omega) || defined(KANJI) wide_ubyte maxchar; /* largest character code */ #else ubyte maxchar; /* largest character code */ @@ -584,6 +584,19 @@ struct glyph *glyph; /* these fields are used by (loaded) virtual fonts */ struct font **vf_table; /* list of fonts used by this vf */ +#if defined(KANJI) && !defined(ASCIIDNP) + struct glyph **kglyph; +#ifdef USE_ZEIT + int vf; +#ifdef NTTZEIT + int index; +#endif /* NTTZEIT */ +#endif /* USE_ZEIT */ +#endif /* KANJI && !ASCIIDNP */ +#ifdef PTEX + int dir; + int tate; +#endif struct tn *vf_chain; /* ditto, if TeXnumber >= VFTABLELEN */ struct font *first_font; /* first font defined */ struct macro *macro; @@ -1054,11 +1067,17 @@ #endif /* GRID */ #ifndef TEXXET extern long set_char ARGS((wide_ubyte)); +#if defined(KANJI) && !defined(ASCIIDNP) +extern long set_char2 ARGS((wide_ubyte)); +#endif /* KANJI && !ASCIIDNP */ extern long load_n_set_char ARGS((wide_ubyte)); extern long set_vf_char ARGS((wide_ubyte)); extern long set_t1_char P1H(wide_ubyte); #else extern void set_char ARGS((wide_ubyte, wide_ubyte)); +#if defined(KANJI) && !defined(ASCIIDNP) +extern void set_char2 ARGS((wide_ubyte, wide_ubyte)); +#endif /* KANJI && !ASCIIDNP */ extern void load_n_set_char ARGS((wide_ubyte, wide_ubyte)); extern void set_vf_char ARGS((wide_ubyte, wide_ubyte)); extern void set_t1_char P2H(wide_ubyte, wide_ubyte);