I'm trying to use an embedded font referenced in a stylesheet. The only url that seems to work in the @font-face declaration (in my css file) is one that begins with the appname: /[appname]/static/[font folder]. It seems, though, like I can't generate the URL programmatically (with the URL helper) in the css file. So is there a relative address that will work?
It just occurred to me that the problem might be my use of the less.js css processing script. Could the URL helper not be working because it conflicts somehow with less.js?
I'll try these again. So far they didn't seem to work for me.
> I'm not sure, what do you want to do?, or why do you need to include app path?. But you can also make it this in the view to make use of URL() in the view or layout include the tag style simil to this:
>
> <style type="text/css">
> ...
> @font-face {
> src: url('{{=URL('static','myfont.eot')}}');
> }
> </style>
>
You can also serve CSS files as views and embed template code in them.
It resolves to http://127.0.0.1:8000/topoi/plugin_listandedit/list/notes/static/plugin_framework/fonts/websymbols-regular-webfont.woff
This is treating the font url as relative to the full request URL (including arguments), not the app root directory. That's what's confusing me.
I thought CSS files interpreted relative URLs relative to the CSS file itself, not the page in which it was loaded. If the CSS file is in /static/css and the font is in /static/plugin_framework/fonts, maybe src: url(../plugin_framework/fonts/websymbols-regular-webfont.woff) will work.