Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.22k stars 684 forks source link

RTL support #106

Open jamma313 opened 11 years ago

jamma313 commented 11 years ago

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.

SimonSapin commented 11 years ago

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 commented 11 years ago

We still want to track feature requests.

bahmany commented 9 years ago

Hi, RTL support, Please

Thanks

doctoromer commented 7 years ago

Hey, any rtl support is planned soon?

liZe commented 7 years ago

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.

doctoromer commented 7 years ago

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

mustafa0x commented 6 years ago

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

doctoromer commented 6 years ago

thank you very much!

בתאריך יום ו׳, 23 במרץ 2018, 18:34, מאת mustafa0x ‏<notifications@github.com

:

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 .

liZe commented 6 years ago

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.

n1ywb commented 5 years ago

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

malnajdi commented 5 years ago

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

dumblob commented 4 years ago

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

malnajdi commented 4 years ago

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

liZe commented 4 years ago

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 commented 4 years ago

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

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

malnajdi commented 4 years ago

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

liZe commented 4 years ago

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.

grewn0uille commented 4 years ago

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

malnajdi commented 4 years ago

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.

liZe commented 4 years ago

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.

malnajdi commented 4 years ago

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

grewn0uille commented 3 years ago

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!

kesara commented 2 years ago

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/

grewn0uille commented 2 years ago

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 commented 1 year ago

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.

tttalshaul commented 5 months ago

+1 for bidi support please.. I have a text that don't include RTL text but do numbers and special characters. I manage to get a PDF that displays the bidi text in the right way, but when I'm copying the text from the PDF to a notepad, some of the numbers are copied to the end of the sentence even that they exist in the beginning of it. For instance: [0:0:1 - 1:0:3], דובר 1: מה קורה? Copied as: 1:0:3 ]' דובר 1: מה קורה? - 1:0:3]

liZe commented 5 months ago

+1 for bidi support please.

We all want bidi support, help is appreciated!

but when I'm copying the text from the PDF to a notepad, some of the numbers are copied to the end of the sentence even that they exist in the beginning of it.

I’m not sure that it’s a problem in WeasyPrint then. If the layout is right but the copy-paste is wrong, it’s maybe because of the PDF reader.

If you have two simple PDF files with bidi, with the same layout but different copy-paste results, feel free to share so that we can study them.

tttalshaul commented 5 months ago

I’m not sure that it’s a problem in WeasyPrint then. If the layout is right but the copy-paste is wrong, it’s maybe because of the PDF reader.

You are right, I've upgraded the web browser and seems it handles the copy-paste better (not perfect yet). Adobe reader handles this worse..