Different UIFonts in UILabel - iphone

I am trying to make an app that will let users select different fonts and rotate them around as desired.
What I need to know is what technology is being used in this app (see screenshots below)?
Is it UIKit, CATextLayer?
Are these texts / fonts available out of the box in apples UIKit module?
How can you let user resize or rotate text fonts.
Is there any sample apple project or sample code in github that I can use to look at?

All that looks like it can be done with custom fonts, none of them will be found in UIKit. You'll need to buy or find fonts that you have the rights to distribute. Here's a good reference for adding custom fonts to your project.
Once you have fonts installed. UILabel and other text holding controls can have their .font properties queried and set. And anything else you'd like to do to a view (like set up a rotational transform) is applicable to those controls, too.

Related

Rich Text View like Instagram Comment

I would like to implement rich format text views as are demonstrated in Instagram. Following is a screenshot.
Specifically, my goals are:
Words at different positions of the same text view may have different font sizes, font colors and font styles(bold, italic, etc).
Touch events (long press, touch down, etc) can be detected in the delegate callbacks. Information (which word is touched, whether it's a long press or a touch down, etc) can be gathered in such callback methods.
Big frameworks like Three20 are out of the question. Small, independent libraries are highly preferred. Low level Cocoa Touch APIs may also be OK if it won't take me more than a few days to wrap them up.
Any suggestions are highly appreciated.
NSAttributedString lets you do this. If you have access to the iOS 5 developers cookbook by Erica Sadun there is a recipe for a wrapper around NSMutableAttributedString which makes it simple to add text piece by piece, changing attributes as you go.
Here is the source on Erica's githuib
Finally found an ideal open source solution (supports both iOS 5.0 and iOS 6): the OHAttributedLabel, which is capable of both rich format and touch handling.
https://github.com/AliSoftware/OHAttributedLabel

Where are the standard looking iOS controls\styles in Delphi XE2?

We are currently in the process of evaluating Delphi XE2, and as you would expect I've started with FireMonkey as OS X and iOS development is of great interest. I've seen a couple of walkthrough's where people have created iOS apps using XE2 and I've managed to do the same, however the bread and butter of 'business applications' on an iPhone (which is how iOS support is being marketed) are buttons, lists, grids and connectivity (REST?).
Anyway, once you've created your iOS HD project the TButton initially looks green, whereas the TSpeedButton and TToolbar looks exactly like it should (blue gradient). The TToolbar doesnt have any way of adding buttons, presumably this is just a Panel, then?
Has anyone created styles for FM iOS HD apps, or do any of the wrappers allow direct creation of the standard iPhone controls?
I apologise if that sounds a little backwards given that I am attempting to evaluate using the trial version (which among other things doesnt provide the source, for obvious reasons!).
Thanks,
Ross
FireMonkey does not have standard iOS or OS X components. It draws all the components on its own, using a complicated set of layered sub-components, which are all editable with the FMX style editor in the IDE (or with a text editor outside the IDE).
So you can mimic the iOS or OS X components with the styles you get with the product or with your own custom styles. But to use the original UIKit/Cocoa Touch components, you'll have to use the FreePascal translations and conversions of the original Apple headers, and not FMX.
There is no designer for such UIs, unless you want to use Xcode 4.x. I don't know if FreePascal can load and use .xib files, though (although, why not? Probably just not automatically). You can, of course, create and place such components in code, at runtime.
So you either:
use FMX and design your own styles or modify the existing styles to your need, or
use Xcode and .xib files. Not sure how to do that with FreePascal.
FWIW, you can place any FMX component on any other FMX component (e.g. also a textbox on a button on an arcdial on a list item in a listbox), so it should be possible to place buttons on a toolbar. You probably have to take care of their alignment and arrangement, though, and probably also for their behaviour. Use a TLayout, Padding, Margins and alignment for that.

Did apple release graphics to make apps look like theirs?

I like how their email app looks so simple, with the background image with white/greyish vertical lines etc.
Is that image released or is it done programatically?
I remember there was a sample that they released that had some UI components, but I can't find it!
Most of Apple's standard UI comes default with their UIKit controls. For example, grouped table views look exactly like the ones you see in the Settings app, toolbars and navigation bars look exactly like those in Mail, text views behave like those in Notes, you get access to modal views that look and work identically to Mail and Messages, and so on.
When you open or create a nib file in Interface Builder, and drag UIKit elements to your interface, you'll see them just as Apple designed them. You'll get similar results even by creating them programmatically.
The sample code that shows off some UIKit controls is UICatalog.

ipad app skinning structure / methodology?

I'd like to offer my app users a couple of different skins to use for the app, a default black skin and then say a white skin. Maybe allow them to set fonts and / or font color site wide for headers or whatever.
What would be the best approach to do this? Obviously I don't want this to affect the speed of my application.
You basically have 3 options.
HTML5 + CSS in UIWebView
Depending on your needs, the most flexible way would be to provide part of the user interface via UIWebView as HTML5 and CSS, and let the users (or theme makers) create different CSS based styles. This is what most applications do; IM+ or Colloquy for instance.
Modifying the native controls by subclassing them
Apple might reject apps that modify the native controls and views. So that is not a secure option if you want to submit your app to the App Store.
Create your own UIView subclasses and implement their behavior
Option three would be to draw your own controls using subclasses of UIView, but that might be more work than it's worth. You find this in many games on iOS.
For storing and accessing properties like colors and other parameters that make up the user interface, I'd suggest using something simple.
In some of my apps I use a JSON file (or alternatively XML - but that's more work to parse). There is TouchJSON (github.com/schwa/TouchJSON) which does an excellent job in simply converting a file into an NSDictionary, which is easily accessible. You could, for instance, store colors and font names and sizes in such a file and read one of them at launch time.

Displaying custom fonts on the iphone

I have a game which I would like the time and score to be displayed in a custom font.
How does one display their own fonts, or would I need to write an algorithm which controls a list of number images e.g. 1, 2, 3 etc. and displays them e.g. 134
Some more info would be useful. When you are just using simple iPhone controls, like an UILabel, you can just add fonts to your project and mention them in the UIAppFonts section of your apps plist.
Otherwise I would suggest using an image map, containing all the characters you need. Cocos2D contains easy stuff for this kind of "problems".