-#!/usr/bin/perl -w
+#!/usr/bin/perl -w -CSD
# This script requires 't1asm' program, which is part of t1utils package,
# and 'pfaedit'.
use utf8;
use IO::Socket::INET;
use BerkeleyDB;
+require 5.008001;
my $omegadb_path="/usr/local/lib/chise/omega"; # set to the path of your db and script.
-my $kageaddr="kage2.fonts.jp:80"; # Specify port number!
-my $kagecgi="/~kamichi/test/kagecgi.cgi"; #
+#my $kageaddr="home.fonts.jp:5100"; # Specify port number!
+my $kageaddr="home.fonts.jp:5101"; # Specify port number!
+#my $kagecgi="/~kamichi/test/kagecgi.cgi"; #
my $t1asm = "/usr/bin/env t1asm"; # point to 't1asm' executable.
#die "Cannot execute $t1asm. Abort.\n" unless -x $t1asm;
if($kageserver = IO::Socket::INET->new("$kageaddr")){
print $kageserver "HEAD /$request.svg HTTP/1.1\r\n";
print $kageserver "Host: $kageaddr\r\n\r\n";
- #Get redirection info.
- local $/="\r\n";
- while(<$kageserver>){
- chomp;
- next unless m|^location:\s+http://([a-z0-9.:]+)/|i;
- $location=$1;
- }
- close($kageserver);
- print STDERR "Connecting $location...\n";
- if($location
- and $kageserver=IO::Socket::INET->new($location)){
- print $kageserver "GET /$request.svg HTTP/1.1\r\n";
- print $kageserver "Host: $location\r\n\r\n";
+# #Get redirection info.
+# local $/="\r\n";
+# while(<$kageserver>){
+# chomp;
+# next unless m|^location:\s+http://([a-z0-9.:]+)/|i;
+# $location=$1;
+# }
+# close($kageserver);
+# if($location
+# and $kageserver=IO::Socket::INET->new($location)){
+# print $kageserver "GET /$request.svg HTTP/1.1\r\n";
+# print $kageserver "Host: $location\r\n\r\n";
local $/; $svg=<$kageserver>;
close($kageserver);
$svg =~ s/\r//gm; # remove CR.
$svg =~ s/^.+\n\n//ms; # remove HTTP header.
- }else{
- $svg="error";
- }
+# }else{
+# $svg="error";
+# }
}else{
print STDERR "Cannot connect to KAGE server at $kageaddr.\n";
$svg="error";
if(-e $idsdata){
# "require" doesn't work well.
# I don't know why...
- open (my $data, "<$idsdata");
+ open (my $data, "<:utf8","$idsdata");
while(<$data>){
eval $_;
}