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 support #106

Open
jamma313 opened this issue Jul 4, 2013 · 28 comments
Open

RTL support #106

jamma313 opened this issue Jul 4, 2013 · 28 comments
Labels
feature New feature that should be supported

Comments

@jamma313
Copy link
Contributor

jamma313 commented Jul 4, 2013

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
Copy link
Member

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.

@jamma313 jamma313 closed this as completed Jul 4, 2013
@SimonSapin
Copy link
Member

We still want to track feature requests.

@bahmany
Copy link

bahmany commented Jun 16, 2015

Hi, RTL support, Please

Thanks

@doctoromer
Copy link

Hey, any rtl support is planned soon?

@liZe
Copy link
Member

liZe commented Sep 6, 2017

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
Copy link

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

@mustafa0x
Copy link

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

@doctoromer
Copy link

doctoromer commented Mar 23, 2018 via email

@liZe liZe added this to the 43 milestone Mar 28, 2018
@liZe
Copy link
Member

liZe commented Mar 28, 2018

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 added a commit that referenced this issue Aug 24, 2018
@liZe liZe removed this from the 43 milestone Nov 2, 2018
@n1ywb
Copy link

n1ywb commented Dec 15, 2018

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
Copy link
Contributor

malnajdi commented Sep 9, 2019

@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
Copy link

dumblob commented Feb 18, 2020

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

@malnajdi
Copy link
Contributor

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

@liZe
Copy link
Member

liZe commented Feb 24, 2020

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
Copy link
Member

liZe commented Feb 24, 2020

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

💡 Writing failing tests is actually a really good starting point. 💡

@malnajdi
Copy link
Contributor

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
Copy link
Member

liZe commented Sep 27, 2020

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
Copy link
Member

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
Copy link
Contributor

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
Copy link
Member

liZe commented Sep 28, 2020

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
Copy link
Contributor

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

@grewn0uille
Copy link
Member

grewn0uille commented May 5, 2021

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
Copy link
Contributor

kesara commented Aug 25, 2022

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
Copy link
Member

grewn0uille commented Sep 12, 2022

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
Copy link
Member

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
Copy link

tttalshaul commented May 22, 2024

+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
Copy link
Member

liZe commented May 22, 2024

+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
Copy link

tttalshaul commented May 26, 2024

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported
Projects
None yet
Development

No branches or pull requests