|
Post by benjamin1 on Oct 13, 2008 20:17:52 GMT -5
Hi,
I'm trying to use the graphic commands like this.
#myDrawing font(variable$,10)
but it does not work, get a syntax error. Is there a way to get this to work?
variable$ being the name of a font
|
|
|
Post by Janet on Oct 13, 2008 20:28:22 GMT -5
Are you using a valid font name, because this works:
'create a graphic object graphic #g, 600,400
variable1$ = "courier new" 'assign a font to graphic object #g font(variable1$, 24) 'place the drawing pen #g place(20,100)
' select a color #g color("blue")
'print text in font #g "\This is Courier New"
variable2$ = "times new roman" 'assign a font to graphic object #g font(variable2$, 14, "italic") 'place the drawing pen #g place(20,150)
' select a color #g color("red")
'print text in font #g "\This is Times New Roman Italic"
'display on web page render #g
|
|
|
Post by benjamin1 on Oct 13, 2008 20:46:22 GMT -5
Ok,
thats probably it, I'm on linux and I picked a font name out of my Openoffice font list. I guess RB does not have access to those fonts? what fonts does RB have access to is there a list?
|
|
|
Post by Janet on Oct 13, 2008 20:53:20 GMT -5
Post your code. I think your error is not in the actual name of the font but elsewhere.
|
|
|
Post by benjamin1 on Oct 13, 2008 21:57:32 GMT -5
Janet,
Hi, here is the code, nothing complex, I always keep things simple, but still hit bumps in the road.
[makenewcard] cls print "Make New Card."
html "<table border=""2"" width=""70%"" cellspacing=""5""
cellpadding=""0"" summary=""Make New Card"">"
html "<tr>" html "<th>":print "Title: ":html "</th>" html "<th>":textbox #ctitle,ctitle$:html "</th>" html "</tr>"
html "<tr>" html "<th>":print "Text:":html "</th>" html "<th>":textarea #ctext, ctext$:html "</th>" html "</tr>"
html "<tr>" html "<th>":print "Font Name:":html "</th>" html "<th>":textbox #cfontname, cfontname$:html "</th>" html "</tr>"
html "<tr>" html "<th>":print "Text Size:":html "</th>" html "<th>":textbox #cfontsize, cfontsize$:html "</th>" html "</tr>"
html "<tr>" html "<th>":print "Text Color:":html "</th>" html "<th>":textbox #ctextcolor, ctextcolor$:html "</th>" html "</tr>"
html "<tr>" html "<th>":print "Background:":html "</th>" html "<th>":textbox #cgraphic, cgraphic$:html "</th>" html "</tr>"
html "<tr>" html "<th>":print "Music:":html "</th>" html "<th>":textbox #cmusic, cmusic$:html "</th>" html "</tr>"
html "<tr>" html "<th> Continue </th>" html "<th>":link #continue1,"Next Step",[nextstep]:html "</th>" html "</tr></table>"
wait
[nextstep] ctitle$=#ctitle contents$() ctext$=#ctext contents$() cfontname$=#cfontname contents$() cfontsize$= #cfontsize contents$() ctextcolor$=#ctextcolor contents$() cgraphic$=#cgraphic contents$() cmusic$=#cmusic contents$()
cls graphic #myDrawing, 300, 300 #myDrawing fill("Pink") #myDrawing font (cfontname$,10) #myDrawing color(ctextcolor$) #myDrawing place(50, 10) #myDrawing "\";ctitle$ #myDrawing place(50,40) #myDrawing "\";ctext$ render #myDrawing wait
|
|
|
Post by benjamin1 on Oct 13, 2008 22:10:51 GMT -5
of course after I posted this I seen my error. I had a space between the font and it's parameters. Sorry bout that. It does bring up another question though.
If I'm serving an RB program, are the availiable fonts determined by whats on the server or whats on the users pc? Also, is RB limited in it's font use as LB is in that it can only use true type fonts? Please correct me if i'm wrong.
|
|
|
Post by StefanPendl on Oct 14, 2008 2:06:03 GMT -5
The graphic is rendered on the server, so the fonts of the server are used.
GRAPHIC instructs the server to create an image in memory. RENDER instructs the server to save the image to the public folder and add an image HTML tag to the displayed page.
The page is finally rendered on the client, so the fonts of the client take effect here.
LB/RB can use any installed font and is not limited to TTF.
|
|