~mil/sxmo-tickets#193: 
DPI setting and UI size- a suggestion

Having tried both the SXMO images and the PMOS build on their site I find non-Sxmo applications and scripts (for example, Firefox and Foxtrotgps) suffer from the tiny size of their UI and dialogs, which is caused by Xorg insisting on defaulting to 96dpi as the screen resolution.

In Firefox, for example, the UI Chrome and URL field is so small that I can't read a URL when typing it, and the 'tab close' marker is so small that I find it impossible to close a tab once opened- a combination of fat fingers and long sightedness at the distance I have to put the phone to place 'taps' accurately. Foxtrotgps is similar.

I also found the font appearance was not particularly good, probably because the antialiasing calculations are messed up with such a large gap between assumed and real dpi.

So, as an experiment, I set about forcing a different dpi setting to balance these applications up with the rest of the SXMO UI.

In the Xorg log it shows a calculated screen size of 190 x 381 mm. SXMO devs have compensated for this by setting defaults in config.h and scripts that are artificially large, for example 30 point, to get a 'real' on screen text size fo something like 11 or 12 points.

The native resolution of the Pinephone screen is 268 dpi, and this is what I tried initially. However, I found this makes the FF UI look unreasonably large on a small portrait screen, and chops off most of the menu bar. So I by experiment I found 192dpi (2x the Xorg default) is a better compromise- readable text and tab size matching the DWM status bar, readable menu size.

Of course the font sizes in the SXMO components  have to be adjusted to match- mostlly by halving them, as does the XDM dpi setting, using xrandr. Xdm dpi needs adjusting because svkbd runs both in the xdm and dwm environment.s

Simple X applications like Xcalc also get sane font sizes by default, rather than the incredibly tiny fonts in the stock image. I found that adjusting the Xcalc font size in the Xresources file does not work, for some reason.

In order to change the dpi size consistently, in addition to adjusting the font sizes in the various sxmo components, I found the following are needed:

/usr/lib/X11/xdm/Xsetup_0: add 'xrandr --dpi 192'

/usr/share/X11/xorg.conf.d/90-monitor.conf:

Section "Monitor"

    Identifier "DSI-1"

    DisplaySize  95 190

EndSection

~/.Xresources containing

Xft.dpi: 192

Xft.antialias: true

Xft.rgba: rgb

Xft.hinting: true

Xft.hintstyle: hintslight

Maybe my near-field eyesight and taste for font sizes is not the same as younger or users desiring more text on screen at a time. However, I find the balance between Dmenu font size, status bar size and the UI of GTK applications like Firefox to be more pleasing and much more usable. The same applies to PMOS applications like Pure Maps.

One more comment on UI appearance: the use of Monospace fonts in SXMO menus and scripts does mean that the number of characters displayable is fewer than they would be with a Proportional font like Sans, which seems unintuitive given the tall and narrow screen. I tried changing fonts to Sans and found the menus more readable as a result.

I'm not sure if images will attach to this list but I am attempting to add a full-res screenshot so you can see what I mean. Maybe you will consider making some dpi adjustments in the next release.

Finally, apologies for not submitting these suggestions as patches, I have yet to work out how to submit patches using git email.

Chris

2021-03-02-193318_720x1440_scrot.png

Status
RESOLVED IMPLEMENTED
Submitter
Chris Billington
Assigned to
Submitted
4 months ago
Updated
3 months ago
Labels
feature ready

~proycon 4 months ago

Thanks for your extensive investigation and suggestions. We'll indeed have to dive into it. I still have to study the details you mentioned but it would indeed help if you could share the screenshots you made, it didn't come through. (perhaps use an image hoster like https://imgur.com/)?

--

Maarten van Gompel (proycon) https://proycon.anaproy.nl

Chris Billington 4 months ago · edit

Image at https://postimg.cc/r0cTZJTb with Firefox content zoom set to 100%

On 02/03/2021 20:37, ~proycon wrote:

Thanks for your extensive investigation and suggestions. We'll indeed

have to dive into it. I still have to study the details you mentioned

but it would indeed help if you could share the screenshots you made, it

didn't come through. (perhaps use an image hoster like

https://imgur.com/)?

--

Maarten van Gompel (proycon)

https://proycon.anaproy.nl

~emulti referenced this from #194 4 months ago

~anjan 4 months ago

From the outset, this change looks good. The next step is to prepare a patch that sxmo users can apply so that we can test multiple X11 applications.

~proycon referenced this from #205 4 months ago

~tetrakist 4 months ago

This has been implemented in set of two patches:

https://lists.sr.ht/~mil/sxmo-devel/patches/20884 - sxmo-utils

https://lists.sr.ht/~mil/sxmo-devel/patches/20885 - sxmo-xdm-config

Thanks to Chris for the efforts in getting this working.

What remains, at this point, is largely specifying appropriate font sizes for apps -- dwm, dmenu, etc., which should be made all the easier with the incoming Xresources patches.

-- tetrakist

~emulti 4 months ago

Thank you ~tetrakist for creating the patches. Now I see how you handle the newly-created files. If others want to test, I am using font size in svkbd config.h of fontsize=7 and DejaVu Sans:bold:size=10

And Dmenu font size in xresources_dmenu.xr of Monospace-12 (or Sans-12 to get more characters per line in RSS script, for example)

In Dwm config.h I am using

    "sans size=9", /* PP default start index*/

and

  static const char dmenufont[]     =    "Sans:size=12";

This gives a better font size/spacing match to the Firefox chrome UI fonts just below the status bar, and more readable characters per line on the status bar for page titles etc. I am not clear whether the dmenufont[] value is overridden by the Xresources_dmenu.xr setting and I haven't figured out how to adjust the size of Dmenu 'icon' characters from nerd-fonts yet.

The extra blank lines I put by mistake in 90-monitor.conf and xresources_xft..xr have crept through into the patches, sorry. The comment line in 90-monitor.conf should/could read

# Technically should be: DisplaySize 68 136, but this reduces menu bar cropping on narrow screen

~proycon REPORTED IMPLEMENTED 3 months ago

Register here or Log in to comment, or comment via email.