Global.s Theta = Chr($03f4) ; Greek symbol
Global.s TheText = "This is theta: " + Theta ; Some text
OpenWindow(0, 0, 0, 200, 100, "Test") ; Let's make a window.
TextGadget(0, 10, 10, 100, 30, "") ; And a text box.
SetGadgetText(0, TheText) ; Display the text.
StartDrawing(WindowOutput(0)) ; 2D drawing
DrawText(10, 50, TheText) ; Draw the same text
StopDrawing()
Repeat ; Wait for the end.
Until WindowEvent() = #PB_Event_CloseWindow
End
What is really confusing is that my original code works as expected when compiled with SpiderBasic. You would think that both compilers would give the same results.
So I assume that in PureBasic the two functions don't use the same default font, but in SpiderBasic they do.
I think that it would be best if all text functions started out with the same default font. That makes sense.
So it may not be a bug, but I hope that this issue is addressed.
Ah OK, I don't use SpiderBasic much, but I imagine the drawing functions and gadgets are more closely related.
Back to PB:
If I recall correctly, on other OS (Mac and Linux) DrawText() won't even draw unless you call DrawingFont() first. It does not assume any default font. Maybe the PB team can clarify this.
I don't use the other OS's so I would not know. But if that is the case, then all the more reason to have the PB team look into this and help make it all more consistent.
I think that one of the great things about PB/SB is the ability to generate executables for many OS's. So we really need as much consistency as possible. I came across the "bug" I mentioned because I was trying to create a single app for Windows, Android and web. I did have to make some adjustments using "CompilerIf #PB_Compiler_OS = xx" but in all cases it was easy to understand the differences. The difference you mentioned I cannot find in the documentation, so I am grateful to you for that.
the OS font and 2D drawing font are not exactly the same as we don't use OS function to draw on our internal buffer. So it's close but not exactly the same.