keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
368 stars 102 forks source link

fix(windows): check font count display none found #11282

Closed rc-swag closed 1 week ago

rc-swag commented 2 weeks ago

Fixes: #10933 This change is to check the number of fonts found for the keyboard to guard against trying to index it when there are no fonts.

  1. In the procedure FormatGrid check the font count if it is zero exit straight away.
          for i := 0 to grid.RowCount - 1 do
                 m := System.Math.Max(m, Canvas.TextWidth(FSelectedKeyboard.Fonts[i].FontName) + 6)
  1. Update the procedure DisplayKeyboardFonts to let the user know that no fonts were found as a suggestion.

Note: This line in DisplayKeyboardFonts

grid.RowCount := FKeyboard.Fonts.Count;

grid.RowCount cannot be less than 1. Therefore if font count is 0 the row count value will be 1 after this assignment.

User Testing

TEST_KEYBOARD_WITH_FONTS

  1. Install Keyman for Windows build artifact
  2. Using Keyman Configuration install Simplified Chinese, Tamil 99 Basic, and Ahom Star keyboards
  3. Start Keyman
  4. From the language selector in the taskbar menu select Tamil_99
  5. Right-click on the keyman icon to bring up the context menu and select the "Font Helper"
  6. It should load some suggested fonts with the characters in a grid display
  7. Exit the Font helper

TEST_KEYBOARD_WITHOUT_FONTS

  1. Now select the cs_pinyin keyboard from the language selector in the taskbar menu
  2. Right-click on the keyman icon to bring up the context menu and select the "Font Helper"
  3. It should display the following message in the font helper window No fonts have been found as suggestions for Keyboard %1$s.

TEST_KEYBOARD_FONT_HELPER_SELECT_KEYBOARDS

  1. From the language selector in the taskbar menu select a non keyman keyboard
  2. Right-click on the keyman icon to bring up the context menu and select the "Font Helper"
  3. From the font helper select keyboard cs_pinyin.
  4. It should display the following message in the font helper window No fonts have been found as suggestions for Keyboard %1$s.
  5. Now select Tamil_99
  6. Observe the suggested fonts are loaded with the characters in a grid format.
  7. Now Select Ahom Star
  8. Observe the suggested fonts are loaded with the characters in a grid format or if not found the message No fonts have been found as suggestions for Keyboard %1$s. is displayed
keymanapp-test-bot[bot] commented 2 weeks ago

User Test Results

Test specification and instructions

Test Artifacts

bharanidharanj commented 1 week ago

Test Results

bharanidharanj commented 1 week ago

Test Results

bharanidharanj commented 1 week ago

Test Results

rc-swag commented 1 week ago

@bharanidharanj This could be a side effect of running out of transient languages which will be addressed by #9422, I have raised issue #11313. In order to enable you to continue with testing can you select Add/remove language... in the Keyboard Layouts tab of Keyman Configuration and then add any en language you may have already installed on your machine.
Once you have a language associated with the keyboard you should be able to continue the test for this PR.

bharanidharanj commented 1 week ago

@bharanidharanj This could be a side effect of running out of transient languages which will be addressed by #9422, I have raised issue #11313. In order to enable you to continue with testing can you select Add/remove language... in the Keyboard Layouts tab of Keyman Configuration and then add any en language you may have already installed on your machine. Once you have a language associated with the keyboard you should be able to continue the test for this PR.

@rc-swag Okay, Thanks for the clarification. Could you please reassign me for retesting?

rc-swag commented 1 week ago

@keymanapp-test-bot retest TEST_KEYBOARD_WITHOUT_FONTS TEST_KEYBOARD_FONT_HELPER_SELECT_KEYBOARDS @bharanidharanj here you go

bharanidharanj commented 1 week ago

Test Results

bharanidharanj commented 1 week ago

Test Results

..cs_pinyin keyboard

..Tamil99 keyboard

..Ahom Star keyboard

keyman-server commented 1 week ago

Changes in this pull request will be available for download in Keyman version 17.0.316-beta