Skip to content

Commit

Permalink
Moved fonts into language pack so that other languages can have
Browse files Browse the repository at this point in the history
proper displays in graphs
  • Loading branch information
moodler committed Jan 21, 2003
1 parent bc43adf commit f6e653e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
File renamed without changes.
Binary file removed lib/fonts/vixar.ttf
Binary file not shown.
21 changes: 16 additions & 5 deletions lib/graphlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class graph {
// for WINDOZE this may need to be the full path, not relative.

'title' => 'Graph Title', // text for graph title
'title_font' => 'arial.ttf', // title text font. don't forget to set 'path_to_fonts' above.
'title_font' => 'default.ttf', // title text font. don't forget to set 'path_to_fonts' above.
'title_size' => 16, // title text point size
'title_colour' => 'black', // colour for title text

Expand All @@ -54,7 +54,7 @@ class graph {
'y_label_right' => '', // if this is set then this text is printed on right axis of graph.

'label_size' => 12, // label text point size
'label_font' => 'arial.ttf', // label text font. don't forget to set 'path_to_fonts' above.
'label_font' => 'default.ttf', // label text font. don't forget to set 'path_to_fonts' above.
'label_colour' => 'gray33', // label text colour
'y_label_angle' => 90, // rotation of y axis label

Expand Down Expand Up @@ -108,7 +108,7 @@ class graph {
'zero_axis' => 'none', // colour to draw zero-axis, or 'none'.


'axis_font' => 'arial.ttf', // axis text font. don't forget to set 'path_to_fonts' above.
'axis_font' => 'default.ttf', // axis text font. don't forget to set 'path_to_fonts' above.
'axis_size' => 12, // axis text font size in points
'axis_colour' => 'gray33', // colour of axis text.
'y_axis_angle' => 0, // rotation of axis text.
Expand All @@ -131,7 +131,7 @@ class graph {
// 'outside-top', 'outside-bottom', 'outside-left', or 'outside-right'.
'legend_offset' => 10, // offset in pixels from graph or outside border.
'legend_padding' => 5, // padding around legend text.
'legend_font' => 'arial.ttf', // legend text font. don't forget to set 'path_to_fonts' above.
'legend_font' => 'default.ttf', // legend text font. don't forget to set 'path_to_fonts' above.
'legend_size' => 9, // legend text point size.
'legend_colour' => 'black', // legend text colour.
'legend_border' => 'none', // legend border colour, or 'none'.
Expand All @@ -145,8 +145,19 @@ class graph {

// init all text - title, labels, and axis text.
function init() {


/// Moodle mods: overrides the font path
global $CFG;
$this->parameter['path_to_fonts'] = $CFG->dirroot."/lib/fonts/"; // Moodle
$currlang = current_language();
$fontpath = $CFG->dirroot."/lang/$currlang/fonts/";
if (!file_exists("$fontpath"."default.ttf")) {
$fontpath = $CFG->dirroot."/lang/en/fonts/";
}
$this->parameter['path_to_fonts'] = $fontpath;
/// End Moodle mods



$this->calculated['outer_border'] = $this->calculated['boundary_box'];

Expand Down

0 comments on commit f6e653e

Please sign in to comment.