[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / plugins-dist / filtres_images / filtres / images_typo.php
index 815e0ba..e764bdf 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2014                                                *
+ *  Copyright (c) 2001-2016                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -18,7 +18,7 @@ include_spip('inc/filtres_images_mini');
 // Image typographique
 // Fonctions pour l'arabe
 
-// http://doc.spip.org/@rtl_mb_ord
+// http://code.spip.net/@rtl_mb_ord
 function rtl_mb_ord($char){
 
        if (($c = ord($char)) < 216) return $c;
@@ -32,7 +32,7 @@ function rtl_mb_ord($char){
 }
 
 
-// http://doc.spip.org/@rtl_reverse
+// http://code.spip.net/@rtl_reverse
 function rtl_reverse($mot, $rtl_global) {
        $rtl_prec = $rtl_global;
 
@@ -87,7 +87,7 @@ function rtl_reverse($mot, $rtl_global) {
 
 
 
-// http://doc.spip.org/@rtl_visuel
+// http://code.spip.net/@rtl_visuel
 function rtl_visuel($texte, $rtl_global) {
        // hebreu + arabe: 54928 => 56767
        // hebreu + presentation A: 15707294 => 15710140
@@ -395,9 +395,10 @@ function rtl_visuel($texte, $rtl_global) {
 }
 
 
-// http://doc.spip.org/@printWordWrapped
+// http://code.spip.net/@printWordWrapped
 function printWordWrapped($image, $top, $left, $maxWidth, $font, $couleur, $text, $textSize, $align="left", $hauteur_ligne = 0) {
        static $memps = array();
+       $fontps = false;
 
        // imageftbbox exige un float, et settype aime le double pour php < 4.2.0
        settype($textSize, 'double');
@@ -453,6 +454,7 @@ function printWordWrapped($image, $top, $left, $maxWidth, $font, $couleur, $text
 
 
        $line = '';
+       $lines = array();
        while (count($words) > 0) {
                
                $mot = $words[0];
@@ -475,6 +477,7 @@ function printWordWrapped($image, $top, $left, $maxWidth, $font, $couleur, $text
 
        // Deux passes pour recuperer, d'abord, largeur_ligne
        // necessaire pour alignement right et center
+       $largeur_max = 0;
        foreach ($lines as $line) {
                if ($rtl_global) $line = rtl_visuel($line, $rtl_global);
                
@@ -508,7 +511,7 @@ function printWordWrapped($image, $top, $left, $maxWidth, $font, $couleur, $text
 //array imagefttext ( resource image, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo] )
 //array imagettftext ( resource image, float size, float angle, int x, int y, int color, string fontfile, string text )
 
-// http://doc.spip.org/@produire_image_typo
+// http://code.spip.net/@produire_image_typo
 function produire_image_typo() {
        /*
        arguments autorises: