希望你们都安然无事。谁能告诉我怎样才能在手机上安装或支持字体?假设手机支持乌尔都语字体,那么我设置一个这样的条件。
代码
导入java.lang.*;
String value;
String key = "microedition.font"; // not real need value it's just to show what i want
value = System.getProperty( key );
If (value == urdu){
txtArea2.getStyle.setFont(value);
} else {
System.out.println("Urdu not supported);
}/code
有没有可能做这样的事情。
谢谢。
发布于 2010-06-08 14:41:36
MIDP2.x定义了3种字号+3种样式的3种字体。
您可以使用这些值选择字体,如下面的代码所示:
Font f = Font.getFont(FACE_SYSTEM | SIZE_MEDIUM | STYLE_ITALIC);在MIDP 3.0中,您可以使用安装的字体或下载的字体指定字体名称。如下所示:
Font[] f = Font.getAvailableFonts(); // Get available fonts
Font a = Font.getFont("Andale Mono", STYLE_ITALIC, 10); // Get specific font不幸的是,现在还没有针对MIDP3的开发工具。
https://stackoverflow.com/questions/2947848
复制相似问题