summaryrefslogtreecommitdiffstats
path: root/alevt-1.6.2-doublefont.patch
blob: c6de714eec916a9b605b7ebe711afe87abc473a4 (plain)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
diff -Naur alevt-1.6.2/alevt.1x.in alevt-1.6.2-doublefont/alevt.1x.in
--- alevt-1.6.2/alevt.1x.in	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/alevt.1x.in	2009-05-30 16:42:15.000000000 +0300
@@ -67,6 +67,9 @@
 in the selected set are replaced by similar looking symbols.
 (default: latin-1)
 .TP
+.BR \-doublefont / \-df
+Instructs alevt to use double sized fonts.
+.TP
 .B \-\-help
 Show summary of options.
 .TP
diff -Naur alevt-1.6.2/exp-gfx.c alevt-1.6.2-doublefont/exp-gfx.c
--- alevt-1.6.2/exp-gfx.c	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/exp-gfx.c	2009-05-30 16:42:15.000000000 +0300
@@ -21,7 +21,16 @@
 	  int sep)
 {
   int x,y;
-  unsigned char* src= (latin1==LATIN1 ? font1_bits : font2_bits);
+  unsigned char* src = double_font ? 
+			( (latin1==LATIN1) ? font1_bits : 
+			  ( (latin1==LATIN2) ? font2_bits : 
+			  ( (latin1==KOI8) ? font3_bits :
+			  ( (latin1==GREEK) ? font4_bits : /* fallback */ font1_bits) ) ) ) 
+			  :
+			( (latin1==LATIN1) ? font1d_bits : 
+			  ( (latin1==LATIN2) ? font2d_bits : 
+			  ( (latin1==KOI8) ? font3d_bits :
+			  ( (latin1==GREEK) ? font4d_bits : /* fallback */ font1d_bits) ) ) );
   int dest_x=_x*CW;
   int dest_y=_y*CH;
       
diff -Naur alevt-1.6.2/font.c alevt-1.6.2-doublefont/font.c
--- alevt-1.6.2/font.c	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/font.c	2009-05-30 16:42:15.000000000 +0300
@@ -4,4 +4,13 @@
 #include "font3.xbm"
 #include "font4.xbm"
 
+#include "font1d.xbm"
+#include "font2d.xbm"
+#include "font3d.xbm"
+#include "font4d.xbm"
 
+int CW;
+int CH;
+int double_font = 0;
+int font_width;
+int font_height;
diff -Naur alevt-1.6.2/font.h alevt-1.6.2-doublefont/font.h
--- alevt-1.6.2/font.h	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/font.h	2009-05-30 16:42:15.000000000 +0300
@@ -1,20 +1,31 @@
 #ifndef FONT_H
 #define FONT_H
 
-#include "fontsize.h"	/* the #defines from font?.xbm */
+// #include "fontsize.h"	/* the #defines from font?.xbm */
 
-#if font1_width != font2_width || font1_height != font2_height
-#error different font sizes.
-#endif
+//#if font1_width != font2_width || font1_height != font2_height
+//#error different font sizes.
+//#endif
 
 extern unsigned char font1_bits[];
 extern unsigned char font2_bits[];
 extern unsigned char font3_bits[];
 extern unsigned char font4_bits[];
 
-#define font_width	font1_width
-#define font_height	font1_height
-#define CW		(font_width/32)        /* pixel width of a character */
-#define CH		(font_height/8)        /* pixel height of a character */
+extern unsigned char font1d_bits[];
+extern unsigned char font2d_bits[];
+extern unsigned char font3d_bits[];
+extern unsigned char font4d_bits[];
+
+//#define font_width	font1_width
+//#define font_height	font1_height
+//#define CW		(font_width/32)        /* pixel width of a character */
+//#define CH		(font_height/8)        /* pixel height of a character */
+
+extern int CW;
+extern int CH;
+extern int double_font;
+extern int font_width;
+extern int font_height;
 
 #endif
diff -Naur alevt-1.6.2/main.c alevt-1.6.2-doublefont/main.c
--- alevt-1.6.2/main.c	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/main.c	2009-05-30 17:10:16.000000000 +0300
@@ -24,6 +24,12 @@
 static int erc = 1;
 static int newbttv = -1;
 
+/* Double font size related variables */
+extern int double_font;
+extern int font_width;
+extern int font_height;
+extern int CW;
+extern int CH;
 
 static void
 usage(FILE *fp, int exitval)
@@ -44,6 +50,7 @@
 	    "    -[no]erc\t\t\t\t\tenabled\n"
 	    "    -[no]bell\t\t\t\t\tenabled\n"
 	    "    -charset latin-1/2/russian/iso8859-7\tlatin-1\n"
+	    "    -doublefont\n"
 	    "\n"
 	    "  Order is important!  Each page number\n"
 	    "  opens a new window with the previously\n"
@@ -127,6 +134,7 @@
 	{ "-bell", "-b", 0 },
 	{ "-nobell", "-nb", 0 },
 	{ "-charset", "-latin", 1 },
+	{ "-doublefont", "-df", 0 },
     };
     int i;
 
@@ -164,7 +172,13 @@
     int opt, ind;
     char *arg;
 
-setlocale (LC_CTYPE, "");
+    setlocale (LC_CTYPE, "");
+
+    font_width  = 288;
+    font_height = 128;
+
+    CW = (font_width/32);
+    CH = (font_height/8);
 
     setprgname(argv[0]);
 
@@ -242,6 +256,13 @@
 		else
 		    fatal("bad charset (not latin-1/2/russian/iso8859-7)");
 		break;
+	    case 19:	// Doublefont
+		double_font = 1;
+		font_width  = 576;
+		font_height = 256;
+		CW = (font_width/32);
+		CH = (font_height/8);
+		break;
 	    case 12:	// debug
 		debug++;
 		break;
diff -Naur alevt-1.6.2/Makefile alevt-1.6.2-doublefont/Makefile
--- alevt-1.6.2/Makefile	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/Makefile	2009-05-30 16:42:15.000000000 +0300
@@ -33,9 +33,10 @@
 alevt-cap: $(COBJS)
 	$(CC) $(OPT) $(COBJS) -o alevt-cap $(EXPLIBS)
 
-font.o: font1.xbm font2.xbm font3.xbm font4.xbm
-fontsize.h: font1.xbm font2.xbm font3.xbm font4.xbm
+font.o: font1.xbm font2.xbm font3.xbm font4.xbm font1d.xbm font2d.xbm font3d.xbm font4d.xbm
+fontsize.h: font1.xbm font2.xbm font3.xbm font4.xbm font1d.xbm font2d.xbm font3d.xbm font4d.xbm
 	fgrep -h "#define" font1.xbm font2.xbm font3.xbm font4.xbm >fontsize.h
+	fgrep -h "#define" font1d.xbm font2d.xbm font3d.xbm font4d.xbm >> fontsize.h
 
 font1.xbm: bdf2xbm $(FONT)-latin-1.bdf
 	./bdf2xbm font1 <$(FONT)-latin-1.bdf >font1.xbm
@@ -49,6 +50,18 @@
 font4.xbm: bdf2xbm vtxt-iso8859-7.bdf
 	./bdf2xbm font4 <vtxt-iso8859-7.bdf >font4.xbm
 
+font1d.xbm: font1.xbm
+	/usr/bin/convert -filter Point -resize 200% font1.xbm font1d.xbm
+
+font2d.xbm: font2.xbm
+	/usr/bin/convert -filter Point -resize 200% font2.xbm font2d.xbm
+
+font3d.xbm: font3.xbm
+	/usr/bin/convert -filter Point -resize 200% font3.xbm font3d.xbm
+
+font4d.xbm: font4.xbm
+	/usr/bin/convert -filter Point -resize 200% font4.xbm font4d.xbm
+
 bdf2xbm: bdf2xbm.c
 	$(HOSTCC) bdf2xbm.c -o bdf2xbm
 
@@ -62,7 +75,7 @@
 	sed s/VERSION/$(VER)/g <alevt-cap.1.in >alevt-cap.1
 
 clean:
-	rm -f *.o page*.txt a.out core bdf2xbm font?.xbm fontsize.h Makefile.bak
+	rm -f *.o page*.txt a.out core bdf2xbm font?.xbm font?d.xbm fontsize.h Makefile.bak
 	rm -f alevt alevt-date alevt-cap
 	rm -f alevt.1x alevt-date.1 alevt-cap.1
 	rm -f contrib/a.out ttext-*.*
diff -Naur alevt-1.6.2/xio.c alevt-1.6.2-doublefont/xio.c
--- alevt-1.6.2/xio.c	2009-05-30 18:38:27.000000000 +0300
+++ alevt-1.6.2-doublefont/xio.c	2009-05-30 16:42:15.000000000 +0300
@@ -130,12 +130,22 @@
     int i;
     unsigned char *font_bits;
     
-    switch(latin1) {
-        case LATIN1: font_bits=font1_bits; break;
-        case LATIN2: font_bits=font2_bits; break;
-        case KOI8: font_bits=font3_bits; break;
-	case GREEK: font_bits=font4_bits; break;
-        default: font_bits=font1_bits; break;
+    if(!double_font) {
+        switch(latin1) {
+            case LATIN1: font_bits=font1_bits; break;
+            case LATIN2: font_bits=font2_bits; break;
+            case KOI8: font_bits=font3_bits; break;
+            case GREEK: font_bits=font4_bits; break;
+            default: font_bits=font1_bits; break;
+        }
+    } else {
+        switch(latin1) {
+            case LATIN1: font_bits=font1d_bits; break;
+            case LATIN2: font_bits=font2d_bits; break;
+            case KOI8: font_bits=font3d_bits; break;
+            case GREEK: font_bits=font4d_bits; break;
+            default: font_bits=font1d_bits; break;
+        }
     }
 
     xio->font[0] = XCreateBitmapFromData(xio->dpy, xio->root,