views:

112

answers:

3

Hi All,

How can we display text in digital format(seven segment display) on a UILabel similar to the way as text is displayed in Digital Clock.

A: 

With UILabel your best bet is a font that does what you need. Most likely you will have to implement drawing part by yourself. It will not be easy what your are asking.

bioffe
i know that its not easy.....thats y i asked here.....
Siddharth
+2  A: 

Simple approach: use a custom font.

Here's a UILabel subclass that allows you to embed custom fonts in your application: http://github.com/zynga/FontLabel

Here are a whole bunch of fonts that look like digital clocks: http://www.dafont.com/theme.php?cat=302 (be sure to read the licensing information for whatever font you choose)

Dave DeLong
thx Dave.......but i am confused how tu use it in my app.....can u explain it a level further..is there no easy way out?
Siddharth
@Siddharth the code comes with an example.
Dave DeLong
THX for the info Dave.....you are doing great work!
Siddharth
can i embed the fonts mentioned in your link into this FontLabel?
Siddharth
@Siddharth it depends on the license of the font you choose. Most of the ones are "free for personal use", which implies that if you want to use them commercially, you'd have to pay. There are many other font sites that might have more permissive licenses...
Dave DeLong
+2  A: 

For simple you can also use Apple recommended font.

label.font=[UIFont fontWithName:@"DBLCDTempBlack" size:60.0];

Please Check this to find all the font supported by iPhone.

raaz
+1 Cool! It looks like it's got characters for the digits and a couple characters, but you don't get "PM" in the seven-segment form.
Dave DeLong
hey thx Razz .....it really worked......!!can you tell me one thing that why this font is not available in IB and are there some other fonts availble like this.
Siddharth
thx Raaz for your tremendous suport.
Siddharth