1

This is how I refer my css file in my index.xhtml:

<h:outputStylesheet library="css" name="vendors/fontello.css" /> 

And that's how I'm using #resources, which works fine:

background-image: url("#{resource['img:lang/ico-en.gif']}"); 

This way is how it's working in a HTML project:

@font-face { font-family: 'fontello'; src: url('../font/fontello69db.eot?24671060'); src: url('../font/fontello69db.eot?24671060#iefix') format('embedded-opentype'), url('../font/fontello69db.woff?24671060') format('woff'), url('../font/fontello69db.ttf?24671060') format('truetype'), url('../font/fontello69db.svg?24671060#fontello') format('svg'); font-weight: normal; font-style: normal; } /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ /* @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'fontello'; src: url('../font/fontello.svg?24671060#fontello') format('svg'); } } */ 

Then as I'm moving the HTML project into JSF 2 project I would like to use #resources, right ? So I did the same thing as before but doesn't work:

@font-face { font-family: 'fontello'; src: url("#{resource[css:font/fontello69db.eot?24671060']}"); /* src: url("#{resource[css:font/fontello69db.eot?24671060');*/ src: url("#{resource[css:font/fontello69db.eot?24671060#iefix']}") format('embedded-opentype'), url("#{resource[css:font/fontello69db.woff?24671060']}") format('woff'), url("#{resource[css:font/fontello69db.ttf?24671060']}") format('truetype'), url("#{resource[css:font/fontello69db.svg?24671060#fontello']}") format('svg'); font-weight: normal; font-style: normal; } /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ /* @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'fontello'; src: url("#{resource[css:font/fontello.svg?24671060#fontello']}") format('svg'); } } */ 

And this is my project structure:

project

Any idea how to use #resource correctly in this case ?

1 Answer 1

2

remove url parameters from font file names. try that.

@font-face { font-family: 'fontello'; src: url("#{resource[css:font/fontello69db.eot']}?24671060"); src: url("#{resource[css:font/fontello69db.eot']}?24671060#iefix") format('embedded-opentype'), url("#{resource[css:font/fontello69db.woff']}?24671060") format('woff'), url("#{resource[css:font/fontello69db.ttf']}?24671060") format('truetype'), url("#{resource[css:font/fontello69db.svg']}?24671060#fontello") format('svg'); font-weight: normal; font-style: normal; } 
Sign up to request clarification or add additional context in comments.

2 Comments

For some reason the fontello.css it's not loaded anymore with this approach. But it's without it.
It works my friend! I combine your adive with this other topic and it's working now! Thank you! stackoverflow.com/questions/13567714/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.