
-----------------------------------
s33nw33n
Tue Jun 13, 2006 8:02 pm

Need Help on Font Size of Numbers In Variable
-----------------------------------
Hi. 
First off, I have read the beginning of this thread : http://www.compsci.ca/v2/viewtopic.php?t=52&highlight=turing+numbers+font

However, when I use the Font.Draw, I can only use that for text. What If I want to change the font size of a number which is stored in a integer variable (firstnumber) ?

Thanks.

-----------------------------------
Clayton
Tue Jun 13, 2006 8:16 pm


-----------------------------------
change the int to a string and concatenate it into the string eg.


var mySize:int:=20
var font:int:=Font.New("times new roman:"+intstr(mySize)+":bold")
Font.Draw("This works :)",0,0,font,red)


-----------------------------------
Cervantes
Tue Jun 13, 2006 8:16 pm


-----------------------------------
Since the font size is characteristic of the font itself, you'd have to create a whole bunch of fonts.


var fonts : array 1 .. 5 of int
for i : 1 .. upper (fonts)
    fonts (i) := Font.new ("Times New Roman:" + intstr (i + 10))
end for


-----------------------------------
s33nw33n
Tue Jun 13, 2006 8:30 pm


-----------------------------------
change the int to a string and concatenate it into the string eg.


var mySize:int:=20
var font:int:=Font.New("times new roman:"+intstr(mySize)+":bold")
Font.Draw("This works :)",0,0,font,red)


Well, I was hoping that I would be able to do it without changing it into a string as I will use multiple numbers and use those numbers to add stuff etc. however, I guess I will just have to use multiple integers and strings now. 
Thanks

-----------------------------------
Clayton
Tue Jun 13, 2006 8:51 pm


-----------------------------------
intstr only changes the int in question into a string in that instance, it then reverts back to an int after that line is complete, so you dont have to worry about changing the intstr'ed variable back to a string :D
