AddTextToPath(), PathToBrush() and TextOut()

Report any Hollywood bugs here
Post Reply
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

AddTextToPath(), PathToBrush() and TextOut()

Post 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
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

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

Post by Flinx »

By the way, the difference with the characters already used does not occur with €. No cache for code points?
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post 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.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post 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 
Post Reply