
-----------------------------------
cinnamonhugs
Sun Apr 02, 2006 12:12 am

Draw.Text
-----------------------------------
why doesnt this work?

var font : int
        font := Font.New ("serif:12")
        assert font1 > 0
        var width : int:= Font.Width ("This is in a serif font", font)
        var height, ascent, descent, internalLeading : int
        Font.Sizes (font, height, ascent, descent, internalLeading)
        Draw.Text ("This is in a serif font", 50, 30, font, red)
        Draw.Box (50, 30 + descent, 50 + width, 30 + height, brightblue)
        Font.Free (font)

-----------------------------------
Delos
Sun Apr 02, 2006 12:15 am


-----------------------------------
You have been warned before to use [code] tags.  Please start doing so you will face consequences for not following simple rules.

As for your question.  Please be more specific.  What part about it is not working?  The fact that "font1" has not been declared?  Or that the box does not draw correctly?  Or the colours are wrong...?  What is it.

-----------------------------------
HellblazerX
Sun Apr 02, 2006 11:40 am


-----------------------------------
 assert font1 > 0

you misspelled your variable.  It should be just font.

-----------------------------------
Clayton
Wed Apr 05, 2006 6:36 pm


-----------------------------------
wut exactly does assert do anyway?

-----------------------------------
Cervantes
Wed Apr 05, 2006 7:03 pm


-----------------------------------
It asserts (makes sure) that a given condition is true (not false). If it isn't true (is false), it exits the program.
