-
Notifications
You must be signed in to change notification settings - Fork 218
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
Discuss: Plans for Android AFont font provider #608
Comments
How does this relate to #312? See also my own plans/hopes for reworked font providers in #511 (comment).
We already do this, and we are too eager to avoid system fonts; see #509. In the sense that this is incompatible with VSFilter: it always merges attached fonts with system fonts. Of course, one could argue that it’s undesirable for script portability etc., but that’s when the fabled authoring mode comes up, and we’ve generally stuck to striving for VSFilter compatibility in this respect as far as each font provider backend allows.
Agree.
Yeah, I’m thinking of U+0020 SPACE, too. It’s a very ubiquitous glyph, and even HarfBuzz uses it for rendering invisible characters by default.
(Correct me if I got that abridgement wrong.) We could load the file at the given path and read & return all fonts from it, with |
This replaces #312. It has the downside of only working on recent-ish Android, but consumers that want to support older versions can point a fontconfig .conf file at The concept I'm suggesting here seems to be more or less the same as what you described in #511, so I think we're more or less on the same page here. |
A user opened this issue: [Feature Request] Be able to get all the font in a FontFamily. If google implement it, it would resolve this problem. |
Note that Android now supports |
Just as a side note. I used FindSystemFontsFilename and it actually retrieve font not only in |
The Android NDK functions applicable to font selection are documented here: https://developer.android.com/ndk/reference/group/font
Using this API conditionally depending on the API's existence should be fairly easy using something like this:
The hard parts come from the API's limitations:
AFontMatcher_match
always returns a single font.AFontMatcher_match
requires at least 1 character.AFont
only provides a path and index.So, I think there are a few major changes that'll be needed here:
code
== 0? Maybe" "
?)This means that Provider fonts may never enter
ASS_FontProviderMetaData
, or would only enter a secondary internal list that isn't used for our internal first-pass matching.This mechanism is entirely reasonable for fallback/unstyled cases, but isn't suitable for authoring. In authoring mode (…a thing we should have), we should fall back on fontconfig, or the slow-but-cross-platform "load every font on the system" method. This probably isn't particularly relevant to Android, but we may want to transition other platforms to this new mechanism for performance and locale-handling reasons.
Any thoughts?
The text was updated successfully, but these errors were encountered: