write a text in vertical way ?
[1/3] from: sdidierjean::yahoo::fr at: 10-Apr-2002 10:43
Hello,
I would like to know if it's possible to write a text
in vertical way.
What I want to do is to write a text for each value of
a table, but the text is too large. See the example of
what I want to do below.
I also don't understant why I can't change the
font-size option of the text in this draw fonction.
Thanks in advance for your help.
Stéphane
REBOL []
statistiques: layout/size [
tableau: box 550x500 coal effect [ draw [] ]
appel: button "Appel" [
clear tableau/effect/draw
for i 1 40 1 [
j: i * 10
k: i * 10 + 10
emp1: to-pair reduce [j random 470]
emp2: to-pair reduce [k 470]
append tableau/effect/draw reduce [
'fill-pen 'blue
'box emp1 emp2 'white
'text emp2 "text"
;This don't work ->
'text emp2 'font-size 5 "text"
]
]
show tableau
]
] 600x600
inform statistiques
[2/3] from: greggirwin:mindspring at: 10-Apr-2002 10:38
Hi Stephane,
<< I also don't understant why I can't change the
font-size option of the text in this draw fonction. >>
I haven't gone through your code to answer the first question, but DRAW
doesn't support a font-size attribute AFAIK. You need to set a complete FONT
object for use. Easy Draw contains an example of how to do it. Holler if you
can't find it.
--Gregg
[3/3] from: oliva:david:seznam:cz at: 10-Apr-2002 21:03
Hello Stéphane,
Wednesday, April 10, 2002, 10:43:37 AM, you wrote:
SD> Hello,
SD> I would like to know if it's possible to write a text
SD> in vertical way.
SD> What I want to do is to write a text for each value of
SD> a table, but the text is too large. See the example of
SD> what I want to do below.
SD> I also don't understant why I can't change the
SD> font-size option of the text in this draw fonction.
SD> Thanks in advance for your help.
SD> Stéphane
SD> REBOL []
SD> statistiques: layout/size [
SD> tableau: box 550x500 coal effect [ draw [] ]
SD> appel: button "Appel" [
SD> clear tableau/effect/draw
SD> for i 1 40 1 [
SD> j: i * 10
SD> k: i * 10 + 10
SD> emp1: to-pair reduce [j random 470]
SD> emp2: to-pair reduce [k 470]
SD> append tableau/effect/draw reduce [
SD> 'fill-pen 'blue
SD> 'box emp1 emp2 'white
SD> 'text emp2 "text"
SD> ;This don't work ->
SD> 'text emp2 'font-size 5 "text"
SD> ]
SD> ]
SD> show tableau
SD> ]
SD> ] 600x600
SD> inform statistiques
This is not solution for your problem (i'm not a draw guru), but you should rather use
'compose instead of 'reduce:
compose [
fill-pen blue
box (emp1) (emp2) white
text (emp2) "text"
text (emp2) font-size 5 "text"
]
It's a little bit faster bacause it evaluates only parens...
>> t1: now/time/precise loop 5000000 [reduce ['number random 100]] t2: now/time/precise
t2 - t1
== 0:00:12.959
>> t1: now/time/precise loop 5000000 [compose [number (random 100)]] t2: now/time/precise
t2 - t1
== 0:00:12.067