WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

RTL support

Open jamma313 opened this issue 12 years ago • 30 comments

Hi,

What is the current status of weasyprint concerning rtl support ? It looks like it has a partial support (can display text but not boxes), is this a long way to finish it ?

Thanks.

jamma313 avatar Jul 04 '13 01:07 jamma313

There is no RTL support in WeasyPrint. It kinda seems to work on uninterrupted text runs as a side-effect of using Pango, but that’s not nearly enough to do anything useful.

It’s definitely something that we want to have eventually, but it’s a lot of work and there is currently no plan for doing it. But Kozea will probably be happy to chat with whoever wants to contribute one way or another.

SimonSapin avatar Jul 04 '13 11:07 SimonSapin

We still want to track feature requests.

SimonSapin avatar Jul 04 '13 12:07 SimonSapin

Hi, RTL support, Please

Thanks

bahmany avatar Jun 16 '15 09:06 bahmany

Hey, any rtl support is planned soon?

doctoromer avatar Sep 05 '17 23:09 doctoromer

Hey, any rtl support is planned soon?

Adding RTL and BiDi support will be possible after rewriting the line breaking algorithm (#301), which is explained in Fragmentation Module and in Text Module.

That's huge.

Secret breaking news: implementing the breaking rules and adding rtl/bidi support is on my short list for 2018. It'll come with dropping Python 2 support and releasing 1.0.0. Maybe.

liZe avatar Sep 06 '17 14:09 liZe

Thank you very much! I will look forward to it.

doctoromer avatar Sep 06 '17 22:09 doctoromer

According to some brief tests with 0.42, RTL/BIDI supports seems to be pretty decent.

mustafa0x avatar Mar 23 '18 15:03 mustafa0x

thank you very much!

בתאריך יום ו׳, 23 במרץ 2018, 18:34, מאת mustafa0x ‏<[email protected]

:

According to some brief tests with 0.42, RTL/BIDI supports seems to be pretty decent.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Kozea/WeasyPrint/issues/106#issuecomment-375704958, or mute the thread https://github.com/notifications/unsubscribe-auth/ASmVfxySwUL7PtNmxht7ktjqtDJnbzfmks5thRXggaJpZM4AyeAo .

doctoromer avatar Mar 23 '18 15:03 doctoromer

According to some brief tests with 0.42, RTL/BIDI supports seems to be pretty decent.

RTL suppot is not that bad for simple use cases and will probably be quite good in version 43.

Bidi is a much harder goal to reach. We'll have to open a separate issue when this one is closed.

liZe avatar Mar 28 '18 11:03 liZe

It would be great if we could support

writing-mode: vertical-rl;
text-orientation: sideways-right;

This is the only way I've found to, in combination with

transform: rotate(180deg);

in English, make nice Y axis chart labels with correct text flow and line wrapping.

e.g. image

n1ywb avatar Dec 15 '18 18:12 n1ywb

@liZe Is there a way we can maybe chat or you can give me some guides on how to contribute to the RTL support ?

malnajdi avatar Sep 09 '19 01:09 malnajdi

@mohdnajdy did you have any success in adding support for RTL to weasyprint?

dumblob avatar Feb 18 '20 15:02 dumblob

@dumblob not really. I am still lost on where to contribute at for supporting RTL

malnajdi avatar Feb 18 '20 16:02 malnajdi

I am still lost on where to contribute at for supporting RTL

It’s really hard to know where to start. git grep rtl will give a few TODOs, but that’s a small part of the work needed.

Some parts are probably easier to fix: tables, list markers, flex blocks… The hard work is of course in inline blocks layout.

You can find failing tests related to RTL in WeasySuite (this page may take a long time to render). And, of course, we’ll need to write our own tests too.

Fixing RTL won’t mean that bidi is fixed. Supporting bidi would mean that we have our own implementation of the bidi algorithm and don’t rely on Pango’s one, as we have to handle line breaks with embedded tags. Yes, we would be able to drop Pango and use HarfBuzz instead, but that’s a lot of work…

liZe avatar Feb 24 '20 10:02 liZe

And, of course, we’ll need to write our own tests too.

:bulb: Writing failing tests is actually a really good starting point. :bulb:

liZe avatar Feb 24 '20 11:02 liZe

Hello again @liZe I would like to re-state the issue of the Arabic text in a p tag. As shown in the picture. And i would really love to solve it. So please can you guide me to where i should look for to solve this issue ? if there is a simple solution please let me know.

image

malnajdi avatar Sep 27 '20 11:09 malnajdi

Hello again @liZe I would like to re-state the issue of the Arabic text in a p tag. As shown in the picture. And i would really love to solve it. So please can you guide me to where i should look for to solve this issue ? if there is a simple solution please let me know.

Hello again!

What’s wrong with this paragraph? I’m sorry, but as I don’t read Arabic it’s hard for me to spot the problem. If you have an HTML/CSS sample with the wrong rendering and an idea about what the right rendering is, it would be useful.

liZe avatar Sep 27 '20 19:09 liZe

I think the issue of the Arabic text in the p tag is that the third line starts too much on the right compared to the previous ones

grewn0uille avatar Sep 27 '20 19:09 grewn0uille

I think the issue of the Arabic text in the p tag is that the third line starts too much on the right compared to the previous ones

@liZe issue_in_weasyprint

as you can see the first 2 lines are correct. The last line is going more to the right.

malnajdi avatar Sep 28 '20 06:09 malnajdi

as you can see the first 2 lines are correct. The last line is going more to the right.

Oh, OK 👓 !

I think that this problem is already fixed in master: see #1111.

liZe avatar Sep 28 '20 08:09 liZe

@liZe great, Is there going to be a release date for the new version ?

malnajdi avatar Sep 28 '20 09:09 malnajdi

Hello!

(The survey is now closed. Thanks for all your answers! We’ll share the results soon 😉)

If you’re interested in RTL and bidi support, we created a short survey where you can give a boost to this feature and help us to improve WeasyPrint 😉

Vote for it!

grewn0uille avatar May 05 '21 15:05 grewn0uille

As an argument for better RTL support, WeasyPrint is used by IETF to generate PDFs of RFCs. RTL support is essential in some RFCs. For example, an internet draft on the way to becoming an RFC has issues with PDF rendering because of the WeasyPrint RTL support. Ref: https://mailarchive.ietf.org/arch/msg/auth48archive/_8ZjoHcPh5HfYxRQb3P4zVbdXUg/

kesara avatar Aug 25 '22 02:08 kesara

Hello!

As it’s soon our 2-year anniversary as CourtBouillon, we opened a short survey to know more about your expectations. Don’t hesitate to support this feature and give it a boost 🚀!

The survey will be opened until October 10th.

Update: the survey is now closed. You can find the results here.

grewn0uille avatar Sep 12 '22 09:09 grewn0uille

Hello!

As you may know, two weeks ago was CourtBouillon 3-year anniversary 🎉.

For this occasion, we prepared a short survey to have your opinion on this year’s features and to know what you’d like to see in the future! Don’t hesitate to give a boost to this feature ✨️

The survey is opened until November 19.

grewn0uille avatar Oct 23 '23 11:10 grewn0uille