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
pdfmetrics.registerFont(TTFont("David", "DavidLibre-Regular.ttf"))
text = "שלום! זו תהיה פסקה שהשורה האחרונה שלה לא תוצדק כהלכה. "
text = text * 2
doc = SimpleDocTemplate(
"repro.pdf",
pagesize=LETTER,
rightMargin=72,
leftMargin=72,
topMargin=72,
bottomMargin=72,
)
styles = getSampleStyleSheet()
normal_hebrew = ParagraphStyle(
parent=styles["Normal"],
name="NormalHebrew",
wordWrap="RTL",
alignment=TA_JUSTIFY,
fontName="David",
fontSize=14,
)
flowables = [Paragraph(text, normal_hebrew)]
doc.build(flowables)
(Sorry, I accidentally sent my reply only to you, hence I am resending).