Tested PB561 OS 10.12 - 10.13
Meanwhile, I assume a PB bug
It can be very unpleasant and strange for text length calculations
With nearly any text, the difference is approximately one character width
Code: Select all
CreateImage(1, 300, 100)
OpenWindow(1, 0, 0, 300, 100, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StartDrawing(ImageOutput(1))
Debug TextWidth("Hello World")
twidth=TextWidth("H")+TextWidth("e")+TextWidth("l")+TextWidth("l")+TextWidth("o")+
TextWidth(" ")+TextWidth("W")+TextWidth("o")+TextWidth("r")+TextWidth("l")+TextWidth("d")
Debug twidth
Box(0, 0, twidth, 20, $FF)
DrawText(0, 0, "Hello World")
StopDrawing()
ImageGadget(1, 0, 0, 0, 0, ImageID(1))
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow