Open sffc opened 6 years ago
@sffc what would be a result of getDefaultBurmeseFontEncoding() call for a system which doesn't have Burmese fonts installed? Also, I'd like to clarify intended use case for getAvailableBurmeseFonts(). Will it be used to populate fallback fonts in an app?
@sffc what would be a result of getDefaultBurmeseFontEncoding() call for a system which doesn't have Burmese fonts installed?
Good question. What do you think good behavior would be? I could see arguments for either returning UNICODE or for returning a new enum value like NOT_AVAILABLE.
Also, I'd like to clarify intended use case for getAvailableBurmeseFonts(). Will it be used to populate fallback fonts in an app?
I was thinking it would be used to return which system fonts are available for an app to use. I am not an expert on how font fallback works in Android, though. @mihnita should have more information on this.
Good question. What do you think good behavior would be? I could see arguments for either returning UNICODE or for returning a new enum value like NOT_AVAILABLE.
Agree, there are arguments for both. I have a slight preference to own dedicated NOT_AVAILABLE or UNKNOWN value. Mainly because it can enable developers to trigger any additional logic to handle these cases, or communicate it more explicitly to a user.
I am wondering if we want to keep the "font" in the API names. It only makes them look verbose.
APIs that I can think of:
Might be really nice to have some "magic incantation" that on can call at application startup and would make it work without major changes. And / or APIs that do the conversion "on the fly" when set / get text in widgets.
Also we learned recently about a hybrid font ZawDecode (http://aungthurhahein.github.io/ZawDecode/), which is based on Unicode standard, but can render Zawgyi too (85% accuracy is claimed). With a proposed classification, I think it's acceptable to treat it as a Unicode one.
There are at least four questions that would be useful to have a library solution to solve for the Android ecosystem:
@mihnita says that any implementation of these features would need to be Android-specific and would probably not work outside of an Android environment. Therefore, this could be implemented by a sub-library within Myanmar Tools, distributed under its own artefact ID.
Ideas for APIs that such a library could provide:
The implementation of this library would need to be based on heuristics from the Android ecosystem.