Does anybody know why following code DrawVectorText is not doing what I expect it to do ?
Documentation says: Draw the given text at the current location of the path cursor. The cursor will be moved horizontally to the end of the drawn text.
Strokepath : not working correctly
DrawVectorText : not working correctly
VectorTextWidth : not working correctly
I must be doing something wrong here ... however all of this is working correctly in PB
Code: Select all
Enumeration
#FONT_BOLD
#FONT_NORMAL
#WINDOW
#CANVAS
EndEnumeration
LoadFont(#FONT_BOLD, "Consolas", 10,#PB_Font_Bold)
LoadFont(#FONT_NORMAL, "Consolas", 10)
OpenWindow(#WINDOW,100,100,1000,100,"TEST",#PB_Window_BorderLess)
CanvasGadget(#CANVAS,5,5,990,90,#PB_Canvas_Border)
StartVectorDrawing(CanvasVectorOutput(#CANVAS))
VectorSourceColor(RGBA(255, 0, 0, 255))
MovePathCursor(50,10)
DrawVectorText("red lined yellow filled box")
AddPathBox(500,3,450,10)
StrokePath(1,#PB_Path_Preserve)
VectorSourceColor(RGBA(255,255,0, 255))
FillPath()
MovePathCursor(50,20)
VectorSourceColor(RGBA(255, 0, 0, 255)): VectorFont(FontID(#FONT_NORMAL),15): DrawVectorText("this red NORMAL text should be followed by..")
VectorSourceColor(RGBA(0, 0, 255, 255)): VectorFont(FontID(#FONT_BOLD),15): DrawVectorText("the blue BOLD text")
MovePathCursor(50,40)
VectorSourceColor(RGBA(255, 0, 0, 255)): VectorFont(FontID(#FONT_BOLD),15): DrawVectorText("this red BOLD text should be followed by..")
MovePathCursor(VectorTextWidth("this red BOLD text should be followed by.."),40)
VectorSourceColor(RGBA(0, 0, 255, 255)): VectorFont(FontID(#FONT_NORMAL),15): DrawVectorText("the blue normal text")
MovePathCursor(50,60)
VectorSourceColor(RGBA(255, 0, 0, 255)): VectorFont(FontID(#FONT_NORMAL),15): DrawVectorText("this red NORMAL text should be followed by..")
MovePathCursor(VectorTextWidth("this red NORMAL text should be followed by.."),60)
VectorSourceColor(RGBA(0, 0, 255, 255)): VectorFont(FontID(#FONT_Bold),15): DrawVectorText("the blue BOLD text")
StopVectorDrawing()