I am trying to get the vector text "Hi" to display on the canvas gadget, but the canvas remains empty.
What is the least change I must make to the program to get it to work correctly?
Because LoadFont() measures the height in Points, while VectorFont() measures the height in the unit of the drawing output (for the CanvasGadget, the default is pixels). So VectorFont(FontID(0), 20) sets the height to 20 pixels in this case.
I solved the issue by using vectordrawing in mm on the canvas gadget and then when using the font I took the font size in points and converted to mm.
As an example using VectorFont(FontID(0), 20) will print text 20mm high/width on the canvas gadget with #PB_Unit_Millimeter used on the canvas so as the font is measured in points convert the '20 points' to mm each point is 1/72 of an inch so a simple conversion is possible. Then use VectorFont(FontID(0), (20 * conversion factor)) which will display and print at the normalish 20 point size.
You can use #PB_Unit_Point but then all measurements from that point on are in points. The #PB_Unit_Pixel one can give strange results as it is in DPI of the screen etc or the printer if using these functions for printing so become device dependent.
Check out the print and print preview post to see an example.
Hope this helps a bit.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.