Why @font-face doesn't connect the font?

0 like 0 dislike
7 views
The @font-face just doesn't connect the font, no errors, no nothing.

Already simplified everything as I could, but I can't find the root of the problem.
We have the following file structure:

node_modules
public
index.css
Lato-Bold.ttf
views
index.pug
app.js
package.json

index.css
@font-face { font-family: Lato; src: url(Lato-bold.ttf); }


index.pug
doctype html html head meta(charset='utf-8') title Document link(rel='stylesheet' href='./index.css') body


app.js
const express = require('express'); const app = express(); app.set('views', 'views'); app.set('view engine', 'pug'); app.use(express.static('public')); app.get('/', (request, response) => response.render(")); app.listen(8040);


package.json
{ "dependencies": { "express": "^4.16.3", "pug": "^2.0.3" } }


Networks empty
5b3ccec7dbfc7033130125.png
by | 7 views

2 Answers

0 like 0 dislike

The @font-face rule is designed to allow lazy loading of fonts, fonts are only downloaded when needed for use within a document. A stylesheet can include the @font-face rules for a library of fonts of which only a select set are used; user agents must only download those fonts that are referred to within the style rules applicable to a given page. User agents that download all fonts defined in @font-face rules without considering whether those fonts are in fact used within a page are considered non-conformant.


In General, check download fonts only via devtools, never using these fonts was a stupid idea.
by
0 like 0 dislike
Tried in this format?
@font-face { font-family: ProximaNova-Light; src: url(../font/ProximaNova/ProximaNova-Light.otf) format("opentype"); }
by

Related questions

0 like 0 dislike
6 answers
asked Mar 21, 2019 by Artqookie
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
32,724 users