fribidi / fribidi

GNU FriBidi
GNU Lesser General Public License v2.1
358 stars 106 forks source link

Clarify "console-based systems do not like reorder-nsm" #97

Open egmontkob opened 5 years ago

egmontkob commented 5 years ago

fribidi_reorder_line()'s manual says:

There is an optional part to this function, which is whether non-spacing marks for right-to-left parts of the text should be reordered to come after their base characters in the visual string or not. Most rendering engines expect this behavior, but console-based systems for example do not like it.

Could you please clarify what this "console-based systems" refers to?

Most terminal emulators handle combining characters: they tie them to the character cell containing the base character (the previously received one in the input stream). In such terminal emulators, assuming the terminal itself doesn't do any BiDi, it's the reordered variant with FRIBIDI_FLAG_REORDER_NSM that needs to be output to achieve the desired result.

What I can imagine where the lack of this flag is desired is a terminal emulator that does not support combining accents, rather they all occupy their individual cell (resulting in terribly ugly look), along with the expectation that combining accents should visually follow (that is: with RTL text appear on the left of) the base letter. Does the manpage really refer to these?

I could find the Linux console, as well as the Terminology emulator that behave like this, i.e. don't support combining accents at all. Why would someone who cares about relevant scripts pick one of these, rather than one of those many that do support them?

I suspect that the quoted sentence is a legacy, and refers to a negligible use case within the terminal emulation world, and thus probably deserves to be clarified/revised. (Or did I miss anything fundamental?)

behdad commented 5 years ago

What I can imagine where the lack of this flag is desired is a terminal emulator that does not support combining accents, rather they all occupy their individual cell (resulting in terribly ugly look), along with the expectation that combining accents should visually follow (that is: with RTL text appear on the left of) the base letter. Does the manpage really refer to these?

I could find the Linux console, as well as the Terminology emulator that behave like this, i.e. don't support combining accents at all. Why would someone who cares about relevant scripts pick one of these, rather than one of those many that do support them?

lol. When I wrote that in 2004, we didn't have many, or any, terminal emulators that supported combining characters!

egmontkob commented 5 years ago

I was lazy to "git blame" that sentence, didn't think it would be that old :) So I take it as confirmed that it's a legacy, no longer accurate statement. Thanks for your input!

behdad commented 5 years ago

Pull-Request please.