Skip to content

Instantly share code, notes, and snippets.

@icfantv
Last active April 20, 2018 13:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icfantv/4718228 to your computer and use it in GitHub Desktop.
Save icfantv/4718228 to your computer and use it in GitHub Desktop.
font resource
@url font1Url font1;
@font-face
{
font-family: MyFont1;
src: font1Url format('opentype');
font-weight: normal;
font-style: normal;
}
@url font2Url font2;
@font-face
{
font-family: MyFont2;
src: font2Url format('opentype');
font-weight: normal;
font-style: normal;
}
@url font3Url font3;
@font-face
{
font-family: MyFont3;
src: font3Url format('opentype');
font-weight: normal;
font-style: normal;
}
public interface FontResource extends ClientBundle
{
FontResource INSTANCE = GWT.create(FontResource.class);
@Source("font1.otf")
DataResource font1();
@Source("font2.otf")
DataResource font2();
@Source("font3.otf")
DataResource font3();
@Source("font.css")
CssResource css();
}
/* FontResource.java and font.css will generate something similar to the following CSS */
@font-face
{
font-family:MyFont1;
src:url(http://10.10.10.10:8081/gwt_app/5F80AF6F2BD333983585159DE2E158E0.cache.otf) format(opentype);
font-weight:normal;
font-style:normal;
}
@font-face
{
font-family:MyFont2;
src:url(http://10.10.10.10:8081/gwt_app/A32759B935A5B8A190AF4C10889BFFD4.cache.otf) format(opentype);
font-weight:normal;
font-style:normal;
}
@font-face
{
font-family:MyFont3;
src:url(http://10.10.10.10:8081/gwt_app/EA810D510EC77E10ACB62B3EDC81A216.cache.otf) format(opentype);
font-weight:normal;
font-style:normal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment