Here's some:

--------------------
from pyx import *

text.set(mode="latex") 
text.preamble(r"\usepackage{ulem}")  # underlining text...

text.preamble(r"\usepackage{anyfontsize}")  # one way of scaling fonts (except
math fonts)....

text.preamble(r"\DeclareFixedFont{\LittleFont}{T1}{ptm}{b}{it}{0.75in}") #
another way of scaling font sizes...(except math fonts...)

text.preamble(r"\DeclareFixedFont{\TinyFont}{T1}{ptm}{m}{n}{0.01in}")


# For scaling both math and text fonts use:  [trafo.scale(scale factor)]
#~ c.text(5,-5,r'Scaling both Text and Math Fonts: $\sum$',[trafo.scale(4)])

unit.set(defaultunit='cm')

c = canvas.canvas()


c.text(5,5,r'\TinyFont{You Have to Magnify To See This Font!}')

c.text(3,4,r'\fontsize{4}{3}\selectfont Adjust font size on the fly...')

c.text(5,3,r'{\bfseries{Using non-standard}} font sizes and underlining text')

c.text(3,2,r'\Huge{ $\backslash$fontsize$\{size\}$$\{spacing\}$\selectfont 
...}')
c.text(5,0.5,r'\fontsize{30}{25}\selectfont 1$^{st}$ \uline{parameter} is
\uuline{font} size. 2$^{nd}$ is the \uwave{spacing}')
c.text(3,0,r'\fontsize{6}{4}\selectfont small stuff')

c.text(5,-2,r'\fontsize{40}{5}\selectfont  $\phi, \pi$')


c.text(5,-5,r'Scaling both Text \uline{and} Math Fonts: $\sum_{{n < k}^2}^2
P(x)$',[trafo.scale(4)])
c.text(5,-6,r'Scaling both Text and Math Fonts: $\sum_{{n < k}^2}^2
P(x)$',[trafo.scale(0.4)])


c.writeEPSfile("minimalText")
c.writePDFfile("minimalText")

--------------------------------

Hello, 

I am using PyX to write text into my output PDF document. I have looked
at the user manual, as well as the tutorial, and am having trouble
figuring out how to change things like fonts, or add underlining to
text. Are there any examples out there that I can use to get a better
understanding of how to change these text/font properties??

Thanks, Bill










------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to