Ryosuke839 / UnicodePad

An Android App that enables input every character in Unicode
https://play.google.com/store/apps/details?id=jp.ddo.hotmist.unicodepad
Apache License 2.0
314 stars 32 forks source link

[Feature Request] Display glyph alternatives #70

Closed Liggliluff closed 3 years ago

Liggliluff commented 3 years ago

When opening up a character in full; there could be an option to look at how alternative glyphs looks for the given font.

A common glyph substitution is through the locl feature, and a font like Noto Sans Regular contains 6 locl tables. Some examples are: Ą for Navajo, Ş for Romanian, Ļ for Marshallese, б for Serbian, but also other substitutions like zero, onum and more.

How it could work in the app; my idea is to have a section in the popup for alternative glyphs, where the default is the base glyph. Starting off with just locl support, the options would be a list of languages that have defined alternatives for this character (language names can be resolved through the language code; some language codes need to be substituted). Since the app displays the selected font first, then a fallback font; for the app to behave "as expected", I would say the alternative glyphs should only be based on the font the character is displayed in, so only based on the selected font if the base glyph is available in the selected font.

So the user would long press on Ą and the base glyph is shown, and the alternative glyphs selection is set to base glyph. The user can then press on this and get a list of all alternative glyphs, which in this case is likely only to be Navajo. Choosing Navajo will update the large display.

If there are no alternative glyphs in the font the glyph is displayed in, the selector should be disabled, so it's clear there are no alternatives.

Ryosuke839 commented 3 years ago

Sounds nice 🙂

However, I have a problem that I cannot know which locale is available for a specific code point only with Android standard library. Instead, it's possible to provide a Spinner to choose locale in parallel to choosing font.

I've experimentally implemented it and it looks like this:

Screenshot_1624704419 Screenshot_1624704425 Screenshot_1624704430

Liggliluff commented 3 years ago

That might be a better idea, actually. So the laguages available will be based on the selected font? Then you could see the grid update accordingly. That's smart.