~7000 free fonts.

Discussion in 'Programming & Software Development' started by titan, Apr 16, 2004.

  1. titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    <EDIT> The scripts no longer work. BUT...
    We have set up two different methods of downloading the files. You can either grab them from here which will be up indefinately (It's hosted on the UTS network so it should be pretty quick). Alternatively, thetron has the torrent on his tracker and there are a few people seeding it already. The file is ~125MB and compressed with 7-zip.

    To download via BitTorrent you will need a bittorrent client:
    BitTorrent
    ABC
    G3 Torrent
    Azureus
    BitTornado

    You will also need an archive program that supports "7z" archives to extract the contents:
    7-Zip 4.x Beta (free)
    IzArc (free)
    ZipGenius (free)
    PowerArchiver (shareware)

    The extracted contents of the archive requires at least 350MB of hard disk space.
    </EDIT> I'll keep the script here for reference, in case you stumble upon another free font site and want to grab all the fonts via a script.

    I have been nosing around for some free fonts for my system, and instead of posting this in the Other OSes forum, I decided that you guys might like to take advantage of these scripts :). You will need both Python and Perl installed.

    Copy the following into getFonts.pl, and run it with "perl getFonts.pl" in the directory that you want them downloaded to.

    Code:
    #!/usr/bin/perl
    
    use LWP::UserAgent;
    
    print "MORE FONTS!\n\n";
    
    print "This script will download font files from the internet.\n";
    print "Please be patient and wait, there are a lot of things to get.\n";
    print "You can stop downloading at any time by pressing ctrl+c.\n";
    print "After you have finished, you can view the files and organize\n";
    print "then in anyway you like, view them and finally copy the best\n";
    print "ones to /usr/share/fonts or other directory you use for fonts.\n\n";
    
    print "Original author: Sean Parsons (sean\@thelinuxbox.org)\n";
    print "Modified by: Ricardo Lenz (riclc\@hotmail.com)\n\n";
    
    
    print "Now connecting to the server...\n";
    
    my $ua = LWP::UserAgent->new;
    $ua->agent("PerlBaby/0.1 ");
    $ua->cookie_jar( { 'file' => "./download_import.cookies.txt" } );
    
    my $req = HTTP::Request->new( GET => 'http://grsites.com/fonts/');
    
    my $res = $ua->request($req);
    my $data = $res->content;
    
    print "OK, processing list of files...\n";
    
    my @data = split( /\n/, $data );
    foreach my $line ( @data )
    {
      #print $line;
      $line =~ m/<nobr>\[<a href="(.*)\.shtml">Page/;
      my $file = $1;
      if( defined( $file ) )
      {
        my $req = HTTP::Request->new( GET => "http://grsites.com/fonts/$file.shtml" );
        my $res = $ua->request($req);
        my $page = $res->content;
        my @page = split( /\n/, $page );
    
        my $font_hash;
        foreach my $line ( @page )
        {
          $line =~ m/dir=(.*).fn=(.*)">/;
          my $dir = $1;
          my $filename = $2;
          if( defined( $dir ) and
              defined( $filename ) )
          {
            $font_hash->{$filename} = $dir;
          }
        }
        foreach my $font ( keys %{$font_hash} )
        {
          print "Downloading $font...";
    	
    	my $dir = $font_hash->{$font};
    	my $req = HTTP::Request->new( GET => "http://www.grsites.net/modperl/fontdownload.cgi?server=216.40.241.209&dir=$dir&fn=$font" );
    
    	my $res = $ua->request($req);
    	my $font_file= $res->content;
    	
          print "OK; saving file $font.ttf\n";
          
          open( FP , ">$font.ttf" );
          binmode FP;
          print FP $font_file;
          close( FP );
        }
      }
    }
    Copy the following into getFonts.py, and run it with "python getFonts.py" in the directory that you want them downloaded to.
    Code:
    import os
    url="http://www.clipserver.de/Fonts/"
    dlurl="http://www.clipserver.de/Fonts/TTFonts/"
    
    for letter in map(chr,range(65,91)):
    	print chr(27) + '[36m'+'moving to letter: '+letter+chr(27)+'[0m'
    	os.system("wget --wait 3 "+url+letter+".htm")	 
    	file=open(letter+'.htm')
    	data=file.read()
    	fonts=data.split('<td><font size="2">')[1:]
    	for font in fonts:
    		fontname=font[:font.find('</font>')]
    		fontname=fontname.replace(' ','_')	
    		path=font[font.find('<a href="TTFonts/')+17:font.find('" onmouseover="return CSIShow')]
    		print chr(27) + '[36m'+'downloading font: '+fontname+" file="+path+chr(27)+'[0m'
    		os.system('wget --wait 2 '+dlurl+path+' -O '+fontname+'.ttf')
    	file.close()
    
    print 'done!'
    Disclaimer: AFAIK none of these fonts are copyrighted. If you find that any of them are, please let me know and I will get rid of the thread.
     
    Last edited: Apr 28, 2005
  2. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    43,897
    Location:
    Brisbane
    Bloody good work. I'll be giving this a go at work today. :thumbup:
     
  3. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    Oh yeah, I forgot to mention. Only give this a go on dialup if you are a masochist. I ran the scripts on my laptop at uni and it took a while...It took unbearably long at home.
     
  4. robbie mcdowall

    robbie mcdowall Member

    Joined:
    Aug 21, 2002
    Messages:
    838
    Location:
    Brisbane
    What does this mean? help! Ahhhhh!

    p.s. please explain so that the noobiest of us will understand.
     
  5. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    Well do you have Python and Perl installed?
     
  6. robbie mcdowall

    robbie mcdowall Member

    Joined:
    Aug 21, 2002
    Messages:
    838
    Location:
    Brisbane
    i don't know.
     
  7. underskore

    underskore Member

    Joined:
    Nov 5, 2002
    Messages:
    4,294
    Location:
    3198
    ^^ hehe
    afaik this is in relation to *nix type OS's and well im also fairly sure that all people using *nix as there personal by choice would know without even thinking whether they have these packages (?) installed so yeah thats my input

    (if someone can prove me wrong and do this to windows boxen please, if you succeed then feel free to have a chuckle at my errors aswell)
     
  8. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    Python and Perl. A simple Google would have told you what Python and Perl is.
     
  9. robbie mcdowall

    robbie mcdowall Member

    Joined:
    Aug 21, 2002
    Messages:
    838
    Location:
    Brisbane
    But will it tell me whether I have them?

    edit: Nevermind. Installing now...
     
    Last edited: Apr 17, 2004
  10. robbie mcdowall

    robbie mcdowall Member

    Joined:
    Aug 21, 2002
    Messages:
    838
    Location:
    Brisbane
    Is it possible to get it to start from where it left off when you cancelled it?
     
  11. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    Not without modifying the script.
     
  12. robbie mcdowall

    robbie mcdowall Member

    Joined:
    Aug 21, 2002
    Messages:
    838
    Location:
    Brisbane
  13. Bern

    Bern Mind the gap!

    Joined:
    Jun 27, 2001
    Messages:
    5,183
    Location:
    Brighton, QLD
    Well spotted titan, you can never have too many fonts to play with :)
     
  14. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    I am using XFS and have experienced no slowdowns as a result of adding all these fonts...your experiences would be great.
     
  15. xplod140

    xplod140 Member

    Joined:
    Jun 1, 2002
    Messages:
    4,654
    Location:
    Melbun
    I was about to comment on that. Very suprising that that many fonts does not cause some sort of slowdown on booting windows.
     
    Last edited: Apr 18, 2004
  16. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    Give it a go and you can give some feedback to the people who are going to try this on a Windows system :).
     
  17. bsbozzy

    bsbozzy Member

    Joined:
    Nov 11, 2003
    Messages:
    3,925
    Location:
    Sydney
    Im running it under xp with only perl installed and its working fine
     
  18. thetron

    thetron Member

    Joined:
    Dec 23, 2001
    Messages:
    8,167
    Location:
    Somewhere over the Rainbo
    Remember if your new to installing fonts, DON'T INSTALL ALL THEM OR YOUR SYSTEM WILL LAG HEAPS!!!!
    It could also crash your system
     
  19. OP
    OP
    titan

    titan Member

    Joined:
    Dec 28, 2001
    Messages:
    2,887
    Location:
    Leichhardt, Sydney
    What are you talking about? Reference?
     
  20. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    SWEET! nice bit of coding I might add!

    Thanks mate, I'm downloading the fonts now, I am glad I'm on 512/128 ADSL.

    Edit:

    thetron is right,

    Fonts are normaly loaded into memory whenever you start a program like a word processor, hence why having 7000+ fonts in your main font directory is a baaaadddd idea.

    If you are going to use all of the fonts, I recommend splitting them up into alphabetical categories and installing them as you need them, then remembering to to remove them when your finished). For example:

    Code:
    F:\Fonts\Fonts-A\Arial\
    F:\Fonts\Fonts-B\Bank Gothic\
    ....
    F:\Fonts\Fonts-Z\Zebra Stripes\
    F:\Fonts\Fonts-#\1 of 9\
    F:\Fonts\Symbles\Webdings\
    
    There are font management utilities out there that allow you to view / add / remove / sort / categorize fonts. One that was popular on the Apple Mac amongst Graphic Designers was Suitecase. I'm pretty sure if you search there is a free one out there somewhere.
     
    Last edited: Apr 19, 2004

Share This Page

Advertisement: