Urggh. This is all the more confusing because the CSS and file references must be right - it's working offline - so why wouldn't it work on the live site?
Here's the local view. The first three icons - the Window, Door and Conservatory - are Flaticon icons:
Here's the same page on the live site (www.bairdswindows.co.uk):
This is my flaticon.css file which is located in my 'css' directory:
#font-face {
font-family: "Flaticon";
src: url("../icons/flaticon.eot");
src: url("../icons/flaticon.eot#iefix") format("embedded-opentype"),
url("../icons/flaticon.woff") format("woff"),
url("../icons/flaticon.ttf") format("truetype"),
url("../icons/flaticon.svg") format("svg");
font-weight: normal;
font-style: normal;
}
[class^="flaticon-"]:before, [class*=" flaticon-"]:before,
[class^="flaticon-"]:after, [class*=" flaticon-"]:after {
font-family: Flaticon;
font-size: 20px;
font-style: normal;
margin-left: 20px;
}
.flaticon-bill:before {
content: "\e000";
}
.flaticon-calculator18:before {
content: "\e001";
}
.flaticon-doorway:before {
content: "\e002";
}
.flaticon-house112:before {
content: "\e003";
}
.flaticon-open203:before {
content: "\e004";
}
.flaticon-opened33:before {
content: "\e005";
}
.flaticon-window-frame:before {
content: "\e006";
}
The icons, on the live site, are appearing as small boxes with what looks like their e0001 etc title so the browser is seeing them, on the live site, it just isn't interpreting them and/or converting them to the icons.
Considering that it works locally, it has me completely stumped and I haven't been able to get a response from Flaticon support as of yet. Hope someone can point out the obvious problem.
Thank you.
NJ
Fasthosts, my host company, don't allow a sub-directory called "icons" on their shared Unix/Linux servers. Oh, and yes, they didn't bother telling anyone. Yay Fasthosts! :|
NJ
Related
I have a react.js app up and running. I wanted to change the font to Galano Grotesque Bold. I downloaded the files and followed the tutorial here:
https://esfonts.pro/articulo/como-instalar-una-fuente#web
I have this style.css file:
#font-face {
font-family: 'Galano Grotesque';
src: local('Galano Grotesque Bold'), local('Galano-Grotesque-Bold'),
url('GalanoGrotesque-Bold.woff2') format('woff2'),
url('GalanoGrotesque-Bold.woff') format('woff'),
url('GalanoGrotesque-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
I import it in App.css like this:
#import url("fonts/roboto/style.css");
.App {
text-align: center;
margin-top: 20px;
}
.zoom {
width: auto;
height: auto;
}
body {
font-family: 'Galano Grotesque', Bold;
}
It's working perfectly in localhost. The problem comes when I deploy this app (using netlify). I see the following error and the font is not correct:
I understand that these files are being blocked by cord policy. I've read that I should do the request using HTTPS but I don't know how to do it.
Anyone knows how to fix this?
I have tried both ttf and woff formats with multiple different fonts across chrome, firefox, and edge but it doesn't seem to apply any font no matter what i do. Everything else in the style sheet is referenced perfectly fine besides #font-face. I've checked directory and syntax error but as far as i can see there are none.
.
.
body {
background-color: black;
color: #B0C1B4;
}
p {
font-family: font !important;
font-weight: 100;
}
#log {
width: 65%;
}
#font-face {
font-family: 'font';
src: url(data/fonts/font.ttf) format(ttf),
url(data/fonts/font.woff) format(woff);
font-style: normal;
font-weight: 100;
}
You're defining the wrong path here.
Path must be like this:
#font-face {
font-family: 'font';
src: url(data/fonts/font.ttf) format(ttf),
url(data/fonts/font.woff) format(woff);
font-style: normal;
font-weight: 100;
}
I have downloaded a custom icon font from Flaticon and tried to use it on a SaaS type shop. As I don't have access to the shop files, I've tried to host the font from an ftp server and tried to make it work on a demo page: here. This works, but when I try to use something like livewave all I get is a square instead of an icon.
on ftp server the css and font files are in the same directory and I used reletive links to the files in css, but the css itself is included with a global link like this:
<link rel="stylesheet" type="text/css" href="http://sklep1807322.home.pl/pub/flat_icons/font/flaticon.css">
the css file looks like this:
#font-face {
font-family: "Flaticon";
src: url("./Flaticon.eot");
src: url("./Flaticon.eot?#iefix") format("embedded-opentype"),
url("./Flaticon.woff2") format("woff2"),
url("./Flaticon.woff") format("woff"),
url("./Flaticon.ttf") format("truetype"),
url("./Flaticon.svg#Flaticon") format("svg");
font-weight: normal;
font-style: normal;
}
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: "Flaticon";
src: url("./Flaticon.svg#Flaticon") format("svg");
}
}
[class^="flaticon-"]:before, [class*=" flaticon-"]:before,
[class^="flaticon-"]:after, [class*=" flaticon-"]:after {
font-family: Flaticon;
font-size: 20px;
font-style: normal;
margin-left: 20px;
}
.flaticon-user:before { content: "\f100"; }
.flaticon-shopping-bag:before { content: "\f101"; }
.flaticon-search:before { content: "\f102"; }
.flaticon-menu:before { content: "\f103"; }
Anybody know what I'm doing wrong?
Access to font at 'https://sklep1807322.home.pl/pub/flat_icons/font/Flaticon.woff2' from origin 'https://liveweave.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
You need to fix the CORS Policy on the server where the Website will be to allow source: https://sklep1807322.home.pl/
It is working on http://sklep1807322.home.pl/ at the moment, as this is the SAME ORIGIN.
I am trying to get custom fonts working in Nativescript, and hve them in the src/fonts folder at root. I have looked at other questions on SO, but not solved it, the css is below, and it is a display font just for the action bar title, not used anywhere else.
#font-face {
font-family: 'Trade Winds';
font-style: normal;
font-weight: 400;
src: local('Trade Winds'), local('TradeWinds'),
url('src/fonts/trade-winds-v8-latin-regular.ttf') format('ttf'), /* Safari, Android, IOS*/
}
.action-label {
font-family: 'Trade Winds', 'trade-winds';
font-size: 28px;
font-weight: bold;
color:blue;
}
have also tried variations of the path but not working. Only testing in Android at the moment. Thanks
Hello stackoverflowers,
I have built a site that looks great in Chrome and FF (but only in local server). When uploaded, chrome does a great job and looks great. FF does not render the #font-face font..cant figure out why. Using Foundation 3.
SASS:
#font-face {
font-family: 'oswald';
src: url('/stylesheets/font/oswald/oswald-webfont.eot');
src: url('/stylesheets/font/oswald/oswald-webfont.eot?#iefix') format('embedded-opentype'),
url('/stylesheets/font/oswald/oswald-webfont.woff') format('woff'),
url('/stylesheets/font/oswald/oswald-webfont.ttf') format('truetype'),
url('/stylesheets/font/oswald/oswald-webfont.svg#oswaldregular') format('svg');
font-weight: lighter;
font-style: lighter;
}
$headerFontFamily: "oswald", Helvetica, Arial, sans-serif;
In the footer, there are some social links. these have icons using the a:before pseudo selector. Again, fine in chrome but no go in firefox. I have checked the code letter by letter and cant see any typos....but then it is getting late. This one is strange as one of the links is fine, just not the first two:
css:
li:nth-of-type(1) a:before { content: url('../images/watch-trailer.png'); }
li:nth-of-type(2) a:before { content: url('../images/rating.png'); }
li:nth-of-type(3) a:before { content: url('../images/book-seats.png'); }
li:nth-of-type(1) a:hover:before { content: url('../images/watch-trailer-active.png'); }
li:nth-of-type(2) a:hover:before { content: url('../images/rating-active.png'); }
li:nth-of-type(3) a:hover:before { content: url('../images/book-seats-active.png');
}
http://schwack.madmantis.co.uk/
Any help with these two questions please.
On a side note, the page does have some problems in ie (such as slider content missing, movie thumb overlay not going transparent and probably a few others) I am not in a big hurry to fix these but would be nice if someone happened to have a fix for them. Silly IE getting in the way of progress.
It seems that your server is wrongly configured and can't handle font files (woff, svg, eot, ttf).
The server returns a 500 Internal Server Error.
http://schwack.madmantis.co.uk/stylesheets/font/Oswald/oswald-webfont.woff
http://schwack.madmantis.co.uk/stylesheets/font/Oswald/oswald-webfont.ttf
Update
It seems that the fonts are available under (all lowercase) http://schwack.madmantis.co.uk/stylesheets/font/oswald/oswald-webfont.{format}
Change your styles.css with the following font definition:
#font-face {
font-family: 'oswald';
src: url("/stylesheets/font/oswald/oswald-webfont.eot");
src: url("/stylesheets/font/oswald/oswald-webfont.eot?#iefix") format("embedded-opentype"), url("/stylesheets/font/oswald/oswald-webfont.woff") format("woff"), url("/stylesheets/font/Oswald/oswald-webfont.ttf") format("truetype"), url("/stylesheets/font/Oswald/oswald-webfont.svg#oswaldregular") format("svg");
font-weight: lighter;
font-style: lighter;
}