Announcement

Collapse
No announcement yet.

Schriftart in CSS einbinden

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Schriftart in CSS einbinden

    Hallo,
    ich hatte vor, eine weitere Schriftart in CSS einzubinden. Zum Testen hatte ich Dejavuserif genommen. Siehe Code:

    Code:
    @font-face {
        font-family: 'testschrift';
        src: url('DejaVuSerif.ttf') format('truetype');
    }
    body {
        font-family: testschrift,Comic Sans MS;
    }
    Leider passiert gar nichts (d.h. Comic Sans ist aktiv). Das betrifft FF als auch den IE. Die Datei DejaVuSerif.ttf liegt im selben Verzeichnis. Die Schrift ist "installierbar". Nun stehe ich auf dem Schlauch.
    Für Hinweise wäre ich sehr dankbar.
    bigiana

  • #2
    Setze deine Schrift bei font-family mal in quotes.
    Und dann schau mal in der Developer Console(Network) deines Browser ob die Schrift den geladen (also gefunden) wurde.

    Comment


    • #3
      Ja, danke!
      DejaVuSerif wird gefunden. nun hab ichs mit Aharoni (ahronbd.ttf) probiert und erhalte folgende Fehlermeldungen:

      downloadable font: glyf: Bytecode length too high 171 (font-family: "testschrift" style:normal weight:normal stretch:normal src index:0) source: http://localhost/test/schriftladen/ahronbd.ttf styles.css:1:12
      downloadable font: glyf: Failed to parse glyph 118 (font-family: "testschrift" style:normal weight:normal stretch:normal src index:0) source: http://localhost/test/schriftladen/ahronbd.ttf styles.css:1:12
      downloadable font: rejected by sanitizer (font-family: "testschrift" style:normal weight:normal stretch:normal src index:0) source: http://localhost/test/schriftladen/ahronbd.ttf styles.css:1:12

      Was bedeuten denn diese?

      Comment


      • #4
        Habe ich noch nicht gesehen. Versuche mal einen anderen Browser. Wenn der auch ein Problem hat würde ich davon ausgehen das das ttf kaputt ist. Zumindest kaputt nach dem Maßstab der Browser. Windows mag das anders sehen. Wenn möglich solltest du eh ein anderes Font Format nehmen. Üblich sind im Web mittlerweile eher Woff bzw. Woff2. Und in Zukunft möglicherweise svg Fonts.

        <rant>Das ist das schöne am Web. Es gibt zwar Standards aber keine Konstanten.</rant>

        Comment


        • #5
          Ja, danke!
          Die ttf wars!! Ich habe die ttf nochmal woanders runtergeladen (neuere Vesion), und mit dieser gings dann!!

          Comment

          Working...
          X