Stretched text in metafile

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Cantor AS
Newbie
Newbie
Posts: 3
Joined: Thu Jun 09, 2011 12:00 am

Stretched text in metafile

Post by Cantor AS » Thu Jun 23, 2011 9:34 am

Hi, there is a problem with how metafiles are used within TeeChart, that will make the text look wrong (stretched, overlapping characters) in some cases. The problem pops up when the application is running on some kind of virtual environment (VirtualBox, Citrix, Terminal services, etc.), where that environment has a screen resolution different from that in the host environment (client PC). The problem is the same in QuickReport, which is based on metafiles. There, the problem has been solved by calling "SetMapMode(FMetafile.Handle, MM_ANISOTROPIC)". I assume that making the same call within TeeChart will solve the problem, but haven't tried. Probably the call should be placed at the end of "Function TCustomTeePanel.TeeCreateMetafile".

For more info on the problem, read/translate the last post here: http://forum.delphi-treff.de/showthread ... zerrt-Text

Regards, Cantor AS

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

Re: Stretched text in metafile

Post by Narcís » Thu Jun 30, 2011 8:35 am

Hi Cantor AS,

First of all I'd like to apologise for the delayed reply.

Does this occur in any specific circumstances besides what you explained of virtual environments? Could you arrange a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
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

Cantor AS
Newbie
Newbie
Posts: 3
Joined: Thu Jun 09, 2011 12:00 am

Re: Stretched text in metafile

Post by Cantor AS » Thu Jul 07, 2011 2:31 pm

Hi, I don't think there is any way to make the behaviour appear without using some sort of virtualization. Maybe the easiest way to test this is to set up a vurtual machine using VirtualBox. You would need (some time and) a copy of Windows to set it up - I don't know if you have to register Windows if you just want to test this and throw it away. I think also there are trial version of Windows available from Microsoft.

Then, you only need a clean TChart with some text, a button to invoke the a TChartEditor, and use the built in export to metafile. Then you should see how the text looks in QuickReport. I have tested a fix for this today, that seems to work. In TeeCreateMetafile, add the folowing line after the TMetafileCanvas is created:

SetGraphicsMode(tmpCanvas.Handle, GM_ADVANCED);

Regards, Cantor AS

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Stretched text in metafile

Post by Yeray » Tue Jul 12, 2011 10:24 am

Hello Cantor,
Cantor AS wrote:Hi, I don't think there is any way to make the behaviour appear without using some sort of virtualization. Maybe the easiest way to test this is to set up a vurtual machine using VirtualBox. You would need (some time and) a copy of Windows to set it up - I don't know if you have to register Windows if you just want to test this and throw it away. I think also there are trial version of Windows available from Microsoft.

Then, you only need a clean TChart with some text, a button to invoke the a TChartEditor, and use the built in export to metafile. Then you should see how the text looks in QuickReport.
We'd need to know some extra details if we want to try a similar environment to the one where you found the problem. And after reproducing the problem we may be able to generalize trying slightly different environments. So please, tell us in what virtual environment did you find the problem, what Windows version, if it is 32 bit or 64 bit, what IDE was and what TeeChart and QuickReport versions were you using as well.
Cantor AS wrote:I have tested a fix for this today, that seems to work. In TeeCreateMetafile, add the folowing line after the TMetafileCanvas is created:

SetGraphicsMode(tmpCanvas.Handle, GM_ADVANCED);
I'm glad to hear that! :)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Cantor AS
Newbie
Newbie
Posts: 3
Joined: Thu Jun 09, 2011 12:00 am

Re: Stretched text in metafile

Post by Cantor AS » Tue Jul 12, 2011 1:53 pm

I have seen this on a lot of different environments (VirtualBox, Citrix, MS Terminalserver, MS Virtual PC ++), however, today I discovered a much easier way for you to test this: Remote Desktop. I connected to a machine running Windows 7 Professional 64-bit, from a machine running the same. I set the resolution of the remote desktop very wide to easily see the problem by using the commandline /console /w:1600 /h:800.

The sample application I use to test this is very simple, and contains only one TChart, one TChartEditor, and one TButton. Run the application, push the button to execute the editor, go to Export, select "as Metafile", push Preview, and you should see that the title of the chart, "TChart", doesn't look good. The characters are not spaced correctly, sometimes overlapping. This is also how it looks in QuickReport, and generally whenever charts are saved to metafiles.

I use Delphi XE with all updates and the latest TeeChart (2011.03.30407). QuickReport is not involved in this sample.

Regards, Cantor AS

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Stretched text in metafile

Post by Yeray » Tue Jul 12, 2011 3:46 pm

Hello Cantor,

I could reproduce it with a very width screen (I used the command "mstsc.exe /w:2500 /h:800") so I've added it to the wish list to be investigated in future releases (TV52015656).

Thanks for reporting it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply