Package: xdvik-ja / 22.84.16-j1.40+t1lib-1

0002-e-pTeX-pxdvik-20111126-density.patch Patch series | download
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Sun, 25 Mar 2012 16:26:32 +0900
Subject: e-pTeX: pxdvik-20111126-density

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
 texk/xdvik/dvi-draw.c   |    8 ++++----
 texk/xdvik/dvi-init.c   |   20 ++++++++++++++------
 texk/xdvik/util.c       |    1 +
 texk/xdvik/xdvi-debug.h |    1 +
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/texk/xdvik/dvi-draw.c b/texk/xdvik/dvi-draw.c
index 134c025..d93482b 100644
--- a/texk/xdvik/dvi-draw.c
+++ b/texk/xdvik/dvi-draw.c
@@ -731,7 +731,7 @@ put_bitmap(struct bitmap *bitmap, int x, int y)
    image) for the given shrink factor. E.g. at shrink level 2, the
    size of the pixel table is 4; in other words, 1 pixel in the shrunk
    image corresponds to 4 pixels in the unshrunk image. Thus, the possible
-   values for shink level 2 are: black, 1/4 (0x404040), 1/2 (0x808080),
+   values for shrink level 2 are: black, 1/4 (0x404040), 1/2 (0x808080),
    3/4 (0xc0c0c0) and white (0xffffff).
 */
 static Pixel *pixeltbl;
@@ -1338,7 +1338,7 @@ shrink_glyph(struct glyph *g)
     }
     g->y2 = g->y / currwin.shrinkfactor;
     if (globals.debug & DBG_BITMAP)
-	print_bitmap(&g->bitmap2);
+        print_bitmap(&g->bitmap2);
 }
 
 #ifdef PTEX
@@ -2252,7 +2252,7 @@ common_set_char(
 	    if (resource.use_grey) {
 		if (g->pixmap2 == NULL) {
 #ifdef DBG_AA
-		    fprintf(stderr, "shinking the bitmap!\n");
+		    fprintf(stderr, "shrinking the bitmap!\n");
 #endif /* DBG_AA */
 		    /*  		    print_bitmap(&g->bitmap); */
 		    shrink_glyph_grey(g);
@@ -2323,7 +2323,7 @@ set_char2(
 	free_bitmap2(g);
 	g->tdir = currinf.fontp->dir;
 	if (globals.debug & DBG_BITMAP) print_char((ubyte) ch, g);
-    }
+   }
     set_char_rotate_glyph(g);
 #ifdef TEXXET
     common_set_char(cmd, g);
diff --git a/texk/xdvik/dvi-init.c b/texk/xdvik/dvi-init.c
index bf26f7b..d7f31ab 100644
--- a/texk/xdvik/dvi-init.c
+++ b/texk/xdvik/dvi-init.c
@@ -229,7 +229,7 @@ reset_fonts(void)
     struct font *f;
 
     for (f = font_head; f != NULL; f = f->next) {
-	if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)) {
+	if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)){
 	    delete_glyphs(f);
 	}
     }
@@ -305,6 +305,9 @@ free_unused_fonts(void)
 void
 reset_colors(void)
 {
+#ifdef PTEX
+  int n, maxchar;
+#endif
     if (color_list_len != 0) {
 	XFreeColors(DISP, G_colormap, color_list, color_list_len, 0);
 	color_list_len = 0;
@@ -328,13 +331,18 @@ reset_colors(void)
 	struct glyph *g;
 
 	for (f = font_head; f != NULL; f = f->next)
-	    if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)
+	  if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)) {
 #ifdef PTEX
-		&& !(f->flags & FONT_KANJI)
+	    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) continue;
+#else
+	      for (g = f->glyph; g <= f->glyph + f->maxchar; ++g) {
 #endif /* PTEX */
-		)
-		for (g = f->glyph; g <= f->glyph + f->maxchar; ++g)
-		    g->fg = NULL;
+		g->fg = NULL;
+	      }
+	  }
     }
 #endif /* GREY */
     bg_current = NULL;
diff --git a/texk/xdvik/util.c b/texk/xdvik/util.c
index cf6ed7d..a7adbc7 100644
--- a/texk/xdvik/util.c
+++ b/texk/xdvik/util.c
@@ -212,6 +212,7 @@ struct debug_string_options debug_options[] = {
     {  DBG_FIND,	"find",		", " },
     {  DBG_FILES,	"files",	", " },
     {  DBG_PTEXFNT,	"ptexfnt",	", " },
+    /* {  DBG_AA,		"aa",		", " }, */
     {  DBG_ALL,		"all",		"\n" },
     /* end marker */
     {  0,		NULL,		NULL }
diff --git a/texk/xdvik/xdvi-debug.h b/texk/xdvik/xdvi-debug.h
index 22feee3..b161ac1 100644
--- a/texk/xdvik/xdvi-debug.h
+++ b/texk/xdvik/xdvi-debug.h
@@ -102,6 +102,7 @@
 #define DBG_FIND		262144
 #define DBG_FILES		524288
 #define DBG_PTEXFNT             1048576
+/* #define DBG_AA                  2097152 */
 #define	DBG_ALL			(~DBG_BATCH)
 
 /* a mapping of numerical options to descriptive strings, defined in util.c */