-
Notifications
You must be signed in to change notification settings - Fork 599
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
Justified Text not supporting RTL #534
Comments
This should probably also make the last line aligned right. |
@Doragon-S I know the reason, I will fixed it in this week. |
Thank you so much! |
I don't know how how to do this, and maybe you can wait for others to help you. |
Do you know who I could ask? and how I would ask? (I'm new to GitHub) |
I think you can ask asturio, the maintainer of OpenPDF. |
Hi Dorago-S!
In my case I want to set a specific header to document pages that are filled by the add method of the Document class. |
I'm not sure. Would I need to make a whole table to use it? |
@Doragon-S I have fixed it. Hope it can help you. And Last Line is also alignment to "Right" |
Hi @Doragon-S , can you take a look at the test |
Hi! I'm new to coding, and I don't really know what to do, so I'll tell you what I tried doing and you tell me if it helped/what to actually do? When I ran the code, I got a failed test of: `INFO: Reading font-fallback/LiberationSans-Regular.ttf... org.opentest4j.AssertionFailedError: ...` I didn't see the first line about the font at first and so tried to save it as a pdf to view it there, but it came out written LTR (all the characters were printed the wrong direction). I then saw the first line and thought maybe the test returned "" because LiberationSans is an English font (I think?) and tried adding in a Hebrew font, but then I realized that I didn't see any calls to any font, so I didn't know what to replace, and now I'm slightly confused about what I was supposed to do in the first place. |
@asturio |
Describe the bug
When aligning a paragraph as "Justified", it changed to LTR. The hebrew letters were written backwards, like english. I thought I had broke something until I tried changing the alignment to "Right" and "Center".
I had written this in Kotlin, but since Kotlin is compatable with Java, I don't think there will be any difference between the two.
To Reproduce
Code to reproduce the issue
Sample Code
document.open()
LayoutProcessor.enable(java.awt.Font.LAYOUT_RIGHT_TO_LEFT)
val fontFileName = "Path\FrankRuehlCLM-Medium.ttf"
FontFactory.register(fontFileName, "sans")
val font: Font = FontFactory.getFont("sans", BaseFont.IDENTITY_H, 12f)
val text = "שוב היתה זו שעת לילה. דממה שררה בפונדק אבן־הדרך, והיתה זו דממה בת שלושה חלקים." +
"החלק המתבקש מאליו היה שקט חלול, מהדהד, עשוי מן הדברים שלא היו. אילו היתה רוח, כי" +
"אז היתה נאנחת בעוברה בין העצים, מטלטלת את שלט הפונדק בחריקה על ציריו וסוחפת את" +
"הדממה במורד הדרך, כפי שהיא גורפת עלי סתיו. אילו היה קהל בפונדק, אפילו קומץ אנשים, כי" +
"אז היו ממלאים את הדממה בשיחה ובצחוק, בהמולה ובשאון שהיה מקום לצַפות להם במסבאה," +
"בשעות הלילה החשוכות. אילו היתה מוסיקה... אבל לא , ודאי שלא היתה מוסיקה. למען האמת, אף" +
"לא אחד מהדברים האלה היה שם, ולכן נותרה הדממה בעינה."
var p1: Paragraph = Paragraph( Chunk(text, font) )
p1.alignment = Element.ALIGN_JUSTIFIED
document.add(p1)
document.close()
Unit-Test
Expected behavior
It should be justified, just like any LTR languages, but RTL
Screenshots
If applicable, add screenshots to help explain your problem.
System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: