[reportlab-users] JustifyRight in ParagraphStyle
mosheduminer at gmail.com
Wed Mar 17 17:25:31 EDT 2021
Thanks for taking a look!
The font used in the repro is Libre David (though the behavior is the same
with other fonts as well). Downloadable from google fonts here
from reportlab.platypus import Paragraph
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.lib.pagesizes import LETTER
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
from reportlab.platypus.doctemplate import SimpleDocTemplate
text = "שלום! זו תהיה פסקה שהשורה האחרונה שלה לא תוצדק כהלכה. "
text = text * 2
doc = SimpleDocTemplate(
styles = getSampleStyleSheet()
normal_hebrew = ParagraphStyle(
flowables = [Paragraph(text, normal_hebrew)]
Thank you for looking into this!
(Sorry, I accidentally sent my reply only to you, hence I am resending).
On Wed, Mar 17, 2021 at 4:33 PM Robin Becker <robin at reportlab.com> wrote:
> Hi Moshe,
> I'll take a look at this; can you provide a simple example of the code
> that you useto demonstrate the problem. If
> possible I need to use the same text, style, width and font. Also if
> possible what reportlab version and I guess fribidi
> etc etc if you are using that.
> On 17/03/2021 12:48, Moshe Uminer wrote:
> > Hi, I'm enjoying reportlab, but I've run into an issue.
> > Currently, when using TA_JUSTIFY in ParagraphStyle, the last line is
> > aligned to the left. This is problematic when using an RTL language
> > together with justify, as the last line of the paragraph should be
> > right.
> > I don't know how complex it would be to add this option, but I would
> > definitely appreciate it :).
> Robin Becker
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users