Server IP : 103.119.228.120 / Your IP : 13.58.207.196 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/bin/ |
Upload File : |
#!/usr/bin/perl use Config; use File::Basename qw(&basename &dirname); use Cwd; $origdir = cwd; chdir dirname($0); $file = basename($0, '.PL','.PLS'); $file .= $^O eq 'VMS' ? '.com' : '.pl'; open OUT,">$file" or die "Can't create $file: $!"; print "Extracting $file (with variable substitutions)\n"; print OUT <<"!GROK!THIS!"; $Config{startperl} !GROK!THIS! # In the following, perl variables are not expanded during extraction. print OUT <<'!NO!SUBS!'; # # Simple convertor from bdf to loadable GD font format. # # Author: Lincoln Stein <lstein@cshl.edu>, heavily adopted from bdftogd from # Jan Pazdziora <adelton@fi.muni.cz> # # Example of use: # fstobdf -s fontserverhost:7100 -fn 8x16 | bdftofnt > myfont.fnt # use strict; our $VERSION = '1.00'; if ($ARGV[0] =~ /^--?h/) { exec "perldoc $0"; } my ($width, $height); my (@data, @left, @bottom); my ($globalleft, $globaltop); my ($minchar, $maxchar); my ($copyright, $fontdef); my $currentchar; my $gobitmap = 0; foreach (@ARGV) { $_ = "gunzip -c $_ |" if /\.gz$/; } while (<>) { chomp; s/\r$//; next unless $_; my ($tag, $value) = split / /, $_, 2; die "Font is not fixed width\n" if $tag eq 'SPACING' and not $value =~ /[CM]/i; $currentchar = $value if $tag eq 'ENCODING'; $minchar = $currentchar if not defined $minchar or ($currentchar < $minchar && $currentchar >= 0); $maxchar = $currentchar if not defined $maxchar or ($currentchar > $maxchar && $currentchar >= 0); if ($tag eq 'ENDCHAR') { next if $currentchar < 0; $gobitmap = 0; my $bottom = $globaltop - $bottom[$currentchar]; if ($bottom > 0) { $data[$currentchar] = substr $data[$currentchar], 0, length($data[$currentchar]) - $bottom * $width; } else { $data[$currentchar] .= '0' x (-$bottom * $width); } } if ($tag eq 'FONTBOUNDINGBOX') { my ($tag, $wid, $hei, $left, $top) = split / /; if (defined $top) { $globalleft = $left; $globaltop = $top; $height = $hei; $width = $wid; } } if ($tag eq 'FONT' and not defined $fontdef) { $fontdef = $value; } if ($tag eq 'COPYRIGHT' and not defined $copyright) { $copyright = $value; } if ($tag eq 'BBX') { my ($tag, $wid, $hei, $left, $bottom) = split / /; if (defined $bottom) { $left[$currentchar] = $left; $bottom[$currentchar] = $bottom; } } if ($gobitmap) { my $value = pack 'H*', $_; my $bits = unpack 'B*', $value; $bits = ('0' x $left[$currentchar]) . $bits; $bits .= '0' x ($width - length $bits); $bits = substr $bits, 0, $width; $data[$currentchar] .= $bits; } if ($tag eq 'BITMAP') { $gobitmap = 1; $data[$currentchar] = ''; } } $minchar = 0 unless defined $minchar; $maxchar = 255 unless defined $maxchar; binmode STDOUT; # for DOS/Windows systems my $length = $maxchar-$minchar+1; print pack ('VVVV',$length,$minchar,$width,$height); # header for (my $i = $minchar; $i <= $maxchar; $i++) { $data[$i] = '' unless defined $data[$i]; $data[$i] = '0' x ($width * $height - length $data[$i]) . $data[$i]; print pack('C*',split '',$data[$i]); } print STDERR "Successfully converted $length ${width}x$}height} characters\n"; __END__ =head1 NAME bdf2gdfont.pl - Convert X11 "BDF" fonts into a loadable font format for GD. =head1 SYNOPSIS % bdf2gdfont.pl courR12.bdf > courR12.fnt =head1 DESCRIPTION This script converts BDF-style X11 font files into a format that can be loaded by the GD module using the GD::Font->load() method. There are a number of ways to obtain BDF fonts. =over 4 =item 1. The font is already present on your system. Some BDF fonts can be found in the standard X11R6 distribution. This script will automatically uncompress gzipped font files if their extension ends with .gz (the gunzip program must be on your path). =item 2. From a font server. The "fstobdf" utility, a standard X11 utility, will read a named font from the font server of your choice and return it in BDF format. You can pipe it to bdf2gdfont.pl: fstobdf -s fontserverhost:7100 -fn 8x16 | bdf2gdfont.pl > newfont.fnt Use xlsfonts to find out what fonts are available. Most fonts will have long names like -B&H-LucidaTypewriter-Bold-R-Normal-Sans-18-180-75-75-M-110-ISO8859-10. =item 3. Using the pcf2bdf utility. Some fonts are only available in PCF (compiled) format. To obtain these, you can either turn on a font server and follow recipe (2), or use TAGA Nayuta's pcf2bdf utility. This utility is available from http://www.tsg.ne.jp/GANA/S/pcf2bdf/ (page is in Japanese, but you can find the download link). =back =head2 Limitations This font converter only works with fixed-width fonts. If used with a TrueType or proportional font it will die with an error message. =head1 SEE ALSO L<GD> =head1 AUTHOR Lincoln Stein <lstein@cshl.org>, heavily adapted from bdftogd from Jan Pazdziora <adelton@fi.muni.cz>. Copyright (c) 2004 Cold Spring Harbor Laboratory This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut !NO!SUBS! close OUT or die "Can't close $file: $!"; chmod 0755, $file or die "Can't reset permissions for $file: $!\n"; exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; chdir $origdir;