It does not support:
Right-to-left (RTL) direction
Arabic glyph shaping (letters change form depending on position)
So even though your string is correct in Python, FPDF draws characters as isolated shapes from left to right.
To correctly render Arabic in FPDF, you must reshape + reorder the text manually before passing it to FPDF.
You need two Python packages:
pip install arabic-reshaper python-bidi
from fpdf import FPDF
import arabic_reshaper
from bidi.algorithm import get_display
# your Arabic text
text = "هذا نص تجريبي باللغة العربية."
# 1. reshape letters
reshaped_text = arabic_reshaper.reshape(text)
# 2. reorder text for RTL
bidi_text = get_display(reshaped_text)
pdf = FPDF()
pdf.add_page()
# Add an Arabic TTF font
pdf.add_font('Arial', '', 'arial.ttf', uni=True)
pdf.set_font('Arial', size=16)
pdf.write(10, bidi_text)
pdf.output("arabic_test.pdf")