BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-30-2010, 11:27 PM   #1 (permalink)
New Member
 
Join Date: Aug 2010
Model: 7100T
PIN: N/A
Carrier: at&T
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom font

Please Login to Remove!

Hi,

Is there anyway to use custom font on BlackBerry ?

I saw 1 post regarding that but unfortunately i couldnt download the attachment:
blackberryforums.com/developer-forum/100107-using-custom-fonts.html
Offline  
Old 08-31-2010, 10:29 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: 8530
PIN: N/A
Carrier: Sprint
Posts: 48
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please try this code after your font installation.

Code:
	
protected void paint(Graphics graphics) {

if (FontManager.getInstance().load("Myfont.ttf", "MyFont", FontManager.APPLICATION_FONT) == FontManager.SUCCESS) 
{
			try {
			FontFamily theFam = FontFamily.forName("MyFont");
			Font headerFont = theFam.getFont(net.rim.device.api.ui.Font.BOLD, 12);
			graphics.setFont(headerFont);

		} catch (ClassNotFoundException ex) {
			ex.printStackTrace();
		}
		graphics.drawText("Hello World",this.getPreferredWidth()- headerFont.getAdvance("Hello World"), 1);
	}
}
Offline  
Old 09-12-2010, 10:57 PM   #3 (permalink)
New Member
 
Join Date: Sep 2010
Model: 0000
PIN: N/A
Carrier: Carrier
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Is their anyway to do this on a device lower than OS 5.0? The FontManager load method is not available on OS 4.6.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

New HP Proliant DL380 Gen4/ML370 Server Intel Xeon Processor 311584-B21
$41.99
New HP Proliant DL380 Gen4/ML370 Server Intel Xeon Processor 311584-B21 pictureATCA SBC-G-TKT300-300 MPCBL0040N02Q 2Ghz Xeon
$1000.0
ATCA SBC-G-TKT300-300 MPCBL0040N02Q 2Ghz Xeon  pictureSUPERMICRO X5DA8 DUAL 3GHZ XEON MOTHERBOARD W/CPU+HSF+2GBRAM+IO SHIELD
$399.99
SUPERMICRO X5DA8 DUAL 3GHZ XEON MOTHERBOARD W/CPU+HSF+2GBRAM+IO SHIELD  pictureLOT OF 2 INTEL XEON SLACB CPU/MICROPROCESSORS E5310
$19.99
LOT OF 2 INTEL XEON SLACB CPU/MICROPROCESSORS E5310 pictureDELL PRECISION 490 WORKSTATION XEON 5160 3GHZ/8GB/QUADRO FX/XPPRO COA
$149.99
DELL PRECISION 490 WORKSTATION XEON 5160 3GHZ/8GB/QUADRO FX/XPPRO COA picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.