Created
February 28, 2016 10:10
-
-
Save codenameone/da3912b9ccef03f58058 to your computer and use it in GitHub Desktop.
Usage of the FontImage class that allows integrating icon fonts into Codename One
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Icon Font"); | |
Font materialFont = FontImage.getMaterialDesignFont(); | |
int size = Display.getInstance().convertToPixels(6, true); | |
materialFont = materialFont.derive(size, Font.STYLE_PLAIN); | |
Button myButton = new Button("Save"); | |
myButton.setIcon(FontImage.create("\uE161", myButton.getUnselectedStyle(), materialFont)); | |
hi.add(myButton); | |
hi.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample usage of FontImage.
From the Codename One project