File: fonty-dev.sbf2psf.dpatch

package info (click to toggle)
fonty 1.0-8
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,988 kB
  • ctags: 112
  • sloc: perl: 2,097; cpp: 1,114; makefile: 133; sh: 97
file content (79 lines) | stat: -rw-r--r-- 1,574 bytes parent folder | download | duplicates (3)
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
#PATCHOPTIONS: -p0
--- tools/sbf2psf	Fri Aug 28 22:55:00 1998
+++ tools/sbf2psf.debian	Thu Sep 23 14:25:32 1999
@@ -1,13 +1,20 @@
 #!/usr/bin/perl
 
-$_ = <>; s/\s+$//;
-while (1)
+# sbf2psf (c) Marcin Kowalczyk <qrczak@knm.org.pl>
+# This software is under GPL
+
+open PLIK, @ARGV ? shift : "-";
+open WYJSCIE, @ARGV ? ">".shift : ">-";
+
+while (! eof PLIK)
 {
+	$_ = <PLIK>; s/\s+$//;
+	last unless defined;
 	if (/^\[(.*)\]$/)
 	{
 		push @znaki, $1;
 	}
 	elsif (/^$/)
 	{
 		if (@znaki)
 		{
@@ -42,18 +49,16 @@
 				die "Character width must be 8 or 9 in line $.\n"
 					if @linia != 8 && @linia != 9;
 				$linia = 0;
 				for (0 .. 7) {$linia <<= 1; $linia++ if $linia[$_] eq "0"}
 				push @znak, $linia;
 			}
 		}
 	}
-	last unless defined;
-	$_ = <>; s/\s+$//;
 }
 
 if (@font == 0)
 {
 	die "No characters found\n";
 }
 if (@font <= 256)
 {
@@ -65,27 +70,27 @@
 	$typpsf = "\3";
 	$znakow = 512;
 }
 else
 {
 	die "Too many characters (", scalar @font, " > 512)\n";
 }
 
-print "6\4$typpsf", chr $wysokosc;
+print WYJSCIE "6\4$typpsf", chr $wysokosc;
 
 foreach (@font)
 {
-	foreach (@{$$_{ZNAK}}) {print chr $_}
+	foreach (@{$$_{ZNAK}}) {print WYJSCIE chr $_}
 }
 
-print "\0" x (($znakow - @font) * $wysokosc);
+print WYJSCIE "\0" x (($znakow - @font) * $wysokosc);
 
 foreach (@font)
 {
 	foreach (@{$$_{ZNAKI}})
 	{
-		s/^U\+// and print pack "S", hex;
+		s/^U\+// and print WYJSCIE pack "S", hex;
 	}
-	print pack "s", -1;
+	print WYJSCIE pack "s", -1;
 }
 
-print +(pack "s", -1) x ($znakow - @font);
+print WYJSCIE +(pack "s", -1) x ($znakow - @font);