[reportlab-users] RTL Patch Committed

Muayyad AlSadi alsadi at gmail.com
Thu Nov 19 13:37:39 EST 2009


no need for icu, my mu.py works

I've add mu.py in reportlab/pdfgen/ and after importing pyfribidi I put
from mu import shape as muShape

then replaced
text = log2vis(text, directions.get(self.direction, DIR_ON))

with
text = log2vis(muShape(text), directions.get(self.direction, DIR_ON))


here is the result of
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 0
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('Sans',
'/usr/share/fonts/dejavu/DejaVuSans.ttf'))
from reportlab.pdfgen import canvas
c = canvas.Canvas("hello.pdf")
c.setFont("Sans", 14)
c.drawString(100,100,"كلام جميل".decode('utf-8'))
c.showPage()
c.save()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello.pdf
Type: application/pdf
Size: 24444 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20091119/5762cab1/attachment-0001.pdf>


More information about the reportlab-users mailing list