You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dirk Forchel <di...@exedio.com> on 2012/04/18 14:45:25 UTC

Using @font-face css rules

I have a problem loading my fonts defined in my css file with the @font-face
css rule which allows me to download the fonts from my server.
Initally I define the rules in my css file the following way:



The css-file is references by a CssResourceReference and contributed to the
header with a Behavior:



After loading my sample page with the Behavior, I've got the following
Exception:



Unfortunately, something with the resource mapping is wrong or does it mean,
that the file type is not supported?



The directory structure is like this:

/com/foo/wicket/behavior/css/FontFaceCssHeaderContributor.java
/com/foo/wicket/behavior/css/FontFaceCssResourceReference.java
/com/foo/wicket/behavior/css/font_face.css
/com/foo/wicket/behavior/fonts/sansation_regular-webfont.eot

Does somebody have any idea?
Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-font-face-css-rules-tp4567586p4567586.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Using @font-face css rules

Posted by Dirk Forchel <di...@exedio.com>.
Thanks. I go for the 2nd approach and it seems to be working except the
access to static packages resources with an unknown file ending. 
What did you mean with 



> The problem is that '..' escapes from the package name.
> See
> org.apache.wicket.settings.def.ResourceSettings#parentFolderPlaceholder
> Replace '..' with whatever you use for parentFolderPlaceholder
> 

The parentFolderPlaceholder String is currently set to "::". Does this mean,
if I would replace the ".." in my css file with "::" this would work as
well?

I assume I have to add some kind of pattern to the PackageResourceGuard
though. As I get the following messages now:



What is the preferred way to do this?
I assume this will solve my problem:





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-font-face-css-rules-tp4567586p4567770.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Using @font-face css rules

Posted by Martin Grigorov <mg...@apache.org>.
Another approach is to put the resources in an inner folder like

/com/foo/wicket/behavior/res/css/font_face.css
/com/foo/wicket/behavior/res/fonts/sansation_regular-webfont.eot
/com/foo/wicket/behavior/res/FontFaceCssResourceReference.java

On Wed, Apr 18, 2012 at 3:52 PM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> The problem is that '..' escapes from the package name.
> See org.apache.wicket.settings.def.ResourceSettings#parentFolderPlaceholder
> Replace '..' with whatever you use for parentFolderPlaceholder
>
> On Wed, Apr 18, 2012 at 3:45 PM, Dirk Forchel <di...@exedio.com> wrote:
>> I have a problem loading my fonts defined in my css file with the @font-face
>> css rule which allows me to download the fonts from my server.
>> Initally I define the rules in my css file the following way:
>>
>>
>>
>> The css-file is references by a CssResourceReference and contributed to the
>> header with a Behavior:
>>
>>
>>
>> After loading my sample page with the Behavior, I've got the following
>> Exception:
>>
>>
>>
>> Unfortunately, something with the resource mapping is wrong or does it mean,
>> that the file type is not supported?
>>
>>
>>
>> The directory structure is like this:
>>
>> /com/foo/wicket/behavior/css/FontFaceCssHeaderContributor.java
>> /com/foo/wicket/behavior/css/FontFaceCssResourceReference.java
>> /com/foo/wicket/behavior/css/font_face.css
>> /com/foo/wicket/behavior/fonts/sansation_regular-webfont.eot
>>
>> Does somebody have any idea?
>> Thanks
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-font-face-css-rules-tp4567586p4567586.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Using @font-face css rules

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

The problem is that '..' escapes from the package name.
See org.apache.wicket.settings.def.ResourceSettings#parentFolderPlaceholder
Replace '..' with whatever you use for parentFolderPlaceholder

On Wed, Apr 18, 2012 at 3:45 PM, Dirk Forchel <di...@exedio.com> wrote:
> I have a problem loading my fonts defined in my css file with the @font-face
> css rule which allows me to download the fonts from my server.
> Initally I define the rules in my css file the following way:
>
>
>
> The css-file is references by a CssResourceReference and contributed to the
> header with a Behavior:
>
>
>
> After loading my sample page with the Behavior, I've got the following
> Exception:
>
>
>
> Unfortunately, something with the resource mapping is wrong or does it mean,
> that the file type is not supported?
>
>
>
> The directory structure is like this:
>
> /com/foo/wicket/behavior/css/FontFaceCssHeaderContributor.java
> /com/foo/wicket/behavior/css/FontFaceCssResourceReference.java
> /com/foo/wicket/behavior/css/font_face.css
> /com/foo/wicket/behavior/fonts/sansation_regular-webfont.eot
>
> Does somebody have any idea?
> Thanks
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-font-face-css-rules-tp4567586p4567586.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org