Gaming applications for children and adults are boring without fun letters and numbers.
Strict iPhone Code did not allow a developer to iOS 3.2 standard methods to use their fonts in applications.
All escaped with pictures of numbers and letters drawn in the editor or other libraries.

What is the situation with custom fonts for developers of iPhone crafts now?
Caution! Under a habrakat 1 picture, 1
anecdote doubt and 2 code fragments.
')

How to get such a picture programmatically
1) Download your
favorite font to your minima from any resource of free ttf fonts, which are legion.
2) Run xCode, open the project, in the Resource folder, right-click to add (as existing) downloaded fonts, for example ch1.ttf. The operation is no different from adding png pictures or wav files to a project.
3) Find the file * -info.plist in the project, add the line Fonts provided by application (selected from the list) to it, in the right column opposite this line in the Item field enter the names of the files - fonts, as many as we want - for example item0 | ch1.ttf and item1 | ch2.ttf.
In principle, everything. Remember that the name of the font is inside the ttf file and does not match the file name - to view the name, double-click the file with the mouse. For example, inside my ch1.ttf file there is a font named Cheri Linea.
We insert into the code programmatically an inscription like UILabel or the UIButton button, set the font with the following function
[mylabel setFont: [UIFont fontWithName:@"Cheri Linea" size:20]];
Hurray!
We get a beautiful inscription, a million races and buy Papa Carlo a thousand new jackets.
Cons of this approach
Minus 1. Does not work on iPhone with iOs <3.2
Treated using the framework’s GraphicsServices as follows
BOOL GSFontAddFromFile(const char * path);
NSUInteger loadFonts()
{
NSUInteger newFontCount = 0;
for (NSString *fontFile in [[NSBundle mainBundle] pathsForResourcesOfType:@"ttf" inDirectory:nil])
newFontCount += GSFontAddFromFile([fontFile UTF8String]);
return newFontCount;
}
Minus 2. Fonts do not work with Interface Builder
Treated by spawning a new class
// LabelMyFont.h
#import <uikit /UIKit.h>
@interface LabelMyFont : UILabel {
}
@end
// LabelMyFont.m
#import "LabelMyFont.h"
@implementation LabelMyFont
- (id)initWithCoder:(NSCoder *)decoder {
if (self = [super initWithCoder: decoder]) {
[self setFont: [UIFont fontWithName: @"Cheri Linea" size: self.font.pointSize]];
}
return self;
}
@end
Minus 3. It is impossible to harness in one harness English, Chinese and Russian fonts
Unfortunately, among the free fonts there is no font that equally beautifully draws the names of Chinese, Russian and other players.
Treated with money? Fonts can be bought or ordered? I do not know the answer.
I will be happy to hear useful tips and comments from the developers.
I press the button PUBLISH with caution - for a similar previous post I was banned for a year.