Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
BrajeshSanodiya
Posts: 130
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel
Accepted Solution

How to use Font Family in WebWork.

Hi all

 

I want to use the different font family in webwork.

 

Please send any suggestion.


-------------------------------

  Brajesh Sanodiya 

 

 

-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: How to use Font Family in WebWork.

Hello,

 

You can change the font and styling right in the CSS of your app.  For example..

 

p {
  font-family: bold Verdana, Geneva, sans-serif;
  font-size: 19px;
  color: #f1f1f1;
}

 

This would change the styling of any paragraph text elements.  The HTML would look like this...

 

<p>This is my text</p>

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: How to use Font Family in WebWork.

Hi chadtatro,
I BB webworks, some of the Font Family is working not all.
So I want to know which Font Family are working in Webworks?

Please post the answer if any one know about the above matter. 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.
Developer
BrajeshSanodiya
Posts: 130
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

Re: How to use Font Family in WebWork.

I want to use External Font which is not available in Device. How we use it.
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: How to use Font Family in WebWork.

I see...

 

There's a thread here that has a few solutions to use external fonts in your application:

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Adding-a-custom-font-to-WebWorks...

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Regular Contributor
BertKoor
Posts: 81
Registered: ‎03-09-2012
My Device: PlayBook & Bold 9780
My Carrier: n/a

Re: How to use Font Family in WebWork.

Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: How to use Font Family in WebWork.

Hi BertKoor,
This link is helpful to us.
As you describe in the above solution.
Can we store those font in local Folder in the project and extract those from the folder??

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: How to use Font Family in WebWork.

[ Edited ]

I also worked with some truetype fonts in a customer project for PlayBook, Android + iOS and we used something like this directly in the CSS file:

 

@font-face {
	src: url(../ttf/MyFontNormal.ttf) format("truetype");
	font-weight: normal;
	font-family: MyFont;
}
@font-face {
	src: url(../ttf/MyFontBold.ttf) format("truetype");
	font-weight: bold;
	font-family: MyFont;
}

The font file is in the "/css" folder in the root of the app. Now we can use the font like this one:

 

.className {
 ...
  font-family: MyFont;
 ...
}

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: How to use Font Family in WebWork.

Thanks LBP,
This will help me to build an APS which will run the project in both Online and Offline mode.

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.