WeBWorK Problems

Q: font size in a dynamic graph

Q: font size in a dynamic graph

by Dick Lane -
Number of replies: 0
pre-PS: I apologize if the following is a bit incoherent, but this system just swallowed and lost my previous version because I took too long writing it.  This has happened to me previously and I feel really-dumb (careless^2) for not having made a copy before pressing the "Post to Forum" button this time.


I would like to improve readability of text (labels) in a figure created dynamically within WeBWorK.

A local and non-portable fix could revise  pg/lib/Label.pm  in the following fashion
my %fields =(
                'x'             =>      0,
                'y'             =>      0,
                color   =>  'black',
####            font    =>      GD::gdSmallFont ,                               
##  orig        font    =>      GD::gdMediumBoldFont,    #gdLargeFont           
####            font    =>      GD::gdLargeFont ,                               
                font    =>      GD::gdGiantFont ,
                # constants from GD need to be addressed fully, they have not been imported.                                                                   
                str             =>      "",
                lr_nudge => 0, #justification parameters                        
                tb_nudge =>     0,
);

    If the middle of the following commands has an effect, it is not striking.
$Alabel = new Label( $Ax,  $Ay, 'A', 'black', 'left', 'top' );
$Alabel{font} => GD::gdTinyFont ;  ##  or  GD::gdGiantFont
$gr -> lb( $Alabel ) ;

Although  http://webwork.maa.org/pod/pg_TRUNK/lib/WWPlot.html  has a brief mention of
    $GD_image  =  $graph -> im() ;
I have found no examples of its use within WeBWorK.  My initial experiments after consulting the documentation about GD.pm have not been successful.

Documentation for Fun.pm mentions several useful methods: color, domain, steps,weight.  OTOH, there seem to be no methods in Label.pm.

Documentation about GD mentions use of TrueType fonts (after a suitable installation of those fonts and recompiling libgd).  Is that doable within WeBWorK?