Is it possible to write Arabic letters using borb
?
I have tried the 14 possible fonts in borb
and no one of them was able to display the Arabic letters.
from borb.pdf import Document
from borb.pdf import PDF
from borb.pdf import Page
from borb.pdf import Paragraph
from borb.pdf import SingleColumnLayout
def main():
# Create an empty Document.
pdf = Document()
# Add an empty Page.
page = Page()
pdf.append_page(page)
# Use a PageLayout (SingleColumnLayout in this case).
layout = SingleColumnLayout(page)
# Add a Paragraph
layout.add(Paragraph("Hello World", font="Helvetica"))
# Store the PDF.
with open(Path('output.pdf'), 'wb') as pdf_file_handle:
PDF.dumps(pdf_file_handle, pdf)
I think you will need to use a custom font, either an Arabic font already on your computer or a downloaded one from something like Google Fonts.
Below is an example using IBM Plex Sans Arabic: