Warning: Could not find/open font

Consultez la formation à Google Analytics de WebRankInfo / Ranking Metrics

Stellvia
WRInaute impliqué
WRInaute impliqué
 
Messages: 414
Inscription: Mar Déc 28, 2004 0:02

Warning: Could not find/open font

Message le Mer Nov 26, 2008 1:20

Bonjour,

A mon avis ce post va se prendre un bide , mais bon j'essais quand même je suis désespéré :oops:

GD2 est installé sur mon serveur ( debian/apache2/php5 ).
Lorsque j'utilise la fonction imagefttext , j'ai cette erreur :

Warning: Could not find/open font

La police existe bel et bien , mais php ne veut pas la trouver/charger .
Php.net parle de cette erreur :

http://us.php.net/manual/en/function.imagefttext.php


The path to the TrueType font you wish to use.

Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

When using versions of the GD library lower than 2.0.18, a space character, rather than a semicolon, was used as the 'path separator' for different font files. Unintentional use of this feature will result in the warning message: Warning: Could not find/open font. For these affected versions, the only solution is moving the font to a path which does not contain spaces.

In many cases where a font resides in the same directory as the script using it the following trick will alleviate any include problems.
<?php
// Set the enviroment variable for GD
putenv('GDFONTPATH=' . realpath('.'));

// Name the font to be used (note the lack of the .ttf extension)
$font = 'SomeFont';
?>



Mais ca ne résoud pas mon problème .

Il semble y avoir un problème de configuration sur mon serveur au niveau de php , cependant après moult recherche sur google ( les post qui parlent de ce problème ne manque pas ) je n'arrive toujours pas à trouver de solution .

Voila comment j'ai installé le serveur sous debian :

apt-get install apache2
a2enmod rewrite && a2enmod suexec
apt-get install php5-gd php5-imap php5-curl php5-mysql libapache2-mod-php5


Est ce que quelqu'un pourrait m'aider ?


seebz
WRInaute impliqué
WRInaute impliqué
 
Messages: 476
Inscription: Dim Avr 15, 2007 17:14

Message le Mer Nov 26, 2008 7:42

Ca marche si tu met le chemin complet vers le fichier de font..

essaye :

$font = basedir(__FILE__).'/SomeFont.ttf';

Stellvia
WRInaute impliqué
WRInaute impliqué
 
Messages: 414
Inscription: Mar Déc 28, 2004 0:02

Message le Mer Nov 26, 2008 10:42

Merci tu m'a amener vers la solution :

realpath();


Formation recommandée sur ce thème :

Formation Google Analytics : en 2 jours, apprenez comment exploiter l'essentiel des possibilités de l'outil de mesure d'audience de Google. Formation animée par Julien Coquet, expert certifié officiellement par Google Analytics.

Tous les détails sur le site Ranking Metrics : programme, prix, dates et lieux, inscription en ligne.

Lectures recommandées sur ce thème :



Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 0 invités