Adding the font-family.ttf file to the /webroot/fonts folder + mentioning the font in cake.css does not work.
Then I noticed the custom font ‘Raleway’ is used in the cake.css, not present in the fonts folder and loaded separately in the header by a stylesheet from Google Font:
<link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet">
If I want to add a general font, how is this supposed to be done in the CakePHP structure?
Cake doesn’t have any particular functionality that I’m aware of for dealing with fonts. You just use the general-purpose tools to generate HTML that does what you want.
The Raleway font you see being loaded is not in your fonts folder, because it’s loading from Google. If by “general font” you mean something from Google (or some other third-party font hosting service), then you’d replicate this sort of header. Those services will all have documentation that describes how to format that header and reference the result in your CSS.
If you want to load a font from your own fonts folder, then you need to add a header that does that instead. Without you telling it where to find the font, the browser has no clue whether you’ve got a fonts folder or where it’s located or what the font file is named. Again, this is a general HTML solution which there should be many tutorials about out there; the only way that Cake is involved is how you use it to create the HTML you need.
If by “general font” you’re just talking about something that everyone already has, like Arial or Times New Roman, then you don’t need to add any header for that, you just add the correct “font-family” declaration in your CSS file.