Hi Ian,

as Pyx uses LaTeX to create the text, you can add arbitrary LaTeX commands in the text,  for example \ttextt{words to be monospaces } or \textsf{words to be sans-serif}. But then it will be helpful to write the code as

c.text(0,0,r"\ttextt{words to be monospaced} ")

(with an "r" in front of the text, to tell python not to care about the backslash)



On Thu, May 29, 2008 at 5:37 PM, Renton Ian <IRENTON@qinetiq.com> wrote:

My request is something (hopefully) quite simple, but I can't seem to
find it in the documentation anywhere!

I'm writing text (amongst other things) to PDF using PyX, and by default
it appears in a serif font.  What I'd like to do is change some of the
text items to be sans-serif, and some to be monospace.  I've found
plenty of information on changing font *sets*, but not on changing
between the fonts in that set, so I'd be grateful if anyone here can

I'm using PyX 0.10, Python 2.5, MiKTeX 2.7 on WinXP.

Thanks in advance,


(Apologies for huge corporate sig)
The information contained in this E-Mail and any subsequent
correspondence is private and is intended solely for the intended
recipient(s).  The information in this communication may be
confidential and/or legally privileged.  Nothing in this e-mail is
intended to conclude a contract on behalf of QinetiQ or make QinetiQ
subject to any other legally binding commitments, unless the e-mail
contains an express statement to the contrary or incorporates a formal Purchase Order.

For those other than the recipient any disclosure, copying,
distribution, or any action taken or omitted to be taken in reliance
on such information is prohibited and may be unlawful.

Emails and other electronic communication with QinetiQ may be
monitored and recorded for business purposes including security, audit
and archival purposes.  Any response to this email indicates consent
to this.

Telephone calls to QinetiQ may be monitored or recorded for quality
control, security and other business purposes.

QinetiQ Limited
Registered in England & Wales: Company Number:3796233
Registered office: 85 Buckingham Gate, London SW1E 6PD, United Kingdom
Trading address: Cody Technology Park, Cody Building, Ively Road, Farnborough, Hampshire, GU14 0LX, United Kingdom

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
PyX-user mailing list