Opened 3 months ago

Closed 3 months ago

#18608 closed defect (outdated)

Text scale on HiDPI display using Direct2D renderer

Reported by: Kerber Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 3.1.2
Keywords: Cc: daivan97@…
Blocked By: Blocking:
Patch: no

Description

I have 4K screen (3840x2160) and scaling set to 200% in Windows. When I use GDI or GDI+ to draw text it looks fine and scales as needed, but when I use wxGraphicsContext (or wxGCDC) with Direct2D backend the text is drawn with 100% scale. Images are drawn with correct size. Only text is affected.

GDI:
https://jpegshare.net/images/79/65/7965e39b387ac0d2db203617cbe54654.png

Direct2D:
https://jpegshare.net/images/02/69/02693c3a249477b02628e99e3fff27fa.png

Direct2D (with image):
https://jpegshare.net/images/27/31/2731190910f3eda53d59f09aa93ab205.png

Is there a way to fix that? Scintilla draws text with proper scaling when I set it to wxSTC_TECHNOLOGY_DIRECTWRITE.

Attachments (3)

GDI.png download (45.1 KB) - added by Kerber 3 months ago.
GDI
Direct2D.png download (27.5 KB) - added by Kerber 3 months ago.
Direct2D
Direct2D (with image).png download (74.2 KB) - added by Kerber 3 months ago.
Direct2D (with image)

Download all attachments as: .zip

Change History (8)

Changed 3 months ago by Kerber

GDI

Changed 3 months ago by Kerber

Direct2D

Changed 3 months ago by Kerber

Direct2D (with image)

comment:1 Changed 3 months ago by Kerber

  • Cc daivan97@… added

comment:2 Changed 3 months ago by vadz

  • Status changed from new to infoneeded_new

If the 3.1.2 version is correct, the first thing to do would be to retry with 3.1.3 or latest master as there were a lot of DPI-related improvements in 3.1.3.

If you still see the problem with 3.1.3, could you please check if it appears in the drawing sample (you can choose Direct2D renderer in it)?

comment:3 Changed 3 months ago by Kerber

  • Cc daivan97@… removed
  • Status changed from infoneeded_new to new

I didn't knew there is 3.1.3 already. I'll try new version and the sample.

comment:4 Changed 3 months ago by Kerber

  • Cc daivan97@… added

It seems that 3.1.3 fixed that issue. On 3.1.2 issue manifested only with
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE, DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE and DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 options for SetThreadDpiAwarenessContext.

comment:5 Changed 3 months ago by vadz

  • Resolution set to outdated
  • Status changed from new to closed

OK, thanks for testing.

Note: See TracTickets for help on using tickets.