System fonts file access: allowed for sandboxed apps?

Hello! I am developing an ebook reader iOS app that uses c/c++ codec as a page renderer.

The codec uses TrueType as a font rendering engine that requires access to .ttf (or .ttc) files.

Currently, I supply TrueType with fonts embedded in the app package, so they lay within the app sandbox.

The codec supports the whole unicode plane and many languages that ebooks may use, but the fonts I supply don't have some of the important glyphs (i.e. katakana or hangul).

I see that iOS has its own font storage, located in /System/Library/Fonts/ directory. The codec is able to parse this directory and read .ttf files located inside, using these fonts as a fallback in the case when the supplied fonts can't draw certain glyphs.

I use opendir and fopen(in "rb" mode) as a way to read the data, and it works well.

Does this type of access to the system directory violate the sandbox rule for an app distribution, and, if yes, is there a way to get access to stored .ttf files not violating the mentioned rule?

You should really not use this solution to load fonts in your app. For example if Apple ever changes the font names your app will break. Or if they change permissions on these folders/files so they are no longer readable. Instead use approved Apple APIs to load installed fonts. For example:

UIFont.init?(name fontName: String, size fontSize: CGFloat)

You can also check for how to install a custom font in your app:

Adding a Custom Font to Your App

System fonts file access: allowed for sandboxed apps?
 
 
Q