[Redhat 8 / php & ttf] Kan font niet vinden...

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

  • DPLuS
  • Registratie: April 2000
  • Niet online
Ik probeer grafiekjes te genereren met dit pakketje:
http://ykcee.sourceforge.net

Maar als ik die php-pagina aanroep krijg ik deze error:

Warning: Could not find/open font in /home/patrick/web/kpi/ykcee/ykcee.php on line 434

Dat is raar, want volgens mij heb ik alles geïnstalleerd m.b.t. true-type fonts:

PHP CONFIG:

'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs'

Dit is de source van demo.php:

PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php

        include("./ykcee.php");
        $graph = new ykcee;

    $graph->SetImageSize(320, 240);

        $graph->SetTitleFont("./VERDANA.TTF");
        $graph->SetFont("./VERDANA.TTF");

        $graph->SetFileFormat("png");
    $graph->SetBackgroundColor("white");
    $graph->SetChartBackgroundColor("silver");
        $graph->SetMaxStringSize(9);
    $graph->SetChartBorderColor("black");
        $graph->SetChartType("lines");
    $graph->SetChartTitleSize(14);
    $graph->SetChartTitle("Test Data");
    $graph->SetChartTitleColor("blue");
    $graph->SetFontColor("black");
    $graph->SetBarColor(array("green", "red", "yellow", "blue"));
    $graph->SetBarBorderColor(array("black"));
        $graph->SetLegend(array("eins", "zwei", "drei", "vier"));
    $graph->SetLegendPosition(2);
    $graph->SetTitleAxisX("");
    $graph->SetTitleAxisY("");
        $graph->SetAxisFontSize(8);
    $graph->SetAxisColor("black");
    $graph->SetAxisTitleSize(12);
    $graph->SetTickLength(2);
    $graph->SetTickInterval(6);
    $graph->SetGridX(6);
    $graph->SetGridY(0);
    $graph->SetGridColor("white");
        $graph->SetLineThickness(1);
        $graph->SetPointSize(2); //es werden dringend gerade Zahlen empfohlen
        $graph->SetPointShape("dots");
        $graph->SetShading(0);
        $graph->SetNoData("Sorry, im Moment sind keine Daten verfügbar");



        srand ((double) microtime() * 1000000);
        $a = 25;
        $b = 23;
        $c = 18;
        $d = 0;
        for ($i=0; $i<25; $i++) {
                $a += rand(-2, 2);
                $b += rand(-5, 5);
                $c += rand(-2, 2);
                if ($a < 0) $a = 0;
                if ($b < 0) $b = 0;
                if ($c < 0) $c = 0;

                $data[$i] = array("value $i", $a, $b, $c);
        }

        $graph->SetDataValues($data);


        /*
        $graph->SetDataValues(array(
                array("Brother HL 2060", 55, 40, 12),
                array("Epson Aculaser 2700", 38, 55, 42),
        array("Epson EPL n4000+", 35, 50, 9),
        array("Brother HL 2400 CE", 55, 48, 17),
        array("Epson Aculaser 2700", 38, 55, 42),
        array("Epson EPL n4000+", 35, 50, 9),
        array("Brother HL 2400 CE", 55, 48, 17),
        array("Epson Aculaser C2000", 41, 55, 18),
        array("Epson EPL n4000+", 35, 50, 9),
        array("Brother HL 2060", 55, 40, 12),
        ));
        */

    $graph->DrawGraph();
?>



en mijn directory-listing:

[patrick@rh8 ykcee]$ ls -al
total 404
drwxrwxr-x 2 patrick patrick 4096 Feb 4 16:05 .
drwxr-xr-x 4 patrick patrick 4096 Feb 4 16:05 ..
-rw-r--r-- 1 patrick patrick 2148 Feb 4 16:16 demo.php
-rw-rw-rw- 1 patrick patrick 108256 Aug 30 2000 VERDANAB.TTF
-rw-rw-rw- 1 patrick patrick 123824 Aug 30 2000 VERDANAI.TTF
-rw-rw-rw- 1 patrick patrick 109724 Aug 30 2000 VERDANA.TTF
-rw-r--r-- 1 patrick patrick 37263 Aug 30 2000 ykcee.php


Wat kan er aan de hand zijn?
NB: dit is waarschijnlijk de eerste keer dat ik TTF gebruik in een script, dus als ik van te voren iets had moeten configureren heb ik dat vast niet gedaan...

Acties:
  • 0 Henk 'm!

  • Grijze Vos
  • Registratie: December 2002
  • Laatst online: 28-02 22:17
doe es een chmod +x over die TTF's..

Op zoek naar een nieuwe collega, .NET webdev, voornamelijk productontwikkeling. DM voor meer info


Acties:
  • 0 Henk 'm!

  • DPLuS
  • Registratie: April 2000
  • Niet online
Nope, werkt ook niet...

Moet ik die ttf'jes niet in een aparte directory gooien?

Acties:
  • 0 Henk 'm!

  • moto-moi
  • Registratie: Juli 2001
  • Laatst online: 09-06-2011

moto-moi

Ja, ik haat jou ook :w

Grijze Vos schreef op 04 februari 2004 @ 17:53:
doe es een chmod +x over die TTF's..
Wat is er het nut van om een file executable te maken, als je hem alleen maar hoeft te lezen :?

@topicstarter:
Weet je zeker dat php er ook van op de hoogte is dat je fonts wilt gebruiken ? ;)
Verder geef je aan dat hij in de -huidige- directory moet gaan kijken naar de fonts, probeer daar eens het hele pad naar de fonts neer te zetten ?

God, root, what is difference? | Talga Vassternich | IBM zuigt


Acties:
  • 0 Henk 'm!

  • DPLuS
  • Registratie: April 2000
  • Niet online
Thanks, hele pad werkt wel!

Acties:
  • 0 Henk 'm!

  • kvdveer
  • Registratie: November 2000
  • Laatst online: 07-11-2023

kvdveer

Z.O.Z.

DPLuS schreef op 04 februari 2004 @ 20:13:
Thanks, hele pad werkt wel!
En realpath() maakt dat weer wat eenvoudiger en meer portable... :)

Localhost, sweet localhost

Pagina: 1