From d60131c3c979a0bc831d28a110badda911af7803 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 21 Jan 2003 09:17:10 +0000 Subject: [PATCH] Changes to use fonts in language packs, and also to use a language decoding function if necessary --- lib/graphlib.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/graphlib.php b/lib/graphlib.php index a78921f929..51ae5c2605 100644 --- a/lib/graphlib.php +++ b/lib/graphlib.php @@ -155,6 +155,12 @@ function init() { $fontpath = $CFG->dirroot."/lang/en/fonts/"; } $this->parameter['path_to_fonts'] = $fontpath; + + if (file_exists("$fontpath"."lang_decode.php")) { + $this->parameter['lang_decode'] = "$fontpath"."lang_decode.php"; + } else { + $this->parameter['lang_decode'] = ""; + } /// End Moodle mods @@ -1215,6 +1221,10 @@ function print_TTF($message) { $x = 0; break; } + if ($this->parameter['lang_decode']) { // Moodle addition + include_once($this->parameter['lang_decode']); + $text = lang_decode($text); + } ImageTTFText($this->image, $points, $angle, $x, $y, $colour, $font, $text); } @@ -1317,6 +1327,10 @@ function get_boundaryBox($message) { } // get boundary box and offsets for printing at an angle + if ($this->parameter['lang_decode']) { // Moodle addition + include_once($this->parameter['lang_decode']); + $text = lang_decode($text); + } $bounds = ImageTTFBBox($points, $angle, $font, $text); if ($angle < 0) { -- 2.39.5