I'm creating a window that fits my text which is drawn using 2D functions. but when the text is italic the text width is incorrect.
Here is the code:
Code: Select all
OpenWindow(0,10,10,100,100,"Test")
LoadFont(1,"Lucida Handwriting",25,#PB_Font_Bold|#PB_Font_Italic)
StartDrawing(WindowOutput(0))
DrawingFont(FontID(1))
height=TextHeight("OMG HI! :D")
width=TextWidth("OMG HI! :D")
ResizeWindow(0,10,10,width,height)
DrawText(0,0,"OMG HI! :D",1)
StopDrawing()
Repeat
Event=WaitWindowEvent()
Until Event=#PB_Event_CloseWindow

Can anyone please help?
