Skip to content
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

feat(developer): Add more non-printing characters #9846

Merged
merged 20 commits into from
Nov 7, 2023

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Oct 25, 2023

Continues #9547

This adds special characters to Developer that were added in the new KeymanWeb font.

User Testing

Setup - Install the PR build of Keyman Developer

  • TEST_SPECIAL_CHARACTERS - verifies IDE can assign new characters
  1. Launch Keyman Developer
  2. Create a new keyboard that includes a touch layout keyboard
  3. Go to the touch layout keyboard editor tab and select a key
  4. In the Key properties, select the text dropdown and check for new strings
    (will be in this list)
    // Added in Keyman 17.0.
    // Reference: https://github.com/silnrsi/font-symchar/blob/v4.000/documentation/encoding.md
    '*ZWNJGeneric*': 0x79, // Generic version of ZWNJ (no override)
    '*Sp*': 0x80, // Space
    '*NBSp*': 0x82, // No-break Space
    '*NarNBSp*': 0x83, // Narrow No-break Space
    '*EnQ*': 0x84, // En Quad
    '*EmQ*': 0x85, // Em Quad
    '*EnSp*': 0x86, // En Space
    '*EmSp*': 0x87, // Em Space
    // TODO: Skipping #-per-em-space
    '*PunctSp*': 0x8c, // Punctuation Space
    '*ThSp*': 0x8d, // Thin Space
    '*HSp*': 0x8e, // Hair Space
    '*ZWSp*': 0x81, // Zero Width Space
    '*ZWJ*': 0x77, // Zero Width Joiner
    '*WJ*': 0x78, // Word Joiner
    '*CGJ*': 0x7a, // Combining Grapheme Joiner
    '*LTRM*': 0x90, // Left-to-right Mark
    '*RTLM*': 0x91, // Right-to-left Mark
    '*SH*': 0xa1, // Soft Hyphen
    '*HTab*': 0xa2, // Horizontal Tabulation

@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Oct 25, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Oct 25, 2023

User Test Results

Test specification and instructions

  • TEST_SPECIAL_CHARACTERS (PASSED): Tested with the attached PR build (Keyman Developer 17.0.202-alpha-test-9846) on Windows 11 OS (VM) and here is my observation: 1. Created a new keyboard and added Touch Layout feature in the Keyboard editor view. 2. Clicked the Touch Layout tab, then selected a key from the keyboard layout view. 3. In the Keycap properties, it seems that the new strings are available in the text dropdown list box. (notes)

Test Artifacts

@darcywong00 darcywong00 marked this pull request as ready for review October 25, 2023 23:51
@@ -199,6 +201,22 @@ function TransformSpecialKeys14(FDebug: boolean, sLayoutFile: string): string {
return sLayoutFile;
}

function TransformSpecialKeys17(FDebug: boolean, sLayoutFile: string): string {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit WET, based on TransformSpecialKeys14 (ll 188-202)

@bharanidharanj
Copy link

Test Results

  • TEST_SPECIAL_CHARACTERS (PASSED): Tested with the attached PR build (Keyman Developer 17.0.198-alpha-test-9846) on Windows 11 OS (VM) and here is my observation: 1. Verified that the the newly added special characters are available in the Keycap Value drop-down list.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Oct 26, 2023
@darcywong00
Copy link
Contributor Author

Hm, from @bharanidharanj 's screenshot, the new characters show tofu. I thought Developer would be using the same keymanweb-osk.ttf font.

@mcdurdin mcdurdin modified the milestones: A17S24, A17S25 Oct 27, 2023
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, except we may still have the old font?

developer/src/kmc-kmn/src/kmw-compiler/constants.ts Outdated Show resolved Hide resolved
@darcywong00
Copy link
Contributor Author

Changes look good, except we may still have the old font?

I copied keymanweb-osk.ttf to developer. (didn't realize it's a separate copy)

@keymanapp-test-bot retest

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Nov 2, 2023
@bharanidharanj
Copy link

Test Results

  • TEST_SPECIAL_CHARACTERS (PASSED): Tested with the attached PR build (Keyman Developer 17.0.202-alpha-test-9846) on Windows 11 OS (VM) and here is my observation: 1. Created a new keyboard and added Touch Layout feature in the Keyboard editor view. 2. Clicked the Touch Layout tab, then selected a key from the keyboard layout view. 3. In the Keycap properties, it seems that the new strings are available in the text dropdown list box.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Nov 3, 2023
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert the three test_touchlayout_14 files and then I think it should be okay with the proposed changes

Comment on lines 143 to 145
public static readonly VERSION_110 = 0x00000B00;
public static readonly VERSION_120 = 0x00000C00;
public static readonly VERSION_130 = 0x00000D00;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add these because we don't have files with these version numbers

developer/src/kmc-kmn/src/kmw-compiler/constants.ts Outdated Show resolved Hide resolved
Comment on lines +206 to +213
for(let i = 0; i < CSpecialText17Map.length; i++) {
// Assumes the JSON output format will not change
if(FDebug) {
sLayoutFile = sLayoutFile.replaceAll('"text": "'+CSpecialText17Map[i][0]+'"', '"text": this._v>16 ? "'+CSpecialText17Map[i][0]+'" : "'+CSpecialText17Map[i][1]+'"');
} else {
sLayoutFile = sLayoutFile.replaceAll('"text":"'+CSpecialText17Map[i][0]+'"', '"text":this._v>16?"'+CSpecialText17Map[i][0]+'":"'+CSpecialText17Map[i][1]+'"');
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using a multidimensional array here instead of a map, due to the conversion from Delphi. One day should clean this up

Co-authored-by: Marc Durdin <marc@durdin.net>
@darcywong00
Copy link
Contributor Author

@mcdurdin - I think all the test files got reverted. Is this ready to merge now?

@mcdurdin
Copy link
Member

mcdurdin commented Nov 7, 2023

@mcdurdin - I think all the test files got reverted. Is this ready to merge now?

LGTM

@darcywong00 darcywong00 merged commit 71a9b9d into master Nov 7, 2023
4 checks passed
@darcywong00 darcywong00 deleted the chore/developer/non-printing-chars branch November 7, 2023 08:20
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.207-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants