xtermjs/xterm.js

Support RTL languages

Open

#701 aperta il 13 giu 2017

Vedi su GitHub
 (47 commenti) (56 reazioni) (0 assegnatari)TypeScript (1574 fork)batch import
area/addon/webglarea/i18narea/renderer-domhelp wantedtype/enhancement

Metriche repository

Star
 (16.196 star)
Metriche merge PR
 (Merge medio 2g 10h) (16 PR mergiate in 30 g)

Descrizione

Downstream issue: https://github.com/Microsoft/vscode/issues/28571

When we enforced unicode character width in https://github.com/sourcelair/xterm.js/issues/467 this broke RTL language characters as they are now rendered in reverse (LTR). We could revert that for RTL character ranges only but we should do the right fix and reverse the strings so they're actually on the character grid as the new selection model relies on all characters lining up perfectly on the grid https://github.com/sourcelair/xterm.js/pull/670

Ideally line reflow https://github.com/sourcelair/xterm.js/issues/622 would be done before this so it's easier to change the contents of multiple lines.

Terminal.app:

image

VS Code 1.13 (notice sentences are reversed):

image

@mostafa69d @CherryDT a little info on the languages in question would be handy:

  1. Where should the strings be flipped.for Hebrew/Arabic/Persian, do I reverse entire continuous sequences of characters in-between ascii characters?
  2. How are the characters meant to interact with characters like 0-9 or punctuation?

Useful references:

Guida contributor