googlearchive / chromedeveditor

Chrome Dev Editor is a developer tool for building apps on the Chrome platform - Chrome Apps and Web Apps, in JavaScript or Dart. (NO LONGER IN ACTIVE DEVELOPMENT)
BSD 3-Clause "New" or "Revised" License
2.92k stars 410 forks source link

Complex Text and Cursor Rendering Issue #4066

Open rober42539 opened 8 years ago

rober42539 commented 8 years ago

Complex text (like Lao in this case) is rendering the cursor wrong - when vowels/tonemarks/consonants are placed above or below a consonant, the cursor compensates by going to teh right, as if it wasn't stacked on top of the consonant.

On line 38 of the code in the screenshot, you will see 4 ZWSPs (zero width spaces), and then a comma which is the last character in the line. However, as you press the key to the right, it seems to assume that the characters that are stacked need to push the cursor an equal distance to the right.

Look at the vowels and tone marks that can be above and below nuclear consonants... Like the ິ above the consonant ຈ on line 38. In the editor, the cursor is way out to the right in order to edit the characters far to the left of the cursor.

Note, there is a return immediately after the comma, and no whitespace at the end of the line. The cursor is simply floating off in nirvana, far separated from reality... ;)

screenshot 2016-04-02 at 18 02 47

The issue is the same for Burmese, Thai, and Khmer, as well as Lao. Here's some text to play with...

ປື້ມທ່ານ​ນາງ​ເອ​ເລັນຈີ​ໄວທ໌ (Lao) ឯ​ពូជ​ដំណ​នៃ​ពួក​កូន​ចៅ​រូបេន (Khmer) ในเริ่มแรกนั้นพระเจ้าทรงเนรมิตสร้างฟ้าสวรรค์และแผ่นดินโลก (Thai) အစအဦး၌ ဘုရားသခင်သည် (Burmese)

Copy and paste it into the editor and navigate the cursor to the end of the line...