-
-
Notifications
You must be signed in to change notification settings - Fork 112
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): Increase size of spacebar text #9954
Conversation
The caption on the spacebar used to be 60%. This change increases it to 100%, but that might be sometimes too big. On the other hand, 80% still seemed to be too small. Fixes #7940.
User Test ResultsTest specification and instructions
Test Artifacts
|
I think we need to verify this across a range of keyboards and devices, because I expect that this is going to be too big for some of them. So we might need a cleverer solution, such as scaling it to fit? |
I'm not also 100% sure that this is the entire cause of the tiny font size issue. The rest of the keyboard in the #7940 shows text at a sensible size, and it's only the spacebar which is mis-scaled. But all of the text elements on the keyboard use |
Ah, you're right. It gets dynamically changed. Would have been too easy 😀. |
One reason for the sometimes small text on the spacebar besides the too small font size on `kmw-spacebar-caption` was that the calculation of the ideal font size added double padding: it added two pixels of padding to the height, but also multiplied the height value by 0.9 which effectively added more padding. This change removes the 2 pixel padding from the calculation. The existing calculation varies the text size to fit in the available width of the spacebar, so calculating with font size of 1em is reasonable and better than the previous 0.6em. The previous value would lead to even an smaller font size for long texts, far below the size that would be sufficient to fit the text.
It already does downscaling so that the text will always fit in the available size. However, this can lead to the font size becoming unreasonably small if the language/keyboard name is too long, but that's a different issue. |
I added another commit to address the underlying cause of #7940 and updated the PR description. |
Co-authored-by: Marc Durdin <[email protected]>
@bharanidharanj, note that you need to reload the page after switching to Developer mode in Chrome (press Ctrl+R or F5). Otherwise, you get the desktop on screen keyboard in a phone form factor, which we can see is what has happened in your screenshots 😁. @keymanapp-test-bot retest TEST_EMULATOR |
Thanks for the Clarification, @mcdurdin . I will retest and add my comment. |
Changes in this pull request will be available for download in Keyman version 17.0.209-alpha |
@MayuraVerma this needs to be a separate issue. |
Fixes #7940.
The caption on the spacebar used to be 60% (0.6em). This change increases it to 100%.
One reason for the sometimes small text on the spacebar described in #7940 besides the too small font size on
kmw-spacebar-caption
was that the calculation of the ideal font size added double padding: it added two pixels ofpadding to the height, but also multiplied the height value by 0.9 which effectively added more padding. This change removes the 2 pixel padding from the calculation.
Note that it is still possible for the text on the spacebar to become unreasonably small if the keyboard/language name is too long. However, that is outside of the scope of this PR.
User Testing
TEST_EMULATOR:
TEST_HARDWARE:
TEST_WEB: