-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect resolved paragraph direction #163
Comments
@khaledhosny , please look at the PR. The fix works perfectly in my case. Now all necessary info is provided to the library user code. |
I think the code is assuming par direction is explicitly set, which I think is one way to handle this. Am I right that you are using auto par dir? |
Yes, I want a multiline editbox to detect text direction per paragraph and align them correctly. Direction-neutral paragraphs are aligned as the above text. But this is only a practical example. The problem is conceptual - there are direction-neutral paragraphs (i.e. "111") and middleware should not suppose any strict direction for them. It should be handled in user code. |
I understand that, I was trying to figure out how the original code came to be like that, but it was definitely wrong. Now I need to make sure the SeenBiDi code is fixed the same way. |
libraqm/src/raqm.c
Lines 1417 to 1420 in ce67a59
An assumption is made that everything that is not explicitly LTR is RTL. It fails for direction-neutral paragraphs (FRIBIDI_PAR_ON). This leads to strange results, e.g. a number in a separate paragraph in a completely LTR text is considered RTL.
I suggest to turn FRIBIDI_PAR_ON into RAQM_DIRECTION_DEFAULT, so users can treat it accordingly to their preference. This value should not have any side meaning anyway, e.g. checking whether layouting was performed by inspecting
raqm_get_par_resolved_direction
is definitely a bad practice.This sould also be fixed for SheenBIDI but I can't make exact suggestions as I didn't work with it.
The text was updated successfully, but these errors were encountered: