. ....">

@ font-face in GWT

I tried to use the following code with GWT 2.2.0:

//in my UiBinderFile
<ui:style field="myStyle" src="MyCssFile.css"/>
.
.
<g:Label ui:field="aboutMainHeader" styleName="{myStyle.decorFont}"></g:Label>

as well as in MyCssFile.css in the same directory as UiBInder xml,

//entire MyCssFile.css
@font-face {
    font-family: cool_font;
    src: url('cool_font.ttf');
}
.decorFont{
    font-family: cool_font; /* no .ttf */
}

When I try to compile this, I get some NPE in the UiBinder parser, a correctly scam method call that parses the font. I do not know what is wrong. Has anyone tried fonts with GWT and could you please send a working example?

Thank...

+3
source share
2 answers

See http://code.google.com/p/google-web-toolkit/issues/detail?id=5247

You need to place an ad @font-facein an external (not- CssResource) style sheet (can be included in your HTML HTML page).

+5
source

- . GWT clientbundle. -, , .

http://code.google.com/p/gwt-webfonts/

+2

All Articles