On Sun, 29 Jul 2007, Hamish wrote:

Paul mentioned that the stroke fonts have no long description. It would be nice
if someone could write those and insert somehow as their names can be a little
cryptic. Another nice idea is to write a little d.font && d.text script that
demonstrates what those all look like and post it + a screenshot of the result
to the wiki. (sorry can't help, I'm supposed to be AWOL right now)

I've written a short Perl script (see attached) that sort of does that. It would be nice to refine it and make it automatically create multiple PNG files or something like that. At the minute probably best to run it with large resolution PNG output, then resample to a lower resolution and split into pieces before putting on display anywhere.

Paul
#!/usr/bin/perl -w

# Type of fonts to show; 0 = Stroke, 1 = Freetype
$typetoshow = 0;

$fontsize = 2;
$titlesize = 1;

open( INDATA, "d.font -L |" ) || die("Error running d.font");
open( OUTTEXT, "| d.text") || die("Error running d.text");

while( <INDATA> )
{
    ($name, $desc, $type) = split '\|';
    
    if( $type == $typetoshow )
    {
        print OUTTEXT ".F romans\n.S " . $titlesize . "\n\n" . $name . " (" . $desc . "):\n";
        print OUTTEXT ".F " . $name . "\n.S " . $fontsize . "\n" . $desc . "  AaBbCcDdEeFfGgHhIiJj\n";
    }
}

close(INDATA);
close(OUTTEXT);
_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to