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): Fine control of OSK rendering #3121

Closed
mcdurdin opened this issue May 13, 2020 · 1 comment
Closed

feat(developer): Fine control of OSK rendering #3121

mcdurdin opened this issue May 13, 2020 · 1 comment

Comments

@mcdurdin
Copy link
Member

We'd like to be able to control the rendering of the OSK more finely to give better outcomes with complex shaping, especially things like dotted circles with unattached diacritics, multiple diacritics, strings of characters and more.

See: https://docs.google.com/document/d/1I1P1wXA8oLR608AtKxt9pBRn-vTJaGDCBKsJVjrtIVE/edit#

original discussion below:


The U+25CC dotted circle issue arises because KeymanWeb tries too hard to display diacritics well. It seems that the width calculation for a text run is inconsistent across systems.

Example strings to test:

  • Khmer: (U+17D2 U+178F). This works on Windows, Chrome, but displays wrongly in Safari (iOS). It may be that calculating text width in a canvas works differently than display the character standalone, or that Safari won't combine Khmer with U+25CC.
  • Arabic: ٴ (U+0674). This adds an unwanted dotted circle on all platforms, per the community post above.

Reference code in visualKeyboard.ts:226:

      // Check the key's display width - does the key visualize well?
      var width: number = OSKKey.getTextWidth(osk, keyText, styleSpec);
      if(width == 0 && keyText != '' && keyText != '\xa0') {
        // Add the Unicode 'empty circle' as a base support for needy diacritics.
        keyText = '\u25cc' + keyText;

I'd like to see other examples of the dotted circle in use.

Given that this detail of adding U+25CC is specific to KeymanWeb, and does not happen on Windows, macOS or Linux, we should consider whether it is appropriate.

We may need to roll this change back, or nuance it further. My preference: roll the change back in 13.0.

Originally posted by @mcdurdin in #2990 (comment)

@mcdurdin
Copy link
Member Author

mcdurdin commented Aug 4, 2023

This has been completed with the kmc-analyze work in #8723 and related PRs.

@mcdurdin mcdurdin closed this as completed Aug 4, 2023
@mcdurdin mcdurdin changed the title [Developer] Fine control of OSK rendering feat(developer): Fine control of OSK rendering Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants