Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support iOS #77

Open
maun opened this issue Jan 5, 2025 · 4 comments
Open

Support iOS #77

maun opened this issue Jan 5, 2025 · 4 comments

Comments

@maun
Copy link

maun commented Jan 5, 2025

I would like to use a ui toolkit which uses this crate on iOS (floem, cosmic-text).
Since the System directory with the fonts cannot be accessed on iOS i think CoreText must be used.
The available fonts can be listed with this method.

Is this in scope for this library?

@notgull
Copy link
Contributor

notgull commented Jan 5, 2025

I think this is out of scope. If the directory with fonts can't be accessed, there is no way for the TTF files to be loaded and therefore no way to query font info with fontdb's current architecture.

@Kees-van-Beilen
Copy link

Kees-van-Beilen commented Jan 9, 2025

fonts can be accessed on ios from the following paths:
/System/Library/Fonts/
/System/Library/Fonts/Cache
even in a sandboxed app

you can also read /System/Library/Fonts/CGFontCache.plist to get a list of fonts, but scanning the directory works also

@maun
Copy link
Author

maun commented Jan 11, 2025

fonts can be accessed on ios from the following paths: /System/Library/Fonts/ /System/Library/Fonts/Cache even in a sandboxed app

you can also read /System/Library/Fonts/CGFontCache.plist to get a list of fonts, but scanning the directory works also

While it might be possible, afaik it is against the „rules“ and would prevent publishing in the app store SO question

Fontique, which also provides font enumeration and fallback, does use CoreText: implementation

@Kees-van-Beilen
Copy link

No it isn't against the rules and many apps use it:

2.5.2  Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps. Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the app completely viewable and editable by the user.

The application container provides a symlink to /System/Library/, thus it is allowed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants