-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
fix(web): fixes key-cap font scaling when very small text is required #11207
Conversation
User Test ResultsTest specification and instructions
Retesting Template
|
@@ -229,7 +229,7 @@ public void initKMKeyboard(final Context context) { | |||
|
|||
getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); | |||
getSettings().setSupportZoom(false); | |||
|
|||
getSettings().setMinimumFontSize(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could go as low as 1
(as in, 1px
), but that might become too unreadable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can we add the units (px?) in a comment?
- How come iOS doesn't need this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re point 2... good question. I guess it's a matter of the decisions by the devs of each browser? I documented my investigation and its results on the base issue.
Point 1 - sure, why not?
I do consider this to be a somewhat debatable fix. Here's what the results of TEST_IPHONE_STANDALONE look like on my personal iPhone SE 2 (via local build): I scaled the image down from its original resolution to better approximate the actual size when on the physical device. Even then, this image appears, to me, notably larger than my actual phone. We're talking about forcing some small key-caps here. |
Agreed, I feel like this is not addressing the actual problem, which is that there is too much text to fit on the key cap. So, we need to shorten the spacebar text, and encourage keyboard designers to avoid putting too much text on a key. Scaling to something unreadable doesn't really help anyone. |
For the space bar caption, isn't the language name automatically sourced? Like, from the Ethnologue or similar? If so, that part is out of keyboard designers' hands and may need its own, additional look. |
Yes, if I wasn't clear in my previous comment, I see two actions:
|
So, do we close this PR, or go ahead with its changes? I don't we should go any further than this within the OSK, but the spacebar-captioning aspect is already affecting real keyboards. As for the previously-shown screenshot... Yeah, those key-caps were only ever intended to act as extremes. We definitely shouldn't encourage use of key caps like that. The spacebar caption text? That's accomplished via the keyboard's stub, which corresponds to the keyboard and language names baked into the KMP within the mobile apps. For Huh, so we can actually edit it there... in which case a warning about "hey, that's a long language name" also becomes possible. Though... the threshold may need to vary per keyboard - Amharic doesn't exactly leave its spacebar much room. Yeah, language + keyboard name isn't going to fit well on that narrow fellow. |
I think we abandon this PR. Spacebar text length is a longstanding issue which we need to do more design work on (see also #10699). v18. |
Fixes #11203.
It turns out that mobile-device browsers like to apply a minimum to font-size specs based on relative-style font scaling. Chrome will also threshold fixed-size font scaling within WebViews unless told otherwise. This tends to make larger key caps scale improperly on the keyboard, so to get a clean render, the easiest way forward on our end is to use font-size specs that the mobile WebViews will actually listen to.
User Testing
TEST_IPHONE_APP: Using Keyman within the Keyman app on a narrow iOS phone, verify that the default display-name for Khmer Angkor does not overrun the spacebar's area.
TEST_ANDROID_APP: Using Keyman within the Keyman app on a narrow Android phone, verify that the default display-name for Khmer Angkor does not overrun the spacebar's area.
TEST_IPHONE_STANDALONE: Using KeymanWeb via the "Test page for automatic key-cap scaling" on a narrow iOS phone, verify that each key's text is properly scaled, not overrunning its key's boundaries.
g
andl
have the following key-cap text:ሴሴሴሴሴ
TEST_ANDROID_STANDALONE: Using KeymanWeb via the "Test page for automatic key-cap scaling" on a narrow Android phone, verify that each key's text is properly scaled, not overrunning its key's boundaries.
g
andl
have the following key-cap text:ሴሴሴሴሴ