0

I am designing an iOS (SpriteKit) app and have found the Skia (substitute this for any unknown font) font in the list of available fonts in the font-picker if I add an SKLabelNode to the scene. However, when I run the app in the simulator a substitute font appears.

As far as I know, this font came with Xcode. I certainly didn't buy it, although it could have come as part of another application.

Using a font like Chalkduster seems to work OK and does not require an additional work.

So I am wondering if this font requires any special actions to get it to be recognised (e.g., is it like a custom font) or is there some other issue.

Furthermore, if this isn't a standard Xcode font, could I get to get in to trouble for using it in a commercial app?

EDIT: it would be appreciated if answers could state (a) whether this font is visible in their version of Xcode and (b) whether it works.

EDIT2: OK, so a bit more research. I downloaded and installed a real (free) custom font and this now appears in the font-picker, but it is not actually rendered by my app.

So it appears that Xcode shows all fonts installed on the system, whether they are accessible by your app/target device or not. However, you can only use it by following the procedures described in the answers below. This is probably a good thing as it would stop you using accidentally using a font that you have acquired and for which perhaps you don't have the licence. But is a bit annoying that fonts you can't use are offered in the font-picker.

rghome
  • 8,529
  • 8
  • 43
  • 62
  • The Skia font does not seem to be listed on [iosfonts.com](http://www.iosfonts.com), thus I would not assume it's bundled with iOS. Might be a bug in Xcode. – Cyrille Apr 26 '15 at 13:17

3 Answers3

2

Regarding your last question, yes. If the font is not provided as part of the iOS fonts you will have to obtain its license (some are free but some are not so make sure to be on the safe side).

Check this license page for Skia

giorashc
  • 13,691
  • 3
  • 35
  • 71
  • Yes - I saw that page. But this raises the question of whether this font is part of Xcode and therefore I am probably safe in assuming I am licensed to use it, or whether it came from elsewhere, in which case I am possibly at risk. – rghome Apr 26 '15 at 14:56
  • The best way will be to contact Apple support. The site says the license is "Pay Once" so check it to be sure. – giorashc Apr 26 '15 at 15:09
2

Skia is not part of the fonts included with iOS. You can get a list of all preinstalled iOS fonts from iosfonts.com or wptechonlogy.com

You can list all installed fonts on your device by doing this:

NSArray *fontFamilies = [UIFont familyNames];

for (int i = 0; i < [fontFamilies count]; i++) {
    NSString *fontFamily = [fontFamilies objectAtIndex:i];
    NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
    NSLog (@"%@: %@", fontFamily, fontNames);
}

(source for above code)

To install a font, you can either use an app like iOS Font Maker or use code to do it yourself. The steps involved are:

  1. Include your fonts in your Xcode project.
  2. Make sure that they’re included in the target.
  3. Check that your fonts are included as Resources in your bundle.
  4. Include your iOS custom fonts in your application plist.
  5. Use UIFont and specify the name of the font.

Codewithchris.com has a step by step tutorial on how to add a custom font.

Community
  • 1
  • 1
sangony
  • 11,636
  • 4
  • 39
  • 55
  • So I am still wondering why I can see it in the Xcode font picker. Does Xcode display all O/S fonts no matter ho they are acquired? Can anyone else see this font in Xcode? – rghome Apr 26 '15 at 14:53
0

So I am still wondering why I can see it in the Xcode font picker

Xcode is running on your computer. Once you choose Custom as the Font pop-up selection for an interface object in Interface Builder (such as a UILabel or, as you have discovered, an SKLabelNode), the Family pop-up shows all the fonts on your computer.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • If you don't like this, file a bug report with Apple. – matt Apr 26 '15 at 16:44
  • Yeah - thanks. I guess I was confused because I did not recall installing any fonts myself, and because it is actually an Apple font. So I was wondering if maybe it was meant to be available. – rghome Apr 26 '15 at 16:47