DrawVectorText

Just starting out? Need help? Post your questions and find answers here.
User avatar
William Van Hoecke
Posts: 50
Joined: Tue Oct 22, 2019 12:09 pm

DrawVectorText

Post by William Van Hoecke »

Hi all,
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()
User avatar
William Van Hoecke
Posts: 50
Joined: Tue Oct 22, 2019 12:09 pm

Re: DrawVectorText

Post by William Van Hoecke »

No one any idea... please ?
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: DrawVectorText

Post by Peter »

Unfortunately I don't know the Vector commands that well, but I would say if it works in PureBasic and not in SpiderBasic, then it's a bug in SpiderBasic

Image
User avatar
William Van Hoecke
Posts: 50
Joined: Tue Oct 22, 2019 12:09 pm

Re: DrawVectorText

Post by William Van Hoecke »

Thanks Peter,
I seem to run a lot of bugs lately :evil:

I wonder, has development on SpiderBasic stopped ??
Post Reply