Skip to content
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

RTL: Last line of block elements has incorrect position #1111

Closed
sagarvora opened this issue May 12, 2020 · 2 comments
Closed

RTL: Last line of block elements has incorrect position #1111

sagarvora opened this issue May 12, 2020 · 2 comments
Labels
bug Existing features not working as expected sponsored Issues sponsored to be resolved faster
Milestone

Comments

@sagarvora
Copy link

Code:

<div style='direction:rtl'>
يحتوي هذا المستند على معلومات سرية وملكية، وواجبنا هو حماية هذه البيانات وحفظها بشكل على نحو كافٍ. يتم توفير جميع البيانات والمعلومات في هذا المستند اعتماداً على عدم استخدام هذه المعلومات أو الكشف عنها باستثناء كون هذا الاستخدام في سياق التعاملات التجارية مع شركة البرمجيات المبتكرة المحدودة (إنوسوفت) فقط. بالإضافة لذلك، أثناء فترة تنفيذ المشروع، سنتبادل معلومات إضافية قد تكون سرية أو خاصة. ولضمان حماية جميع هذه المعلومات، يوافق الطرفان على اتباع السرية. في شركة إنوسوفت، تعتبر علاقتنا مع العميل شراكة طويلة الأمد مرتبطة بشكل كبير باحترام وولاء وثقة قوية في نزاهة بعضنا البعض.
</div>

Output using weasyprint renderer:
Screenshot from 2020-05-12 08-37-49

Expected Output:
Last line should be indented same as other lines.

@liZe liZe added the bug Existing features not working as expected label May 12, 2020
@liZe liZe closed this as completed in d06f081 May 18, 2020
@liZe
Copy link
Member

liZe commented May 18, 2020

That was a though one, appearing only when the box direction and the text are RTL. Having trailing spaces at the left requires the x position to be recalculated.

Both the test and the given sample work, but more tests with real-life documents are welcome!

@sagarvora
Copy link
Author

@liZe I tested changes in the related commit on complex formats locally. Great job.

The output from WeasyPrint 51 (before):
Screenshot from 2020-05-19 23-13-45

The output from WeasyPrint 51 + related commit changes (after):
Screenshot from 2020-05-19 23-10-24

Could not test in Weasyprint (latest) because elements below the table are floated (#1110)

@liZe liZe added this to the 52 milestone Sep 28, 2020
@liZe liZe mentioned this issue Sep 28, 2020
@liZe liZe added the sponsored Issues sponsored to be resolved faster label Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected sponsored Issues sponsored to be resolved faster
Projects
None yet
Development

No branches or pull requests

2 participants