0

if (FontManager.getInstance().load("gautami.ttf", "gautami", FontManager.APPLICATION_FONT) == FontManager.SUCCESS)

        {
        try{

         _fontFamily1  = FontFamily.forName("gautami");//_fontFamily1 = FontFamily.forName("aerial");
    } catch(ClassNotFoundException e) {
            _fontFamily1 = Font.getDefault().getFontFamily();
    }
     _headFont = _fontFamily1.getFont(Font.PLAIN,_size);

     super.setFont(_headFont);

}
4

1 回答 1

1

只需使用正确的标志:

        int result = FontManager.getInstance().load("mtfont.ttf", "myfont", FontManager.SYSTEM_FONT); 
        // With the APPLICATION_FONT flag, the font is not available in system options and will be removed after exiting your app. However, it will be available during this time for others app to use.

        // Wit the SYSTEM_FONT flag, the font will be available in the system options, will be stored in persistent memory and will be reloaded on each reboot.
于 2012-06-01T07:21:44.803 回答