Cannot apply some font as custom font on xcode 4.2 for develop iOS 5 application
Asked Answered
M

4

7

Since I installed Xcode 4.2 in order to test iOS 5. I got the following warning after compile the project.

"Using the font Arial - Black in version of Xcode prior to 4.2 may have unexpected results."

And also I could not change the font because it will be crashed when I press the font menu.

Any suggestion?

Thanks.

Mccarty answered 2/8, 2011 at 7:17 Comment(2)
hey @Kimkind, did you find any solution to that? I am facing same problem too :(Bismuthous
i think the solution might be the one suggested by @brett-hamlin. Or at least it works fine for me (no more warnings).Collotype
E
18

In IB, click on the File Inspector (first icon in the Utility View) and under "Document Version" change the Development value to 4.2 (or greater).

Essayist answered 18/11, 2011 at 10:26 Comment(1)
This is exactly the correct answer. Bonus: If you select multiple nib files you can change the setting on all of them at the same time.Lightproof
B
3

I had same problem, but I changed the Font of the control from interface builder to "system". Then I programmatically set the font, I wanted to display, using setFont method. Its working fine for me. I hope it should work for you too.

Bismuthous answered 27/9, 2011 at 18:49 Comment(5)
Is it then not possible via IB at all?Chrotoem
Yes, practically and officially we can use IB for custom fonts. Acc to Apple, "Applications that want to use custom fonts can now include those fonts in their application bundle and register those fonts with the system by including the UIAppFonts key in their Info.plist file. The value of this key is an array of strings identifying the font files in the application’s bundle. When the system sees the key, it loads the specified fonts and makes them available to the application." for more info, check this thread: devforums.apple.com/thread/37824Bismuthous
We have done the same. But we are still getting the warning as mentioned ""Using the font Arial - Black in version of Xcode prior to 4.2 may have unexpected results." and the font starts to look smaller. So, is there no way of getting this to work via IB instead of using setFont?Chrotoem
@Hetal Vora: In latest versions of iOS, there is no more font named "Arial - Black". This is the reason, you are getting the warning. You have to use the fonts from the available fonts, or if you want to use some other fonts(which are not in the iOS font list), then just add(or drag and drop) the font file into you project. IB will automatically pick up the newly added font. For list of available fonts in iOS, please refer to ajnaware.wordpress.com/2008/10/24/… or iphonedevelopertips.com/design/available-fonts-on-iphone.htmlBismuthous
I added the font "myriad pro" and i´m using it programmatically using "setFont" because i can´t find it in IB. Are you sure that the font automatically appears in IB?Merideth
M
0

I had the same problem, but with MyriadPro-Bold. In Interface Builder, I selected the font and chose "System" like iHS said, and then the font was back to the way it looked in previous versions of XCode

Monosymmetric answered 12/11, 2011 at 20:41 Comment(0)
C
0

Add the .otf file. Then the font will show.

Cufic answered 22/11, 2014 at 2:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.