Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created February 28, 2016 09:53
Show Gist options
  • Save codenameone/9c881350e1d142081aba to your computer and use it in GitHub Desktop.
Save codenameone/9c881350e1d142081aba to your computer and use it in GitHub Desktop.
Usage of the FontImage class that allows integrating icon fonts into Codename One
Form hi = new Form("Icon Font");
Font materialFont = FontImage.getMaterialDesignFont();
int w = Display.getInstance().getDisplayWidth();
FontImage fntImage = FontImage.createFixed("\uE161", materialFont, 0xff0000, w, w);
hi.add(fntImage);
hi.show();
@codenameone
Copy link
Author

Sample usage of FontImage.

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment