[solved] Set smoothing mode for markup cell |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
Posted: 09 October 2017 at 6:44pm |
Hi
Is it possible to set text smoothing mode for a report control cell? I've been searching for a long time, and tried using markup attributes in the markup itself (doesn't work). I don't want to have to override OnPaint to set the mode on the DC, surely there should be a way when you set up a markup context to give it information about how you want it to draw, and it pass it to the DC? Adrien
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
P.S. I want to do this because the default text rendering is very ugly and jaggy.
I'm quite disappointed that the default isn't to use a decent text rendering mode. I can't imagine anyone ever wants their text to look unaliased.
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
CXTPMarkupDrawingContext constructor (all of them) set
m_bUseTextSmooting(FALSE) are you kidding me? You need to make this accessible via the markup context so we can turn it on without patching your code.
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello adrien,
You can see how it works in our sample Samples\Utilities\MarkupPad\MarkupPadView.cpp
Regards, Oleksandr Lebed |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
Hi
the problem with this is that means I need to override OnPaint. We don't currently do that. It should be possible to set smoothing without having to override OnPaint
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
Also, that's for a markup pad view, which is your own class.
I need to get this into a report control. If I override OnPaint for CXTPReportControl I have to do a LOT of copy / paste figure out how to make it a different kind of device context (e.g. CPaintDC becomes CXTPMarkupDrawingContext etc). This is just error prone. It would be very simple since you allow setting a report control to use markup if you would allow the natural extensions of that, e.g. set smoothing. Either that or fix the broken support for the XAML font quality attributes so they actually work. If Paint() were virtual I could override it.
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
guess not, since CXTPMarkupDrawingContext doesn't derive from CDC I can't pass it into Paint.
Looks like I need to patch your DLL.
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
OK, I've spent now about a day on this.
It looks like fundamentally the report control does not support smooth text in report controls. The CXTPMarkupUIElement class has no attribute to remember text smoothing (or any smoothing) for markup report row items rendering comes down to CXTPReportRecordItem::OnDrawCaption this calls XTPMarkupMeasureElement(m_pMarkupUIElement, rcItem.Width(), INT_MAX); XTPMarkupRenderElement(m_pMarkupUIElement, pDrawArgs->pDC->GetSafeHdc(), &rcItem); There's no opportunity to set any features on the markup DC I guess I could override CXTPReportRecordItem::OnDrawCaption but Thats way too much work for such a simple task. If I'm missing something (apart from a sense of humour) please can you tell me how I can get smooth text in a derived report control class which uses markup. |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello adrien, Yes there is a really problem. I have confused CXTPMarkupDrawingContext and CXTPMarkupContext. CXTPMarkupDrawingContext is created temporary on every measuring or drawing of ReportItems with markup. So I think good solution will be setting this smoothing option to CXTPMarkupContext which more public than CXTPMarkupDrawingContext. Then every time on creating CXTPMarkupDrawingContext the smoothing option will be copied from CXTPMarkupContext. Thank you for bringing this to our attention. Regards, Oleksandr Lebed
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
The issue have been fixed by adding public methods to CXTPMarkupContext
CXTPMarkupContext::SetDefaultSmoothingMode CXTPMarkupContext::GetDefaultSmoothingMode CXTPMarkupContext::SetDefaultTextSmoothing CXTPMarkupContext::GetDefaultTextSmoothing Fix will be available in next release. |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Using in ReportSample:
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |