Verwendung: Verwendung eines neuen Fonts in Oneo

Produkt: Oneo Contao
Contao-Version: 5.3.44
Browser und Browserversionen: Chrome Version 144.0.7559.133

Hallo, für einen Kunden möchte ich in Oneo einen anderen Font, als Open Sans verwenden. Zum Test habe ich Roboto hochgeladen. In custom.css habe ich die font-face eingetragen->

@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 400;
  src: url("../../font/roboto/Roboto-Italic.woff2") format('woff2');
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 700;
  src: url("../../font/roboto/Roboto-BoldItalic.woff2") format('woff2');
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  src: url("../../font/roboto/Roboto-Regular.woff2") format('woff2');
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  src: url("../../font/roboto/Roboto-Bold.woff2") format('woff2');
  font-display: swap;
}

Im Theme Assistent der Eintrag -> "Roboto","Open Sans",sans-serif
Der Font ändert sich aber nicht. Wenn ich nur Roboto eintrage, erscheint eine default Serif-Schrift.
Roboto habe ich von Google Fonts geladen und mit einem Tool von ttf in woff2 konvertiert.
Was mache ich falsch?
Danke und Grüße
Reinhard Ewert
Was mache ich falsch?

  1. Vielen Dank für Ihre Frage.

    Die Datei /files/font/roboto/Roboto-Regular.woff2 ist über den Webserver anscheinend nicht erreichbar. Bitte prüfen Sie ob die Datei exakt an diesem Pfad am Webserver existiert und stellen Sie sicher, dass der Ordner font oder der Ordner font/roboto in der Dateiverwaltung von Contao als „öffentlich“ markiert ist.

  2. Danke für die schnelle Antwort. Ich bin davon ausgegangen, dass die Ordner in CSS public sind. Habe die Dateien jetzt direkt unter /files/ installiert. jetzt funktioniert es.

Reply to this discussion Internal reply only staff will see it

Markdown

Attaching KB article:

» »

Read more…

Already uploaded files

  • Roboto-Bold.woff2 63.9 KB
Attach files

Up to 10MB each.

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac