Codenameone 非常小的材料字体

Codenameone 非常小的材料字体,codenameone,Codenameone,我试图在标题命令中使用材质图标字体,而不在FontImage中转换它们,但我只能获得很少的字符 Style s = UIManager.getInstance().getComponentStyle("TitleCommand"); s.setFont(FontImage.getMaterialDesignFont().derive(s.getFont().getHeight(), Font.STYLE_PLAIN)); UIManager.getInst

我试图在标题命令中使用材质图标字体,而不在FontImage中转换它们,但我只能获得很少的字符

    Style s = UIManager.getInstance().getComponentStyle("TitleCommand");
    s.setFont(FontImage.getMaterialDesignFont().derive(s.getFont().getHeight(),
Font.STYLE_PLAIN));
            UIManager.getInstance().setComponentStyle("TitleCommand", s);

这应该可以让我在一个命令中拥有多个图标,但我得到的字符/字形非常小(在iphone3模拟器上,它们被缩放到一个像素!)


怎么了?

这段代码对我很有用:

Toolbar.setGlobalToolbar(true);
Style s = UIManager.getInstance().getComponentStyle("TitleCommand");
s.setFont(FontImage.getMaterialDesignFont().derive(s.getFont().getHeight(), Font.STYLE_PLAIN));
UIManager.getInstance().setComponentStyle("TitleCommand", s);
Form hi = new Form("Test");

hi.getToolbar().addCommandToRightBar("" + FontImage.MATERIAL_3D_ROTATION, null, e -> Log.p("Invoked"));

hi.show();
要制作此文件:


我通常使用更传统的方法创建毫米大小的图标,但这应该可以工作。

这段代码对我很有用:

Toolbar.setGlobalToolbar(true);
Style s = UIManager.getInstance().getComponentStyle("TitleCommand");
s.setFont(FontImage.getMaterialDesignFont().derive(s.getFont().getHeight(), Font.STYLE_PLAIN));
UIManager.getInstance().setComponentStyle("TitleCommand", s);
Form hi = new Form("Test");

hi.getToolbar().addCommandToRightBar("" + FontImage.MATERIAL_3D_ROTATION, null, e -> Log.p("Invoked"));

hi.show();
要制作此文件:

我通常使用一种更传统的方法创建一个毫米大小的图标,但这应该可以用。

真是太可惜了!我将“tool.findCommandComponent(back).getAllStyles().setFont(FontImage.getMaterialDesignFont());”留在构造函数底部,它总是重置字体大小。对不起,耽误了你的时间……真丢脸!我将“tool.findCommandComponent(back).getAllStyles().setFont(FontImage.getMaterialDesignFont());”留在构造函数底部,它总是重置字体大小。很抱歉占用你的时间。。。