How to get @font-face embedding to work over https?
#1
Posted 21 March 2010 - 02:50 PM
#2
Posted 21 March 2010 - 03:05 PM
christianbright, on 21 March 2010 - 02:50 PM, said:
#3
Posted 21 March 2010 - 04:14 PM
In stylesheet.css:
@font-face {
font-family: 'FontinRegular';
src: url('Fontin-Regular.eot');
src: local('Fontin'), local('Fontin-Regular'), url('Fontin-Regular.woff') format('woff'), url('Fontin-Regular.ttf') format('truetype');
}
Then specified the item to change:
.infoBoxHeading_td {
font-family: FontinRegular, Arial, Helvetica, sans-serif;
}
Edited by christianbright, 21 March 2010 - 04:14 PM.
#4
Posted 21 March 2010 - 04:28 PM
christianbright, on 21 March 2010 - 04:14 PM, said:
In stylesheet.css:
@font-face {
font-family: 'FontinRegular';
src: url('Fontin-Regular.eot');
src: local('Fontin'), local('Fontin-Regular'), url('Fontin-Regular.woff') format('woff'), url('Fontin-Regular.ttf') format('truetype');
}
Then specified the item to change:
.infoBoxHeading_td {
font-family: FontinRegular, Arial, Helvetica, sans-serif;
}
I have no clue if it would work, but you could try this...
@font-face {
font-family: 'FontinRegular';
src: url('https://your_site/Fontin-Regular.eot');
src: local('Fontin'), local('Fontin-Regular'), url('Fontin-Regular.woff') format('woff'), url('Fontin-Regular.ttf') format('truetype');
}
But I would fist simply use a browser and browse to https://your_site/Fontin-Regular.eot and see if you get a download prompt or a 404. If you do not get a 404 then it is worth a try.
Or you may have to jack around with the syntax some or do some googling to find the correct syntax, or if it will even work.
#5
Posted 21 March 2010 - 04:42 PM
Quote
/* http://scripts.sil.org/gentium */
@font-face {
font-family: Gentium;
src: url(Gentium.ttf);
/* font-weight, font-style ==> default to normal */
}
@font-face {
font-family: Gentium;
src: url(GentiumItalic.ttf);
font-style: italic;
}
body { font-family: Gentium, Times New Roman, serif; }
I haven't tried this feature, but the url() presumably points to some place on your server in the example. I would guess that it could point to a different site (with http://....).
#6
Posted 21 March 2010 - 05:15 PM
@Phil
Actually it appears @font-face is supported by all browsers now. It works in Firefox, IE, Safari, Chrome from what I know first hand. The problem then I guess would be if the customer has updated or not..
#7
Posted 21 March 2010 - 05:56 PM
christianbright, on 21 March 2010 - 05:15 PM, said:
#8
Posted 01 May 2011 - 04:43 PM
Here's the "original" code:
@font-face {
font-family: 'BlazeITCItalic';
src: url('http://www.mysite.com/webfont/blazeitc.eot');
src: url('http://www.mysite.com/blazeitc.eot?iefix') format('eot'),
url('http://www.mysite.com/webfont/blazeitc.woff') format('woff'),
url('http://www.mysite.com/webfont/blazeitc.ttf') format('truetype'),
url('http://www.mysite.com/webfont/blazeitc.svg#webfontygQQizPM') format('svg');
font-weight: normal;
font-style: normal;
}
Now I've tried everything (and I do mean EVERYTHING), changing the URLs to httpS and so on... but nothing seems to work. As soon as the site goes to https, I lose the web font (and I get the damn "However, this page includes other resources which are not secure" message for my SSL certif)
Help?
#9
Posted 01 May 2011 - 05:58 PM
@font-face {
font-family: 'BlazeITCItalic';
src: url('webfont/blazeitc.eot');
src: url('blazeitc.eot?iefix') format('eot'),
url('webfont/blazeitc.woff') format('woff'),
url('webfont/blazeitc.ttf') format('truetype'),
url('webfont/blazeitc.svg#webfontygQQizPM') format('svg');
font-weight: normal;
font-style: normal;
}
If you were to PM me the URL of your site I'd probably be a lot more help.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#10
Posted 01 May 2011 - 09:11 PM
germ, on 01 May 2011 - 05:58 PM, said:
@font-face {
font-family: 'BlazeITCItalic';
src: url('webfont/blazeitc.eot');
src: url('blazeitc.eot?iefix') format('eot'),
url('webfont/blazeitc.woff') format('woff'),
url('webfont/blazeitc.ttf') format('truetype'),
url('webfont/blazeitc.svg#webfontygQQizPM') format('svg');
font-weight: normal;
font-style: normal;
}
If you were to PM me the URL of your site I'd probably be a lot more help.Hey germ, sorry to ask the exact same question on different topics... but this thing is really bugging me
Thanks for the help, I PM you right now.
Really appreciate it.
#11
Posted 01 May 2011 - 10:06 PM
I can't get the fonts to show on my pc using IE7 and Firefox 3.0 at all.
The fonts don't show on my Wife's pc using IE8.
On my Wife's pc the fonts show using the latest version of Firefox, even if I make the changes to the stylesheet suggested in my last post.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#12
Posted 02 May 2011 - 07:15 PM
germ, on 01 May 2011 - 10:06 PM, said:
I can't get the fonts to show on my pc using IE7 and Firefox 3.0 at all.
The fonts don't show on my Wife's pc using IE8.
On my Wife's pc the fonts show using the latest version of Firefox, even if I make the changes to the stylesheet suggested in my last post.
If "YOU" can't get it to work with your extensive knowledge, then I guess "I"'m pretty screwed
Thanks anyway for the help. I'll keep searching the Net for someone who might have gotten the same problem... One never knows...
#13
Posted 02 May 2011 - 07:48 PM
So, I've noticed that when I open the web inspector console on Chrome, I get the following statement for my @font-face:
"Resource interpreted as Font but transferred with MIME type application/octet-stream."
I googled the sentence and I think that I might have found the start of an answer... but the thing is that I don't quite understand what I should do. That's why I'm back here
In short, they say that I need to add
Quote
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
How do I do that? Just create an .htaccess in my webfont file?
That's when I ask such questions that I realize how limited I am on all this
#14
Posted 02 May 2011 - 09:28 PM
First copy/move the blazeitc.eot file into the webfont folder (if it isn't already).
Then edit the CSS file to be like this:
@font-face {
font-family: 'BlazeITCItalic';
src: url('webfont/blazeitc.eot');
src: url('webfont/blazeitc.eot?iefix') format('eot'),
url('webfont/blazeitc.woff') format('woff'),
url('webfont/blazeitc.ttf') format('truetype'),
url('webfont/blazeitc.svg#webfontygQQizPM') format('svg');
font-weight: normal;
font-style: normal;
}
Then create a .htaccess with the text you mentioned and put it in the webfont folder.Normally could make a test page and help figure this out, but the only place I have to test SSL is, shall we say, "under the weather" due to circumstances beyond my control.
Out of curiosity what browser do you use?
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#15
Posted 02 May 2011 - 10:04 PM
The thing is I'm still getting the "Resource interpreted as Font..." + "unsecure resources" messages.
For the browsers, I'm using Chrome 10.0.648.205 & FF 3.6.17
I'll try messing around with this tomorrow.
Thanks,germ.
#16
Posted 21 May 2012 - 10:19 AM
@font-face {
font-family: 'xxxx';
src: url('https://domain.com/xxxx.eot');
src: url('https://domain.com/xxxx.eot?iefix') format('eot'),
url('https://domain.com/xxxx.woff') format('woff'),
url('https://domain.com/xxxx.ttf') format('truetype'),
url('https://domain.com/xxxx.svg#webfontygQQizPM') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'xxxy';
src: url('http://domain.com/xxxx.eot');
src: url('http://domain.com/xxxx.eot?iefix') format('eot'),
url('http://domain.com/xxxx.woff') format('woff'),
url('http://domain.com/xxxx.ttf') format('truetype'),
url('http://domain.com/xxxx.svg#webfontygQQizPM') format('svg');
font-weight: normal;
font-style: normal;
}
font-family: 'xxxx','xxxy';
In the above code we are loading same font-family with different names, this will work for both "http" and "https"
Thanks









