mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-19270_master' of https://github.com/nadavkav/moodle
This commit is contained in:
commit
d320391099
@ -378,6 +378,18 @@ class core_text {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse UTF-8 multibytes character sets (used for RTL languages)
|
||||
* (We only do this because there is no mb_strrev or iconv_strrev)
|
||||
*
|
||||
* @param string $str the multibyte string to reverse
|
||||
* @return string the reversed multi byte string
|
||||
*/
|
||||
public static function strrev($str) {
|
||||
preg_match_all('/./us', $str, $ar);
|
||||
return join('', array_reverse($ar[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to convert upper unicode characters to plain ascii,
|
||||
* the returned string may contain unconverted unicode characters.
|
||||
|
@ -1193,7 +1193,8 @@ class graph {
|
||||
function print_TTF($message) {
|
||||
$points = $message['points'];
|
||||
$angle = $message['angle'];
|
||||
$text = $message['text'];
|
||||
// We have to manually reverse the label, since php GD cannot handle RTL characters properly in UTF8 strings.
|
||||
$text = (right_to_left()) ? core_text::strrev($message['text']) : $message['text'];
|
||||
$colour = $this->colour[$message['colour']];
|
||||
$font = $this->parameter['path_to_fonts'].$message['font'];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user