Page 1 of 1

Multibyte character text output with GDI+ canvas

Posted: Wed Jul 30, 2008 10:02 am
by 10546890
When using the GDI+ canvas and outputting e.g., Chinese text, there are garbage characters shown after the text. This was tested with TeeChart 8.02.
Normal GDI canvas works ok, single byte text works ok.

The problem seems to be in TeeGDIPlus.pas at the end of the routine TextOut.
There the call to FGraphics.DrawString has a parameter Length(Text), which is only correct for single-byte strings.
The problem can be solved by replacing
Length(Text)
with
ByteToCharLen(Text, Length(Text))

Hopefully this issue can be fixed to the upcoming version.

Posted: Wed Jul 30, 2008 12:41 pm
by narcis
Hi tsiipola,

Thanks for your report. We will try to implement this for the next maintenance release. However, we will have to be very careful as this may break Unicode compatibility for next Delphi "Tiburón".