openbsd-ports/japanese/kanjips/patches/patch-jenscript_jenscript_SH
2000-04-23 15:57:06 +00:00

76 lines
2.7 KiB
Plaintext

$OpenBSD: patch-jenscript_jenscript_SH,v 1.3 2000/04/23 15:57:06 espie Exp $
--- jenscript/jenscript.SH.orig Tue Jan 16 18:20:31 1990
+++ jenscript/jenscript.SH Sun Apr 23 17:50:59 2000
@@ -20,14 +20,12 @@ echo "Extracting jenscript (with variabl
: Protect any dollar signs and backticks that you do not want interpreted
: by putting a backslash in front. You may delete these comments.
$spitshell >jenscript <<!GROK!THIS!
-#!$perlloc -P
+#!$perlloc
#
# Convert Text Files into PostScript Format
#
# 1989 3/28 MASUI Toshiyuki
#
-eval "exec $perlloc -P -S \$0 \$*"
- if \$Shell_cannot_understand;
!GROK!THIS!
: In the following dollars and backticks do not need the extra backslash.
@@ -88,26 +86,27 @@ $xflag ? ("Courier", "Courier-Bold", "Co
("Times-Roman", "Times-Bold", "Times-Italic", "Times-Roman", "Times-Roman");
($height, $width, $offsetx, $offsety) =
- $sflag ? (650, 440, 120, 150) : # B5
-# (730, 550, 60, 60); # A4
+ $sflag ? #(650, 440, 120, 150) : # B5
+ (730, 550, 60, 60): # A4
(700, 550, 60, 40); # letter
$linepitch = $lines ? $height / $lines : $fontsize * 7.0 / 6.0;
($kfont, $jfontsize) = $kfont ne "" ? ($kfont, $fontsize) :
- $fontsize < 5 ? ("jis16", 3.84) :
+# $fontsize < 5 ? ("jis16", 3.84) :
$fontsize < 7 ? ("jis24", 5.76) :
$fontsize < 12 ? ("jis32", 7.68) :
- ("jis50", 12) ;
+ ("jis48", 12) ;
$_ = $kfont;
$texfont = /^jisj/ || /^dmj/ || /^dgj/ ;
-#define NORMAL 0
-#define COMMENT 1
-#define STRING 2
-#define LITERAL 3
-#define KEYWORD 4
+
+use constant NORMAL => 0;
+use constant COMMENT => 1;
+use constant STRING => 2;
+use constant LITERAL => 3;
+use constant KEYWORD => 4;
+use constant VGRINDEFS => '/usr/share/misc/vgrindefs';
$mode = $outmode = NORMAL;
-#define VGRINDEFS "/usr/lib/vgrindefs"
if(! open(vdef,VGRINDEFS)){
$language = "";
}
@@ -132,6 +131,8 @@ if($language){
s/\\:/<COLON>/g;
split(/:/);
$pat = $_[0];
+ # handle C++
+ $pat =~ s/\+/\\+/g;
shift(@_);
next if $language !~ /^($pat)$/;
$pb = $bb = $be = $cb = $ce = $sb =
@@ -445,7 +446,7 @@ sub prologue {
print "/FK { /$keywordfont findfont [$xfontsize 0 0 $fontsize 0 0] makefont setfont } bind def\n";
print "/FC { /$commentfont findfont [$xfontsize 0 0 $fontsize 0 0] makefont setfont } bind def\n";
print "/FS { /$stringfont findfont [$xfontsize 0 0 $fontsize 0 0] makefont setfont } bind def\n";
- print "/FL { /$litefalfont findfont [$xfontsize 0 0 $fontsize 0 0] makefont setfont } bind def\n";
+ print "/FL { /$literalfont findfont [$xfontsize 0 0 $fontsize 0 0] makefont setfont } bind def\n";
}
print "/FJ { /$kfont findfont $jfontsize scalefont setfont } bind def\n";
print "/N { FN show } bind def\n";