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

Scaled login screen #2341

Merged
merged 9 commits into from
Sep 6, 2022
Merged

Conversation

matt335672
Copy link
Member

This PR adds a scaling capability to the login screen, so that it is actually readable on high DPI (or 'retina') displays.

The DPI value for the login screen can be obtained from the client when running in a full-screen mode. If the session is
set to less than the full screen size, the DPI value cannot be calculated and behaviour is the same as current behaviour.

An additional font sans-18.fv1 is added to the distribution for higher DPI screens.

Also of note; the Windows utility to build font files has been replaced with two native UNIX utilities:-

  • xrdp-dumpfv1 : Display contents of an fv1 font file
  • xrdp-mkfv1 : Create new fv1 font files (only available if xrdp is built with --with-freetype2).

The user is able to generate their own fv1 font files and configure the system to use them, if required.

See discussion #2280 for a history of this PR, and the initial request from @HubKing.

@TOMATO-ONE has provided some excellent testing and feedback during the development of this PR.

Future work could involve using the freetype2 library to load truetype fonts directly. This would allow us to add anti-aliasing and kerning to the login screen.

The font body height is now explicitly stored in the font
structure. This is the definition that would be used for manual
typesetting (i.e. the line spacing). This is used for calculating
the heights of strings.

The window title header has also been increased by 3 pixels from a
hard-coded 18 to (font_height + 5), which now equates to 21 pixels
with the sans-10.fv1 font.
To generate new fonts, the freetype2 library is required. This
can now be specified by configure in the usual way. If it's missing,
new fonts cannot be generated.
The previous commit added utilities which work with fv1 files
with additional fields in the fv1 header (i.e. body_height and
min_descender). This commit makes minor changes to the font loading code
in xrdp so xrdp can read the new font format.
The dimensions from xrdp.ini are replaced with scaled and unscaled
versions. The unscaled versions are read from the config file, and
then scaled to match the loaded font.

Currently this has no significant effect, as the same font is still
loaded, so the scaling factor is 1.00. However, when a different font
is loaded, the login window can be made larger for use on higher DPI
monitors.
This commit adds the variables fv1_select and default_dpi to
xrdp.ini. These variables allow for a different font to be
loaded, depending on the DPI of the login screen.
Replace sans-10.fv1 with a modern version generated with the
new tools.
Also add a sans-18.fv1 for higher DPI monitors.
@matt335672 matt335672 merged commit 7354eb6 into neutrinolabs:devel Sep 6, 2022
@matt335672 matt335672 deleted the scaled_login_screen branch September 6, 2022 08:48
@matt335672 matt335672 mentioned this pull request Sep 6, 2022
@metalefty
Copy link
Member

@matt335672 Can you share some screenshots? The PR itself LGTM.

@matt335672
Copy link
Member Author

I'll add something to the wiki - it will help in the future I think.

@matt335672
Copy link
Member Author

https://github.com/neutrinolabs/xrdp/wiki/Scaleable-login-screen on the Wiki contains some shots of the login box, and answers some questions users may have.

@metalefty
Copy link
Member

Thanks!

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.

None yet

2 participants