Does Blackberry able to show Hindi text in components.
Can I retrieve Hindi content from sql lite database and show in Blackberry Screen?
Without installing Desktop software can't w show Hindi text in Blackberry.
I don't know if it will work always but Yes you can.This is what i did, first of all you will have to have the font file in the project folder and then in your code apply font to the field that displays the text as follows
FontManager.getInstance().load("hindifont.TTF", "MyFont", FontManager.APPLICATION_FONT) ;
{
try
{
FontFamily typeface = FontFamily.forName("MyFont");
Font myFont = typeface.getFont(Font.PLAIN, 19);
yourfield.setFont(myFont);
add(yourfield);
}
catch (ClassNotFoundException ex)
{
ex.printStackTrace();
}
}
you can also retrieve from sqlite db if it has a supporting text.
Related
I am using PDFKit to manipulate an existing PDF in an iOS mobile app. I can loop through all the annotations in a PDF, but I also want to set all textfields to have caps lock on by default. So that when the user selects the text field they are able to start typing in all caps by default.
Here's part of the code:
func setAnnotationValues(_ annotations: [PDFAnnotation]){
for annotation in annotations {
annotation.font = UIFont(name: "ArialMT", size: 8)
if(annotation.widgetFieldType == .text) {
//Want to do something here to set the text to be all caps
}
}
}
Is there a way to set bold text using ObjectSetText() function in MQL4.
Should a font name be for example "Arial Bold" or can I set a path to the font .ttf-file?
If a path option is possible, is that path relative or absolute?
ObjectSetText() uses O/S-registered fonts & only limited controls
as one may test on GUI panels, MQL4 operations do not have full type-setting font-manipulation controls available via code
( this is all about trading, isn't it? )
Check what fonts are available from your O/S:
( or from used Docker/WINE thin-wrapper container )
So in MQL4 code there will thus simply be a string-typed or #define-ed literal specification of the font name and one may additionally set aFontSIZE + aFontCOLOUR attribute(s)
#define clrSignalLABEL clrAqua // LITERAL-way
#define iLabelFontSIZE 24
string signalTextFONT 'Times New Roman'; // STRING-way
input bool Font_Bold = true;
string FB;
int init()
{
if(Font_Bold == true)
{
FB = "Arial Bold";
}
else
{
FB = "Arial";
}
}
ObjectSetText("name", Text, FontSize, FB, FontColor);
I am new to BB application. I want customized the size for the button text and label text.
I am using this code
try {
FontFamily alphaSansFamily = FontFamily.forName("BBAlpha Serif");
Font appFont = alphaSansFamily.getFont(Font.PLAIN, 9, Ui.UNITS_pt);
setFont(appFont);
} catch (ClassNotFoundException e) {
}
but using this it will change size for what all the field we are using within the constructor.But I need different size for different field .Like Title will be big size and other label text button text will be small size.
I am guessing that you are calling that when you are creating the screen so the setFont() changes the font for the full screen.
You can call set font on the required button or label and it will change the font only for that field
e.g button.setFont(yourFont)
Are you calling setFont() explicitly on the Field you wish to change?
just in the above try block donot declere the statement setFont(appFont), this sets the font of the whole screen.
Insead set the font by specifying which label or button you want to set the font like
LabelField lf1 = new LabelField("Testing");
lf1.setFont(appFont);
Again
ObjectChoiceField ocf1 = new ObjectChoiceField("","","");
ocf1.setFont(appFont);
Hi friends I am using LabelFields to display text message in a screen i want different fonts each LabelField but when i am using api fonts of blackberry using
FontFamily fontFamily[] = FontFamily.getFontFamilies();
Font font2 = fontFamily[0].getFont(FontFamily.SFF4_FONT,18);
is showing bold style how to use different font styles plz help me
try this
FontFamily alphaSerifFamily = FontFamily.forName("BBAlpha Serif");
Font appFont = alphaSerifFamily.getFont(Font.PLAIN,7,Ui.UNITS_pt);
LabelField lb = new LabelField("Test");
lb.setFont(appFont);
I don't know how to apply font style to a text in a LabelField in Blackberry.
You can just use LabelField.setFont. If you don't do this explicitly on the label field, the field will use whatever font is used by its manager (and so on upward up the hierarchy).
There are a couple of ways to get a font. One is to derive one from an existing font (in this case I'm getting a bold version of the default font):
LabelField labelField = new LabelField("Hello World");
Font myFont = Font.getDefault().derive(Font.BOLD, 9, Ui.UNITS_pt);
labelField.setFont(myFont);
The other is to get a specific font family and derive a font from that (here getting a 12 pt italic font):
LabelField labelField = new LabelField("Hello World");
FontFamily fontFamily = FontFamily.forName("BBCasual");
Font myFont = fontFamily.derive(Font.ITALIC, 12, Ui.UNITS_pt);
labelField.setFont(myFont);
A couple of things to note: I used UNITS_pt (points) instead of UNITS_px (pixels). This is a good idea generally since BlackBerry devices vary quite a bit in screen size and resolution (DPI) and using points will give you a more consistent look across devices, instead of having your text look tiny on a Bold or 8900 (or huge on a Curve or Pearl).
Also in the second example, forName can throw a ClassCastException which you have to catch (it's a checked exception) but is never actually thrown according to the Javadocs, if you specify an unknown name, it'll fall back to another font family.
Here's a post which has a ResponseLabelField that extends LabelField and shows how to set the font:
http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=37988
Here's a quick code snippet for you:
LabelField displayLabel = new LabelField("Test", LabelField.FOCUSABLE)
{
protected void paintBackground(net.rim.device.api.ui.Graphics g)
{
g.clear();
g.getColor();
g.setColor(Color.CYAN);
g.fillRect(0, 0, Display.getWidth(), Display.getHeight());
g.setColor(Color.BLUE);
}
};
FontFamily fontFamily[] = FontFamily.getFontFamilies();
Font font = fontFamily[1].getFont(FontFamily.CBTF_FONT, 8);
displayLabel.setFont(font);
Someone correct me if I'm wrong, but I believe different fonts are chosen by using a different index into the fontFamily array.
EDIT: And here's a test app you can use to switch between fonts: http://blackberry-digger.blogspot.com/2009/04/how-to-change-fonts-in-blackberry.html