Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Template Parth with @font-face

7 views
Skip to first unread message

william...@gmail.com

unread,
Feb 9, 2015, 2:34:45 PM2/9/15
to
Hi in my template.dwt I have...

<html>
<head>
<style>@font-face{ font-family:Gelio Pasteli; src:url("stylesheet/GelioPasteli.ttf"); }</style>
<link rel="stylesheet" type="text/css" href="stylesheet/stylesheet.css">
<!-- #BeginEditable "Title" -->

When I save .htm pages lined to this template to different folders, Microsoft Expression Web detects the href to my stylesheet and keeps everything working, but not the src:url to my font file.

How can I tell it that this is a link it needs to know about as well please?

Many Thanks,

William

Ronx

unread,
Feb 10, 2015, 4:45:03 AM2/10/15
to
william...@gmail.com was thinking very hard :
@font-face is not fully supported by EW, in particular the src attribute is an unknown, and will not be updated as the pages are moved around.

There are workarounds:

Use root-relative links.
Assuming the DWT is located in the root folder of the website:

[code]
<html>
<head>
<style>@font-face{ font-family:"Gelio Pasteli"; src:url("/stylesheet/GelioPasteli.ttf"); }</style>
<link rel="stylesheet" type="text/css" href="stylesheet/stylesheet.css">
> <!-- #BeginEditable "Title" -->
[/code]

Or place the rule within the style sheet (@* rules should be the first rules in the stylesheet) - no path is needed if the font file is in the same
folder as the stylesheet:

[code]
@font-face{ font-family:"Gelio Pasteli"; src:url("GelioPasteli.ttf"); }
/* rest of stylesheet */
[/code]

--
Ron Symonds
http://www.rxs-enterprises.org/fp/wf-menu.aspx


william...@gmail.com

unread,
Feb 11, 2015, 7:09:58 AM2/11/15
to
Dear Ron,

I tried your second approach but it does not work. I have @font-face{
font-family:"Gelio Pasteli"; src:url("GelioPasteli.ttf"); } at the top of
my style sheet, but only pages saved in my root directory pick up the font,
pages in other directories show time roman.

Eg: file:///A:/Web/TheOligarch/workingon/gui.htm comes up in times
but file:///A:/Web/TheOligarch/gui.htm comes in up Gelio Pasteli

I couldn't get your first approach to work either, but it's the second I
would be most interested in anyway. I don't bother publishing it to me web site to see if it would online, I just tested it by double clicking on the html on my local machine.

william...@gmail.com

unread,
Feb 11, 2015, 7:30:32 AM2/11/15
to
Strangely I tried with Chrome just to check-- it works with Chrome but not with firefox. I guess it is some sort of local machine security setting- can you help me please?

william...@gmail.com

unread,
Feb 11, 2015, 7:46:51 AM2/11/15
to
I found it.. it's to so with monzilla's default local machine settings
to fix:

type in path: about:config
find: security.fileuri.strict_origin_policy
set to: false

All done, thanks Ron.

Ronx

unread,
Feb 12, 2015, 3:12:06 AM2/12/15
to
william...@gmail.com wrote :
The first approach will only work on a web server - using your method of testing the font file would be looked for in A:\stylesheet\ folder, which
does not exist - hence the failure.

Preview in browser in EW4 will start the built in web server if in
Tools->Site Settings - Preview tab, you
set "Preview using website URL"
Tick "Use Microsoft Expression Development Server"
set "For all web pages"
0 new messages