All graph objects that uses text allows you to specify the font to be used by calling the SetFont() method and specifying three parameters
For the builtin fonts the third, size, parameter is ignored since the size is fixed for the three builtin fonts. The available font families and the corresponding name (in JpGraph 1.7) are listed in the table below.
Font family | Type | Note |
FF_FONT0 | Builtin font | A very small font, only one style |
FF_FONT1 | Builtin font | A medium sized font |
FF_FONT2 | Builtin font | The largest bit mapped font |
FF_ARIAL | TTF font | Arial font |
FF_VERDANA | TTF font | Verdana font |
FF_COURIER | TTF font | Fix pitched courier |
FF_BOOK | TTF font | Bookman |
FF_COMIC | TTF font | Comic sans |
FF_TIMES | TTF font | Times New Roman |
FF_GEORGIA | TTF font | Georgia |
FF_TREBUCHE | TTF font | Trebuche |
FF_VERA | TTF font | Gnome Vera font, Available from http://www.gnome.org/fonts/ |
FF_VERAMONO | TTF font | Gnome Vera Mono font, Available from http://www.gnome.org/fonts/ |
FF_VERASERIF | TTF font | Gnome Vera Serif font, Available from http://www.gnome.org/fonts/ |
FF_CHINESE | TTF font | Installed chinese font |
FF_SIMSUN | TTF font | Installed chinese font |
FF_BIG5 | TTF font | Installed Chinese BIG5 font (needs iconv()) |
Please note that not all font families support all styles. The figure below illustrates each of the available font families and what styles you may use.
We finally show some example of valid font specifications
$graph
->title->SetFont(
FF_FONT2);
$graph->title->
SetFont(
FF_FONT2,
FS_BOLD);
$graph->title->
SetFont(
FF_ARIAL);
$graph->title->
SetFont(
FF_ARIAL,
FS_BOLD,24);