Schriftart auf dem Host nutzen

Registrierer

Erfahrenes Mitglied
Ich verwende PHPlot und möchte dort eine Schriftart einbinden, die das € Symbol enthält weil es die einzige (mir bekannte) Möglichkeit darstellt dort das € Symbol darzustellen. In diesem Falle Arial.
Beispiel:
PHP:
<?php
require_once 'phplot.php';
$data = array(array('', 1800,  5), array('', 1810,  7), array('', 1820,  10),);
$plot = new PHPlot(1200, 500);
$plot->SetUseTTF('arial.ttf');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetTitle('€');
$plot->SetPlotAreaWorld(NULL, 0, NULL, NULL);
$plot->DrawGraph();
?>

Das funktioniert auf meinem Miniweich Rechner auch.
Online (in diesem Fall Strato) wird die Schriftart leider nicht gefunden (im selben Verzeichnis, Groß,- Kleinschreibung beachtet).
Weiß jemand warum?
 
http://www.phplot.com/phplotdocs/conc-text.html#conc-text-fonts
3.8.3. TrueType Font Selection hat gesagt.:
Here are some font selection examples for Windows:
Code:
# For titles, use Arial Bold Italic at 14 points:
$plot->SetFontTTF('title', 'ARIALBI.TTF', 14)
# For X Title, use Verdana at 12 points:
$plot->SetFontTTF('x_title', 'VERDANA.TTF', 12)
[...]
Here are some font selection examples for Linux:
Code:
# On systems with fonts in an expected place, like Slackware Linux,
# just use the font filename:
# For titles, use Liberation Sans Bold Italic at 14 points:
$plot->SetFontTTF('title', 'LiberationSans-BoldItalic.ttf', 14)
# For X Title, use DejaVuSans Bold at 12 points:
$plot->SetFontTTF('x_title', 'DejaVuSans-Bold.ttf', 12)

# Ubuntu and Debian use subdirectories under a searched path.
# You can use a partial path here.
$plot->SetFontTTF('x_title', 'liberation/LiberationSans-Regular.ttf', 12)
# Note: Older Ubuntu/Debian used the path ttf-liberation/...

# Fedora uses subdirectories which are not under a searched path.
# You must use full paths here.
$plot->SetTTFPath('/usr/share/fonts/liberation/');
$plot->SetFontTTF('x_title', 'LiberationSans-Regular.ttf', 12)
3.8.4. Default TrueType Font hat gesagt.:
[...], Arial.ttf, [...] - One of these is going to work on Windows, maybe other systems too.
 
Du kannst dir die Schriftarten auf deinen Server in ein beliebiges Verzeichnis kopieren und von PHP referenzieren ($plot->SetUseTTF('verzeichnis1/2/3/schriftart.ttf')).

Ob du das juristisch gesehen darfst, hängt von der Lizenz der Schriftart ("distributino rights") ab.
 

Neue Beiträge

Zurück