-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Scaled login screen #2341
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
matt335672
force-pushed
the
scaled_login_screen
branch
from
September 6, 2022 08:36
9bfa095
to
8036c64
Compare
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
force-pushed
the
scaled_login_screen
branch
from
September 6, 2022 08:42
8036c64
to
e448797
Compare
Merged
@matt335672 Can you share some screenshots? The PR itself LGTM. |
I'll add something to the wiki - it will help in the future I think. |
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. |
Thanks! |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:-
--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.