From: moodler Date: Wed, 28 Apr 2004 15:39:32 +0000 (+0000) Subject: Allow a big catch-all Unicode font to be placed in lib/default.ttf X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b3fc547b68600a1a6862943803db1a041e72d729;p=moodle.git Allow a big catch-all Unicode font to be placed in lib/default.ttf eg ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP --- diff --git a/lib/graphlib.php b/lib/graphlib.php index 43029e421f..7e9d428662 100644 --- a/lib/graphlib.php +++ b/lib/graphlib.php @@ -147,14 +147,26 @@ class graph { // init all text - title, labels, and axis text. function init() { + /// Moodle mods: overrides the font path and encodings - /// Moodle mods: overrides the font path global $CFG; + + /// A default.ttf is searched for in this order: + /// lang/xx/fonts + /// lib/ + /// lang/en + $currlang = current_language(); - $fontpath = $CFG->dirroot."/lang/$currlang/fonts/"; - if (!file_exists("$fontpath"."default.ttf")) { - $fontpath = $CFG->dirroot."/lang/en/fonts/"; + if (file_exists("$CFG->dirroot/lang/$currlang/fonts/default.ttf")) { + $fontpath = "$CFG->dirroot/lang/$currlang/fonts/"; + + } else if (file_exists("$CFG->libdir/default.ttf")) { + $fontpath = "$CFG->libdir/"; + + } else { + $fontpath = "$CFG->dirroot/lang/en/fonts/"; } + $this->parameter['path_to_fonts'] = $fontpath; if (file_exists("$fontpath"."lang_decode.php")) {