10-03-2010 12:42 PM
I have been stuck something very basic but i dont what is causing this problem.
above screenshot is what i want to achieve has anyone added custom fonts to their application
Solved! Go to Solution.
10-03-2010 02:05 PM
What kind of problem are you having? You can certainly set the font for a particular field. You can also use FontManager.setApplicationFont (or Font.setDefaultFont in the pre-5.0 api) to change all fields in your application.
10-04-2010 12:43 AM
1. Use FontFamily.getFontFamilies() to get all font families and populate an ObjectChoiceField
2. Once font family is selected, use FontFamily.forName(fontFamilyName) to get font family.
3. Use NumericChoiceField to choose font size.
4. Use fontFamily.getFont(int style, int height) to get the font.
5. Use field.setFont(font) to set font in the field.
6. Use updateLayout() (I don't believe invalidate() is sufficient in this case) to refresh the screen.
7. Once the user presses OK, heed Ted_Hopp's advice and set that font as the default for your application.
10-04-2010 08:33 AM
One small question...
I want to set two fonts on my application
one iam doing usign the field.setFont
and other setDefaultFont will setdefault font over write the effect of field.setFont
10-04-2010 11:34 AM
No. The default font is used only when no font has been specified using Field.setFont. When you set a (non-null) font using Field.setFont, the default font is ignored, even if the default font is later changed.