【问题标题】:How to use Telugu font in blackberry application如何在黑莓应用程序中使用泰卢固语字体
【发布时间】:2012-06-07 13:42:03
【问题描述】:

作为黑莓/Java 开发的新手,我不知道如何在我的黑莓应用程序中使用 "telugu" 字体。请举个例子。

查看三个模拟器之间的区别 9300-OS6 不显示 9790-os7 仅在此设备中显示。 9900-os7 甚至 OS7 都不显示。

【问题讨论】:

    标签: blackberry fonts blackberry-eclipse-plugin truetype


    【解决方案1】:
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.*; 
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.component.*;
    import java.util.*;
    
    public class FontLoadingDemo extends UiApplication
    {
        public static void main(String[] args)
        {
            FontLoadingDemo app = new FontLoadingDemo();
            app.enterEventDispatcher();
        }
    
        public FontLoadingDemo()
        {
            pushScreen(new FontLoadingDemoScreen());
        }
    }
    
    class FontLoadingDemoScreen extends MainScreen
    {   
        public FontLoadingDemoScreen()
        {
            setTitle("Font Loading Demo");
    
            LabelField helloWorld = new LabelField("Hello World");
    
            if (FontManager.getInstance().load("Myfont.ttf", "MyFont", FontManager.APPLICATION_FONT) == FontManager.SUCCESS) 
            {
                try 
                {
                    FontFamily typeface = FontFamily.forName("MyFont");
                    Font myFont = typeface.getFont(Font.PLAIN, 50);
                    helloWorld.setFont(myFont); 
                }
                catch (ClassNotFoundException e) 
                {
                    System.out.println(e.getMessage());
                }
            }
            add(helloWorld);
        }
    }
    

    来源:http://docs.blackberry.com/en/developers/deliverables/11958/Load_and_use_a_custom_font_899948_11.jsp

    【讨论】:

    • 我尝试通过将 Myfont.ttf 替换为 SHREE940.ttf 来尝试这个......
    • 能否详细解释一下您目前的状态?或者你的意思是这解决了这个问题?如果解决了,请将其推上并标记为解决方案,如果不给我更多详细信息,以便我可以帮助你....你所说的“盒子”是什么意思?
    • 是的,我更改了我的 SDK 和字体.....然后我的模拟器显示了 TELUGU(gouthami.ttf) 字体。但它仅在其他模拟器中的 9790 模拟器中显示相同的先前问题
    • 当我在我的项目中放置相同的代码时,即使在 9790 中它也不显示泰卢固语字体。
    • 9790 OS 是 7 我的应用程序只能在这个设备上运行......但在相同操作系统的其他设备上,比如 9900 和其他它不工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-18
    • 1970-01-01
    • 1970-01-01
    • 2017-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多