I can't import custom fonts into my JSF pages. Project structure looks like this:
I've tried to write the following in my styles.css:
@font-face {
font-family: "Gotham Pro Bold";
src: url('#{resource["fonts/GothaProBol.otf"]}');
}
But it doesn't work. It gets compiled to /javax.faces.resource/fonts/GothaProBol.otf.xhtml
, but the font is not in javax.faces.resource
and I have no idea why it appends .xhtml
.
The following:
src: url("#{facesContext.externalContext.requestContextPath}/resources/fonts/GothaProBol.otf");
is compiled to
src: url("/resources/fonts/GothaProBol.otf");
but it doesn't work either.
How do I import the fonts properly?
Thanks in advance.