Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DirectWrite to render text in the status bar #897

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

reupen
Copy link
Owner

@reupen reupen commented Jun 19, 2024

#15

This makes the status bar use DirectWrite to render text rather than a mix of Uniscribe and GDI.

This brings improved text rendering, including sub-pixel positioning and improved handling of colour changes.

This includes colour font support on Windows 8.1 and newer.

@marc2k3
Copy link
Contributor

marc2k3 commented Jun 20, 2024

A couple of observations:

  1. you need a fallback for unsupported GDI fonts. If you select a raster font like Small Fonts, your logfont->dwrite font method will fail. I use Segoe UI so at least something is displayed even if it's not what the user requested.
  2. you need to handle the font size being zero or prevent your font dialog allowing it. It will crash hard right now. 😬

@reupen
Copy link
Owner Author

reupen commented Jun 20, 2024

Thanks @marc2k3 .

  1. you need a fallback for unsupported GDI fonts. If you select a raster font like Small Fonts, your logfont->dwrite font method will fail. I use Segoe UI so at least something is displayed even if it's not what the user requested.

Thanks, I'll have a look at that.

  1. you need to handle the font size being zero or prevent your font dialog allowing it. It will crash hard right now. 😬

Thanks, the exception is a small bug when the playlist lock section is shown though doing something more useful with a size of 0 will also need doing...

I probably need a better font picker really (since the current one doesn't really expose all the functionality available).

As an aside, I wouldn't be surprised if someone doesn't like the switch to DirectWrite but alas I don't really want two different ways of rendering text. I noticed it also doesn't seem to be affected by the system font smoothing or ClearType settings also so I may need to see what can be done about that...

This makes the status bar use DirectWrite to render text rather than a mix of Uniscribe and GDI.

This brings improved text rendering, including sub-pixel positioning and improved handling of colour changes.

This includes colour font support on Windows 8.1 and newer.
@reupen reupen marked this pull request as ready for review June 20, 2024 20:00
@reupen
Copy link
Owner Author

reupen commented Jun 20, 2024

Those two points are hopefully addressed now.

@marc2k3
Copy link
Contributor

marc2k3 commented Jun 20, 2024

Setting the font size to zero is not quite right?? Standard DPI / win10 if it matters.

image

edit: the font fallback is fine

@reupen
Copy link
Owner Author

reupen commented Jun 20, 2024

What does it look like in the release version? I tried to emulate the existing behaviour (and also, the status bar doesn't seem to scale with the font size at 100% DPI, but it does at other DPIs...)

@marc2k3
Copy link
Contributor

marc2k3 commented Jun 20, 2024

Ah yes, should have tested release first. Oops...

This is a toggle between default 9pt and zero...

zero

@reupen
Copy link
Owner Author

reupen commented Jun 20, 2024

Interesting size 0 still looks bigger for you with DirectWrite (the difference is marginal for me at 100% DPI...)

Anyway, this'll do for now (they'll still be plenty of time for people to give feedback 😄)

@reupen reupen merged commit f2fa4c7 into main Jun 20, 2024
6 checks passed
@reupen reupen deleted the direct-write-status-bar branch June 20, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants