Code: Select all
If PrintRequester()
If StartPrinting("PureBasic Test")
LoadFont(0, "Arial", 30)
LoadFont(1, "Arial", 100)
If StartVectorDrawing(PrinterVectorOutput(#PB_Unit_Pixel)) ; fonts are not scaled properly in unit_pixel mode.
VectorFont(FontID(0))
MovePathCursor(100, 100)
DrawVectorText("PureBasic Printer Test")
VectorFont(FontID(1))
MovePathCursor(100, 400)
DrawVectorText("PureBasic Printer Test 2")
AddPathBox(200, 200, 100, 100)
VectorSourceColor(RGBA(255, 0, 0, 255)) ; Draw a red box
StrokePath(10)
StopVectorDrawing()
EndIf
StopPrinting()
EndIf
EndIf
See:

compared to this if you use "StartVectorDrawing(PrinterVectorOutput(#PB_Unit_Point))"...

For images it works as you would expect:
Code: Select all
UsePNGImageEncoder()
CreateImage(0,1000,1000,32,RGB($ff,$ff,$ff))
LoadFont(0, "Arial", 30)
LoadFont(1, "Arial", 100)
If StartVectorDrawing(ImageVectorOutput(0,#PB_Unit_Pixel)) ; fonts are not scaled properly in unit_pixel mode.
VectorFont(FontID(0))
MovePathCursor(100, 100)
DrawVectorText("PureBasic Printer Test")
VectorFont(FontID(1))
MovePathCursor(100, 400)
DrawVectorText("PureBasic Printer Test 2")
AddPathBox(200, 200, 100, 100)
VectorSourceColor(RGBA(255, 0, 0, 255)) ; Draw a red box
StrokePath(10)
StopVectorDrawing()
EndIf
SaveImage(0,"pixelimage.png",#PB_ImagePlugin_PNG)

Here it is when drawn as points:
