Dave Crossland
2009-01-20 15:40:08 UTC
Hi,
After a chat with Ricardo I thought I could take a crack at using
ShoeBot to create some print design page layouts.
Here is a modified /usr/share/shoebot/examples/var/VarText.bot for
generating type specimens (previews) for printing;
-- 8< --
#var("tx",TEXT,"abcdefghijklmnopqrstuvwxyz")
#var("sz",NUMBER,100,10,200)
size(298,210);
colorrange(255)
def draw():
background(255)
fontFilename = "/usr/share/fonts/liberation/LiberationSans-Regular.ttf'"
font(fontFilename)
# fontsize(sz)
# text(tx,10,HEIGHT-((HEIGHT/5)*3))
fontsize(60)
text("adhesion",10,HEIGHT-60)
fontsize(18.7)
text("abcdefghijklmnopqrstuvwxyz",10,HEIGHT-30)
fontsize(9)
text("This is "+str(fontFilename),10,HEIGHT-10)
-- 8< --
However, when I run this and, if it runs okay, open it in Inkscape -
$ sbot typeSpecimenMaker.bot -o output.svg && inkscape output.svg
- then the size() is of course in points instead of pixels.
I tried to search the sourcecode, but can see no way to change PT to
MM. I guess because it is a Cairo default that needs to be overridden
somewhere.
Does anyone have any suggestions? :-)
After a chat with Ricardo I thought I could take a crack at using
ShoeBot to create some print design page layouts.
Here is a modified /usr/share/shoebot/examples/var/VarText.bot for
generating type specimens (previews) for printing;
-- 8< --
#var("tx",TEXT,"abcdefghijklmnopqrstuvwxyz")
#var("sz",NUMBER,100,10,200)
size(298,210);
colorrange(255)
def draw():
background(255)
fontFilename = "/usr/share/fonts/liberation/LiberationSans-Regular.ttf'"
font(fontFilename)
# fontsize(sz)
# text(tx,10,HEIGHT-((HEIGHT/5)*3))
fontsize(60)
text("adhesion",10,HEIGHT-60)
fontsize(18.7)
text("abcdefghijklmnopqrstuvwxyz",10,HEIGHT-30)
fontsize(9)
text("This is "+str(fontFilename),10,HEIGHT-10)
-- 8< --
However, when I run this and, if it runs okay, open it in Inkscape -
$ sbot typeSpecimenMaker.bot -o output.svg && inkscape output.svg
- then the size() is of course in points instead of pixels.
I tried to search the sourcecode, but can see no way to change PT to
MM. I guess because it is a Cairo default that needs to be overridden
somewhere.
Does anyone have any suggestions? :-)
--
Regards,
Dave
Regards,
Dave