Page 1 of 1

AddTextToPath(), PathToBrush() and TextOut()

Posted: Tue Aug 12, 2025 5:47 pm
by Flinx
Hi,
AddTextToPath() in combination with PathToBrush() affects the text output by TextOut(), but only the characters that have not yet been used. This looks like a bug to me.

Code: Select all

@DISPLAY {Width = 800, Height = 400, Layers = True}
SetFont(#SANS, 160, {Loader=inbuilt})
TextOut(50, 50, "AB")

Local pid1=StartPath(Nil)
MoveTo(pid1, 0, 0)
AddTextToPath(pid1, "x")
ClosePath(pid1)
PathToBrush(1, {{ID=pid1, X=0}})
FreePath(pid1)
FreeBrush(1)

TextOut(300, 50, "A")
TextOut(400, 50, "B")
TextOut(500, 50, "C")
TextOut(600, 50, "D")
TextOut(300, 200, "ABCD")
WaitLeftMouse
Ralf

Re: AddTextToPath(), PathToBrush() and TextOut()

Posted: Wed Aug 13, 2025 10:18 am
by Flinx
By the way, the difference with the characters already used does not occur with €. No cache for code points?

Re: AddTextToPath(), PathToBrush() and TextOut()

Posted: Sat Aug 23, 2025 10:19 pm
by airsoftsoftwair
Flinx wrote: Tue Aug 12, 2025 5:47 pm AddTextToPath() in combination with PathToBrush() affects the text output by TextOut(), but only the characters that have not yet been used. This looks like a bug to me.
Yep, definitely. Will be fixed. Calling FreeGlyphCache() might help to work around it but it's definitely a bug. Thanks for reporting!
By the way, the difference with the characters already used does not occur with €. No cache for code points?
Yes, for memory efficiency reasons only characters < 256 are cached.

Re: AddTextToPath(), PathToBrush() and TextOut()

Posted: Sat Sep 20, 2025 2:08 pm
by airsoftsoftwair

Code: Select all

- Fix: Using text functions of the inbuilt vectorgraphics library and the text library (using the inbuilt
  vector text renderer) at the same time messed up the font size