harfbuzz / harfbuzzjs

Providing HarfBuzz shaping library for client/server side JavaScript projects
https://harfbuzz.github.io/harfbuzzjs/
Other
197 stars 34 forks source link

Help with undestanding clustering result vs Chromium and Qt #53

Closed petrsimon closed 2 years ago

petrsimon commented 2 years ago

Hi, may I ask for your help while learning how to simulate behaviour around some characters in Google Chome and Qt? My suspicion is that it has to do with harfbuzz-ng, but I'm a bit lost. I'm working on a text editing engine and need to use harfbuzz to determine cursor positions.

E.g. I've noticed that the glyph স্থি (Bengali sthi) is composed of two clusters in harbuzzjs, which is the behaviour also in Firefox. I.e. two arrow key presses are required to cross the glyph. But in Chromium and Qt only one arrow key press is required.

Would you be so kind and shed some light on this? Many thanks!

behdad commented 2 years ago

Cursor positions are NOT determined by HarfBuzz.

petrsimon commented 2 years ago

@behdad FYI

https://harfbuzz.github.io/clusters.html#clusters-and-shaping

Consequently, a client program using HarfBuzz can utilize the cluster information to implement features such as: Correctly positioning the cursor within a shaped text run, even when characters have formed ligatures, composed or decomposed, reordered, or undergone other shaping operations.

But I understand my question is probably a bit misplace in this project.