Multibyte character text output with GDI+ canvas
Posted: Wed Jul 30, 2008 10:02 am
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.
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.