]> git.mjollnir.org Git - moodle.git/commitdiff
Changes to use fonts in language packs, and also to use a language
authormoodler <moodler>
Tue, 21 Jan 2003 09:17:10 +0000 (09:17 +0000)
committermoodler <moodler>
Tue, 21 Jan 2003 09:17:10 +0000 (09:17 +0000)
decoding function if necessary

lib/graphlib.php

index a78921f929e230a891fe5d0896b280e2552ceb15..51ae5c2605ff6ad0743504029c0c642a193e0b1f 100644 (file)
@@ -155,6 +155,12 @@ function init() {
       $fontpath = $CFG->dirroot."/lang/en/fonts/";\r
   }\r
   $this->parameter['path_to_fonts'] = $fontpath;\r
+\r
+  if (file_exists("$fontpath"."lang_decode.php")) {\r
+      $this->parameter['lang_decode'] = "$fontpath"."lang_decode.php";\r
+  } else {\r
+      $this->parameter['lang_decode'] = "";\r
+  }\r
   /// End Moodle mods\r
 \r
 \r
@@ -1215,6 +1221,10 @@ function print_TTF($message) {
       $x = 0;\r
       break;\r
   }\r
+  if ($this->parameter['lang_decode']) {               // Moodle addition\r
+      include_once($this->parameter['lang_decode']);\r
+      $text = lang_decode($text);\r
+  }\r
   ImageTTFText($this->image, $points, $angle, $x, $y, $colour, $font, $text);\r
 }\r
 \r
@@ -1317,6 +1327,10 @@ function get_boundaryBox($message) {
        }\r
 \r
        // get boundary box and offsets for printing at an angle\r
+    if ($this->parameter['lang_decode']) {               // Moodle addition\r
+        include_once($this->parameter['lang_decode']);\r
+        $text = lang_decode($text);\r
+    }\r
        $bounds = ImageTTFBBox($points, $angle, $font, $text);\r
 \r
        if ($angle < 0) {\r