Magento – @ Font-face does not work

Mannomann, I have the font-face issue played around until it finally worked has.

I will not go into the details long, but only give concise instructions:

Problem: I want to integrate a custom font in the side, I ask locally on the server available.

In order to integrate these into a template, I use the @ font-face instruction in the loaded CSS file. And up front.

@ font-face {
font-family: "My font";
src: url('http://www.meine-domain.de/skin/frontend/MeinTheme/MeinTheme/fonts/meineSchriftart.eot');
src: url('http://www.meine-domain.de/skin/frontend/MeinTheme/MeinTheme/fonts/meineSchriftart.eot?#iefix') format('embedded-opentype'),
url('http://www.meine-domain.de/skin/frontend/MeinTheme/MeinTheme/fonts/meineSchriftart.ttf') format('truetype'),
url('http://www.meine-domain.de/skin/frontend/MeinTheme/MeinTheme/fonts/meineSchriftart.otf') format('otf'),
url('http://www.meine-domain.de/skin/frontend/MeinTheme/MeinTheme/fonts/meineSchriftart.woff') format('woff');
font-weight: normal;
font-style: normal;
}

The font files are then of course in o.g. Directory. Of course, you do not have to offer all formats. WOFF is probably currently the most compatible. There are some online converter, that create a the other formats from its font, which can then be put on the server.

So you should be actually in a position in a CSS class and “font-family: “My font”;” to have the desired font.

Unfortunately, this quite often does not work as desired, and one seeks and finds the error.

In general, one of the main points, that the URL should be same, as the domain called as the base URL. Thus if you have a subdomain deposited, you should also invite these. The domain should be that of, which is displayed in the browser, if you load the page.

Here I had tried the font in a multi-shop from a different domain (another shop the same installation) to load, the shop has but unfortunately refused.

So far I have not found a solution to use a dynamic path. It always had to be the absolute path.

It is also important: If you have entered a htttp address in the base URL, want to load address must also be an http address. but one used throughout https, must be https it!

I hope, that it will help one and other.

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *