require 5.008001;
#my $kageaddr="home.fonts.jp:5100"; # Specify port number!
-my $kageaddr="home.fonts.jp:5101"; # Specify port number!
+my $kageaddr="fonts.jp:80"; # Specify port number!
#my $kagecgi="/~kamichi/test/kagecgi.cgi"; #
+my $kagecgi="v0.4/engine/kage.cgi"; #
+#my $kageaddr="localhost:80"; # Specify port number!
+#my $kagecgi="cgi-bin/kage.cgi"; #
my $t1asm = "/usr/bin/env t1asm"; # point to 't1asm' executable.
#die "Cannot execute $t1asm. Abort.\n" unless -x $t1asm;
# Return: Type1 charstring.
sub svg2charstring {
my ($svg) = @_;
+ $svg=~s/></>\n</g;
my @paths= split(/\n/, $svg);
my ($x1, $y1, $x2, $y2);
my $glyph= "\{\n0 1000 hsbw\n";
for (@paths){
- if(m/error/i){
+ if(m/error/i or m/bad/i){
return undef;
}
next unless /\<path d=\"M([0-9, ]+)Z\"\/\>/;
my $kageserver;
my $location; # For redirection
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";
+ print $kageserver "GET /$kagecgi?$req&shotai=$suffix&type=svg\r\n";
+# print $kageserver "HEAD /$kagecgi?$req&shotai=$suffix&type=svg HTTP/1.1\r\n";
+# print $kageserver "Host: $kageaddr\r\n\r\n";
# #Get redirection info.
# local $/="\r\n";
# while(<$kageserver>){
last;
}
}
+ $code=~s/(.)u/$1.u/g;
$Requests[$ids{$key}[0]]->[$ids{$key}[1]]=$code;
}
+print STDERR "Sending query to KAGE server at $kageaddr.\n";
+
# Create fonts.
foreach my $fontnum (0 .. $#Requests){
my @faces=(['Mincho', 'min', 'mincho'],