[reportlab-users] Come on, i am so messed up and i need anything from u

Marius Gedminas reportlab-users@reportlab.com
Thu, 13 Nov 2003 21:28:10 +0200

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Nov 11, 2003 at 01:36:03PM -0800, sarah el-lawindy wrote:
> Marius Gedminas ,
>   thanks for replying. here is the code i wrote:
>     import reportlab.rl_config
>     reportlab.rl_config.warnOnMissingFontGlyphs =3D 0=20
>     from reportlab.pdfbase import pdfmetrics
>     from reportlab.pdfbase.ttfonts import TTFont
>     from reportlab.pdfgen import canvas
>     c =3D canvas.Canvas('t.pdf')
>     pdfmetrics.registerFont(TTFont('ArabicRiyadh', 'ArabicRiyadh.ttf'))
>     from reportlab.lib.fonts import addMapping
>     addMapping('ArabicRiyadh', 0, 0, 'ArabicRiyadh')
>     c.setFont('ArabicRiyadh', 32)

This line is suspect:

>     TEST =3D u'?????'

This can work only if you use Python 2.3 and have an appropriate
character coding specified near the top of the file.

As a first step, could you replace real characters with Unicode escapes,

      TEST =3D u'\u1234\u5678\u9ABC'

Find out the real Unicode numbers for the characters you use; I cannot
do that because I only see ASCII question mark characters in your

If it works, you can try

      TEST =3D unicode('?????', 'encoding-used-for-arabic-text')

Substitute the appropriate encoding up there, I do not know which one is
usually used for Arabic.

Marius Gedminas
I am right now in the process of reading the Xft source code (the suspense =
the end of Chapter 7 is unbearable) [...]
	-- Juliusz Chroboczek

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (GNU/Linux)