Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-03-2011, 01:19 AM   #1 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 249
gabacus is on a distinguished road
Default Shrinking Font...

Hi guys,

I am trying to find a way to make my font shrink from large to small in a wedge type shape. For example:

Thisfontisshrinking

The text would be aligned through the horizontal centres of the text though.

My first thought was to create a UILabel in the standard way and then distort the frame. There is no simple way of doing that though (that I know of anyway...)

Any ideas on how I can achieve that effect?
__________________
-- Website --
SpartanApps

-- Current Apps --
Musicopoulos
gabacus is offline   Reply With Quote
Old 12-03-2011, 01:23 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

You could create the content as HTML and display it in a UIWebView, but that might not do or behave the way you want and might be rough to implement if you want to show a lot of text in different places. You could use Core Text to draw it yourself but the implementation is not as simple. It's a lower level API, in C, part of Core Foundation.

What exactly are you doing with the text, where are you displaying it, for what etc.
baja_yu is offline   Reply With Quote
Old 12-03-2011, 01:32 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 249
gabacus is on a distinguished road
Default

I am creating labels for a pie chart. The text would be larger towards the edge and smaller towards the centre.

Using a UIWebView would be messy, but it may work. Writing the code to spit out the HTML wouldn't be too bad...

Maybe I will have a look at core text, but yeah, I was hoping for a simpler option.
__________________
-- Website --
SpartanApps

-- Current Apps --
Musicopoulos
gabacus is offline   Reply With Quote
Old 12-03-2011, 07:21 AM   #4 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,004
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by gabacus View Post
I am creating labels for a pie chart. The text would be larger towards the edge and smaller towards the centre.

Using a UIWebView would be messy, but it may work. Writing the code to spit out the HTML wouldn't be too bad...

Maybe I will have a look at core text, but yeah, I was hoping for a simpler option.
Nope, there is no simple solution. Apple needs to add support for styled text to their frameworks. It's fairly easy to do on the Mac using NSAttributedText.

Maybe some enterprising person or people could write a styled text view using Core Text and post it on GitHub under the MIT license or similar. It would be quite a bit of work though.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is online now   Reply With Quote
Old 12-03-2011, 12:13 PM   #5 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

I'm not familiar with NSAttributedText, is this what you were talking about as a port?: https://github.com/mattt/TTTAttributedLabel
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 12-03-2011, 03:50 PM   #6 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Seattle, WA
Posts: 408
RickSDK is on a distinguished road
Default

you would probably need to create a seperate uilabel for each letter which wouldn't be too hard to do.
__________________
Check out my apps

RickSDK is offline   Reply With Quote
Old 12-03-2011, 05:55 PM   #7 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 249
gabacus is on a distinguished road
Default

Quote:
Originally Posted by RickSDK View Post
you would probably need to create a seperate uilabel for each letter which wouldn't be too hard to do.
Yep, this is the solution I am currently going for. Stack labels for each letter side by side. Simple enough to do, but it would be nice if there was a more elegant solution.
__________________
-- Website --
SpartanApps

-- Current Apps --
Musicopoulos
gabacus is offline   Reply With Quote
Old 12-03-2011, 07:12 PM   #8 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,004
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Domele View Post
I'm not familiar with NSAttributedText, is this what you were talking about as a port?: https://github.com/mattt/TTTAttributedLabel
Sorry, NSAttributedString. My mistake.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is online now   Reply With Quote
Old 12-03-2011, 07:42 PM   #9 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

It seems that label is what he is looking for then:
Quote:
TTTAttributedLabel was created to be a drop-in replacement for UILabel, that provided a simple API to styling text with NSAttributedString while remaining performant.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

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



» Advertisements
» Online Users: 405
15 members and 390 guests
7twenty7, AppsBlogger, Clouds, David-T, Duncan C, e2applets, EvilElf, HemiMG, heshiming, iekei, LunarMoon, Murphy, sacha1996, Sami Gh, teebee74
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,914
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0