[css] schriftart passt nicht

King_Markus

Well-known member
ID: 66751
L
24 November 2006
264
12
hallo,

ich will eine bestimmte schriftart verwenden aber bekomm es irgendwie nicht hin.

was stimmt hier nicht?
HTML:
<style type="text/css">
@font-face { font-family:Palace Hand DB; src:url(./PAHDB___.TTF); format:(TrueType); }
</style>
 
<td><center><span style="font-family:Palace Hand DB; src:url(./PAHDB___.TTF); format:(TrueType); font-size:60px"><font color="#FF0000">M</font>usic <font color="#FF0000">P</font>oint<br>
<img src="images/point.png" width="60px" height="60px"> <font color="#FF0000"> L</font>ive </span> <img src="images/point.png" width="60px" height="60px"></center></td>
https://www.weinhaus-boehm.de/musicpoint-live/ kann man es anschauen
 
Du musst den Dateinamen und den Type nur einmal im Stylesheet angeben. Im Markup selber kannst du einfach den Schriftartnamen benutzen.

Es empfiehlt sich des Weiteren eine Alternativ-Schriftart für Non-IE-Browser zu benennen.
 
hat zwar noch ein paar minuten arbeit gebraucht um alles abzustimmen aber jetzt geht es.

folgende datei wird so eingebunden:
HTML:
 <img src="./text_pic.php?text=Name&groesse=17&bild_h=35&bild_b=65&text_b=60&start_l=5&start_o=25&zeilenabstand=15" border="0">
text_pic.php
PHP:
<?
error_reporting(E_ALL);
global $text, $groesse, $bild_h, $bild_b, $text_b, $start_l, $start_o, $zeilenabstand;

 $max_bb = $text_b;

 $za = $zeilenabstand;
  $font = 5;
 $x = $start_l;
 $y = $start_o;

 $string_width = imagefontwidth($font);

 $text = preg_replace('~\s+~', ' ', $text);

 $zeichen_anzahl = ceil($max_bb / $string_width);
 $neuertext = wordwrap( $text, $zeichen_anzahl, "\n", 1);
 $zeilen = explode("\n", $neuertext);

    $im = imagecreatetruecolor( $bild_b, $bild_h);

    $col_1 = imagecolorallocate($im, 255, 255, 255);
    $col_1 = imagecolortransparent($im, $col_1); 
        imagefill($im, 0, 0, $col_1);     
    $farbe = imagecolorallocate($im, 0, 0, 0);

    $step = $y;
    for ( $i = 0; $i < count($zeilen); $i++ ) {
        imagettftext ($im, $groesse, 0, $x, $step, $farbe, "./PAHDB___.TTF", $zeilen[$i]);
    }

    imagepng($im); 
    imagedestroy($im);
?>
 
Zuletzt bearbeitet:
So kann es aber keine Suchmaschine lesen. Setz wenigstens das alt-Attribut entsprechend.

P.S. Man benutzt $_GET[] ;)
 
HTML:
<img src="./text_pic.php?text=Text&..." alt="Text" />
Tip: Statt border="0" empfiehlt es sich, dass im CSS zu tun:
Code:
img {
  border: none;
}
Wobei bei Bildern standardmäßig eh nie ein Rahmen drumrum is, d.h. obiges überflüssig is. Nur, wenn du ein Bild verlinkst, und das kannst du mit
Code:
a img {
  border: none;
}
abstellen.