Comments (10)
I assumed that this was a Mac-specific issue, but when I type in keymanweb.com, I see the same output as for TextEdit on the Mac. Does this work correctly for Keyman in any platform? Is it something that can be addressed in Keyman Core?
from keyboards.
Copying this from the discussion on Keyman community because it is pertinent.
Yes, @andjc is right; I should have picked up on this earlier. It's almost certainly to do with the way that macOS renders the parentheses, rather than a bug in Keyman for Mac's text output. If you want to have a fun reading day, read the W3C's overview of the Unicode Bidi Algorithm (and if you want to have a scary day, read the algorithm doc itself!)
Suffice to say, this is one of those areas where behaviour differs across programs and platforms as well, so you may get mirrored parentheses (or you may not), and the direction of the parentheses may be determined by the words surrounding it, the underlying paragraph direction, or even by whether or not Hebrew support is enabled for the application, in some cases. The implementation of the Bidi algorithm is not terribly consistent, sadly.
FWIW, the SIL Hebrew keyboard emits U+0028
(open parenthesis), for Shift+0 ()) and U+0029
(close parenthesis) for Shift+9 ((). This is more than a little confusing to parse in the keyboard source when you dig, but it does mean the symbols printed on the US keyboard key cap match what you see on the screen -- so WYSIWYG for the end user...
+ "(" > U+0029 c d41 close paren 2/10/97
+ ")" > U+0028 c d40 open paren 2/10/97
Interesting historical note, I see @andjc ported sil_hebrew to our git repo
from keyboards.
from keyboards.
[>][space][left paren][>][right paren]
This is the crux, what is meant by [left paren]?
[SHIFT K_0] types the opening parenthesis (left parenthesis) and the key to the left [SHIFT K_9] types the closing parenthesis (right parenthesis), i.e bidi mirroring should occur.
But text layout direction you are typing into is a critical factor, you need to be in an RTL editing environment. If the editing environment is using first strong heuristic, it is critical that the first character with a strong directionality is right to left.
from keyboards.
In the issue two screenshots are included.
For both TextEdit and Pages, it appears that closing parenthesis was typed before the aleph, and opening parenthesis typed after it.
For Pages, additionally the RTL string is being displayed as a LTR string. Probably a settings issue.
from keyboards.
I am guessing that the first paren in the Pages image is getting LTR directionality from the space (i.e. para direction) and the second paren is getting RTL directionality from the Aleph, which is why they both appear the same? Weird if true but seems likely.
from keyboards.
@mcdurdin Not weird, just an issue of what embedding levels each character is assigned to, as you surmise the first paraenthesis follows a space and inherits LTR from its context and is not mirrored. The second parenthesis follows directly after a strong RTL character and ends up in a RTL embedding, and the glyph therefore gets mirrored.
So we have an unmirrored closing parenthesis and a mirrored opening parenthesis, so both end up facing the same way. The fun of the bidirectional algorithm, and illustrates very well why getting the base direction of text right is critical.
If I try the same in a browser, I get the same results. Including in the source code:
<div class="sample" dir="ltr">Χ )Χ(</div>
from keyboards.
@mcdurdin Is there clarity on what to do with this issue?
- Is there something to fix in the keyboard?
- Is there something to add to the documentation for the keyboard?
- Is there something to change in the Keyman engine(s)?
- Do we just close the issue?
from keyboards.
@DavidLRowe the keyboard behaviour wrt parentheses appears to be identical to the system keyboards I have tried.
from keyboards.
I think this is by-design for the keyboard. On macOS, we have a limitation re RTL keyboards which needs to be addressed, but we already have two issues relating to that:
(Yes they are very old issues, welcome to the reality that we have not had a mac developer until @sgschantz joined the team!)
from keyboards.
Related Issues (20)
- [khmer_angkor] bug: Long press on the spacebar key shows blank subkey in Khmer Angkor Keyboard HOT 1
- Rusyn keboard HOT 2
- [sil_hebrew] Consider moving some character to shift layer
- [nlci_kannada_winscript] Kannada Winscript (NLCI) Keyboard lacking characters HOT 1
- [itrans_roman] Request for some extra characters on Indic Romanization from ITRANS Keyboard to cover more Indic langauges. HOT 2
- [itrans_devanagari_hindi] [itrans_bengali] Indic Phonetic ITRANS keyboards bug? (Devanagari and Bangla) HOT 9
- [itrans_devanagari_hindi] request for short key for special rendering of 'rya' HOT 1
- [gff_tigre, giff_tigrinya_eritrea] broken pdf links HOT 3
- [GFF] Deprecate some of these keyboards HOT 26
- Missing altgr or ralt key from legacy Hungarian keyboards HOT 2
- [nasa_yuwe] bug: keyboard embeds welcome.htm in place of OSK
- [ahom_star] bug: Start Menu entries have name "(new)"
- [old_hungarian] Possible useable to add digital numbers, quotation and punctuation marks to ralt+shift layer on mobile devices HOT 1
- [old_hungarian] Possibilities? HOT 3
- Web Page for GFF GeΚΎez Keyboard Displays Too Many Platforms HOT 7
- bug: some touch layouts have not applied "special" formatting to layer switch keys on longpress
- chore: some packages have source files included
- chore: keyboards that target touch but are missing .js in packages HOT 3
- chore: ensure case of filenames matches reality on disk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keyboards.