Multibyte character text output with GDI+ canvas

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
tsiipola
Newbie
Newbie
Posts: 21
Joined: Tue Oct 02, 2007 12:00 am

Multibyte character text output with GDI+ canvas

Post by tsiipola » 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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jul 30, 2008 12:41 pm

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".
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply