From 0b6fcc13546d10dca848960432dec793702cccaf Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Mon, 16 May 2011 12:57:31 +0200 Subject: [PATCH] Add help and some documentation. --- tools/makefont.pl | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tools/makefont.pl b/tools/makefont.pl index b362856..4f73df9 100755 --- a/tools/makefont.pl +++ b/tools/makefont.pl @@ -1,4 +1,16 @@ #!/usr/bin/perl + +# makefont.pl - by 05/2011, BSD Licence +# +# This script rasterizes a font at a given size, then compresses it using a +# simple RLE encoding and writes its definition into compilable .c/.h files + +# Rasterisation is done via GD which in turn uses freetype +# Compression is done similar to the PK compressed fonts used by LaTex +# For a verbose description see: +# - or +# - + use GD; use strict; use warnings; @@ -15,7 +27,10 @@ for(32..126){ $charlist.=chr $_; }; -# Runtime Options +### +### Runtime Options +### + my ($verbose,$raw); my $size=18; @@ -25,6 +40,17 @@ GetOptions ("size=i" => \$size, # numeric "font=s" => \$font, # string "verbose" => \$verbose, # flag "raw" => \$raw, # flag + "help" => sub { + print < Source .ttf file to use. [Default: $font] +--size Pointsize the font should be rendered at. [Default: $size] +HELP + exit(-1);} ); ### @@ -120,7 +146,7 @@ print C < */ +/* This file created by makefont.pl by Sec */ /* Bitmaps */ const uint8_t ${fonts}Bitmaps[] = {