Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [SOLVED]XAML Text quality
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED]XAML Text quality

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (2) Thanks(2)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED]XAML Text quality
    Posted: 26 May 2016 at 5:15pm
when we changed from CJ 16.3.1 to 17.2 we noticed that text rendered in XAML was poor quality.  I took a look at the code differences, but there were a lot of changes so not easy to directly compare.

However, we did fix the text quality issue by adding a line of code.  I've seen others post about this, so they can maybe patch their CJ or whatever.

in file XTPMarkupGdiPlusDeviceContext.cpp 

function void CXTPMarkupGdiPlusDeviceContext::Init(BOOL bReInit /*= FALSE*/)

I added

m_pGdiPlus->GdipSetTextRenderingHint(GetGraphics(), TextRenderingHintClearTypeGridFit);

After the call to ApplySmoothingMode()

Cheers

Adrien

Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2016 at 4:56am
Hello,

I'm glad to inform you that the issue has already been fixed. The fix will be available in the next beta or final release.
Please, see example MarkupPad.exe in it demonstrated how to use this option.

Regards,
Artem Gontarenko
Back to Top
Fredrik View Drop Down
Senior Member
Senior Member


Joined: 22 June 2005
Status: Offline
Points: 235
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fredrik Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2016 at 9:42am
Hi, I'm currently patching v17.2 to be able to use it (can no longer wait for next version): is the fix for this issue to call m_pGdiPlus->GdipSetTextRenderingHint(GetGraphics(), TextRenderingHintClearTypeGridFit) ?

For us it had an opposite effect causing bad quality text in other places. Also, I read from the documentation (https://msdn.microsoft.com/en-us/library/ms535817(v=vs.85).aspx?f=255&mspperror=-2147217396) that TextRenderingHintClearTypeGridFit is only supported on Windows XP and Windows Server 2003?

Regards, 
Fredrik
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 05 October 2016 at 10:17pm
Hi

I see your point, however it seems to work for us on Windows 10, 8, 2k8 etc.  We don't support XP, so didn't even test on that.

You could try a different enum value.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.