Jump to content
Software FX Community

CFX98: Font does not scale when Paint() is called?


User (Legacy)
 Share

Recommended Posts

Hi, (CFX98 4.0.18.0, VC++ 6, ATL, WTL, Windows 9x+)

I do have problem when calling the Paint(). The font

which is used for labeling axes (I did not try other

fonts) does not scale for different device context

while the chart does.

To be more exact, I did create the instance of the

ChartFX 98, filled it with some data, and painted it

using given device context (as follows):

spChartFX->OpenDataEx(ChartfxLib::COD_VALUES, 2, 3);

spChartFX->GetSeries()->GetItem(0)->PutYvalue(0, 500);

spChartFX->GetSeries()->GetItem(0)->PutYvalue(1, 600);

spChartFX->GetSeries()->GetItem(0)->PutYvalue(2, 700);

spChartFX->GetSeries()->GetItem(1)->PutYvalue(0, 800);

spChartFX->GetSeries()->GetItem(1)->PutYvalue(1, 900);

spChartFX->GetSeries()->GetItem(1)->PutYvalue(2, 1000);

spChartFX->CloseData(ChartfxLib::COD_VALUES);

spChartFX->Paint(reinterpret_cast<long>(dc),

rc.left, rc.top,

rc.right, rc.bottom,

ChartfxLib::CPAINT_PRINT, 0);

The device context uses MM_ANISOTROPIC mapping mode.

The logical coordinates are in 1/100 of mm. The

ViewportExt and WindowExt are set differently for a

display and for various printers to obtain 1:1

visual appearance. The auxiliary ruler marks and

some text (painted using the device context) show

that the mapping works as desired both on the

display and on the tested printers.

The chart displayed by Paint() fills correctly the

given rectangular area leaving only some (expected)

small margins. However, the font on 300 DPI printer

is very small. The chart fills the given rectangle

correctly again. In other words, the ratio between

the font size and the chart-box size changes.

I tried to choose a different font name and size,

but the problem remains.

I have noticed that when an extremely big size of

font was used, the chart component created less

marks on Y axis (expected and nice behaviour). Let

us say, only 3 labels were visible on the display.

However, using the device context for the 600 DPI

printer, the same font appears much smaller, thus

the number of labels on Y axis was increased (let's

say from 3 to 10 -- I did not count them).

It seems that the Paint() method calculates

font sizes in device dependent units instead of

logical units.

I assume that the desired behaviour of the Paint()

should be to display the same result (regarding

proportions) with different device context.

Could you comment this? Is it a bug?

Thanks,

Petr

--

Petr Prikryl, SKIL s.r.o., e-mail: prikrylp at skil dot cz

Please, don't reply via e-mail.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...