PDCurses icon indicating copy to clipboard operation
PDCurses copied to clipboard

SDL2 needs high-DPI/Retina support

Open wmcbrine opened this issue 7 years ago • 6 comments

This is a high priority for me.

wmcbrine avatar Jan 16 '18 15:01 wmcbrine

With #61 fixed - is this still an issue?

GitMensch avatar Jun 21 '21 05:06 GitMensch

Yes, this has nothing to do with #61. Much deeper stuff.

Essentially, it's the difference between fuzzy fonts (what we have) and sharp (what we would have with high-DPI support), on a high-DPI display.

wmcbrine avatar Jun 21 '21 13:06 wmcbrine

Would it be as easy as https://github.com/dosbox-staging/dosbox-staging/commit/1a289f5cd4e676937e861f7657a5162b695968ba ?

GitMensch avatar May 29 '23 21:05 GitMensch

Sadly, it would not.

wmcbrine avatar May 29 '23 22:05 wmcbrine

Just create your SDL_Surface for the screen and SDL_Window outside pdcurses and scale the SDL_Surface by a whole number. You can also choose a filter method.

dylanetaft avatar Nov 21 '23 08:11 dylanetaft

Was looking at the code. If you are using TTF fonts, just set the env variable PDC_FONT_SIZE. While not tested, it looks like you could also extern pdc_font_size and set it in your code too, it is in the global namespace.

Hidpi for bitmap fonts doesn't really make sense, you can scale without blurring though.

Otherwise looks like font size can be set. Granted, there's no way it can change dynamically looking at a glance.

dylanetaft avatar Nov 22 '23 07:11 dylanetaft