Eric
Eric

Reputation: 51

Getting .ttf for system font in iOS

Can I access .ttf file of iOS' system font, like Helvetica? I'm creating a game and I have OpenGL text rendering (using stb_truetype), I don't want to bundle 20 MB font file to support all possible Unicode chars.

Upvotes: 4

Views: 1784

Answers (2)

domkck
domkck

Reputation: 1156

I think that is not possible as iOS application are sandboxed and you cannot access files outside your application. I'm afraid you will have to add the file to the bundle directly.

Upvotes: 0

lxt
lxt

Reputation: 31304

I don't believe this is possible (...to access the TTF files itself). You can access the UIKit representation through UIFont, but not the raw TTF.

This is because applications on iOS are sandboxed - you have no access to files outside your application's directory by design (unless you're jailbroken). The system simply will deny your request, even if you knew the path.

Upvotes: 1

Related Questions