Usual font on virtual keyboard and in terminal application.
What's the current behaviour?
MR !5540 (merged) removed font-dejavu and added font-droid. In user interfaces LXQt and MATE there is now a Unicode BMP fallback glyph of character U+23CE (return symbol) on the return key of onboard virtual keyboard and the font in the terminal looks strange.
Picture of LXQt:
Picture of MATE:
I tried to "repair" the fonts in GUI settings or by terminal commands but couldn't find a solution yet. Actually I tend to add package font-dejavu to postmarketos-ui-lxqt and postmarketos-ui-mate. Maybe someone has a better idea or knows how to get font-droid set up properly in LXQt and MATE.
Xfce4 doesn't show the problem because font-dejavu gets installed by Alpine package xfce4:
Thank you for reporting, and sorry for inconvenience.
Actually I tend to add package font-dejavu to postmarketos-ui-lxqt and postmarketos-ui-mate. Maybe someone has a better idea or knows how to get font-droid set up properly in LXQt and MATE.
What about adding font-dejavu to the dependencies of onboard upstream (Alpine Linux)?
The terminal applications are also affected. Probably there is something wrong how the font is set up or configured.
Possibly other applications are affected too but I haven't noticed any other yet.
Maybe there are two different issues, e.g. firstly font font-droid not covering the U+23CE character and secondly font match between generic name and alias name not working properly. But I don't know, this is just guessing.
On the second topic, the default generic font name for LXQt terminal qterminal seems to be "Monospace":
Checking fc-match monospace in current LXQt returns luximr.ttf: "Luxi Mono" "Regular". So it doesn't use "Droid Sans Mono" but another font "Luxi Mono" instead. In the terminal preferences I can manually change it to "Droid Sans Mono", it then looks more normal. With font-dejavu installed, fc-match monospace returns DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book", thus it chooses the "right" default.
In MATE terminal the checkbox "Use the system fixed width font" for font settings is set, which is likely generic Monospace. In current MATE fc-match monospace returns DroidNaskh-Regular-SystemUI.ttf "Droid Naskh Shift Alt" "Regular". That likely explains why the font in the MATE terminal in the picture above looks that strange.
I don't know exactly how to take influence on this default font decision. The following two links give some hints how this could be done by a config file:
Such a config file solves the issue for the terminal applications after logout and login again.
On the first topic, font-droid does provide character U+23CE:
In onboard settings -> theme -> customize theme -> labels -> the font is set to "Default". Checking fc-match default in current LXQt returns DroidSans.ttf: "Droid Sans" "Regular". Same in current MATE. Hm, that seems to be ok. With font-dejavu installed it's DejaVuSans.ttf "DejaVu Sans" "Book".
Not sure what's the issue here. The font seem to be ok. Also manually changing the font in onboard settings to e.g. "Droid Sans" doesn't solve it. Seems to be another issue, no idea yet.
So far I still think adding package font-dejavu to postmarketos-ui-lxqt and postmarketos-ui-mate would be the easiest way.
Btw I noticed that MR !5540 (merged) is supposed to install _pmb_recommends="font-twemoji"for X11 UI's like MATE and LXQt. That font didn't get installed, I don't know why. However, on the issues described above this shouldn't have an impact.
Btw I noticed that MR !5540 (merged) is supposed to install _pmb_recommends="font-twemoji"for X11 UI's like MATE and LXQt. That font didn't get installed, I don't know why.
I am unsure but _pmb_recommends may not work with subpackages.
I don't know why it doesn't work. I thought maybe the comment next to it is disturbing – but I tried building it without the comment and it didn't install the font-twemoji neither.
I have the impression _pmb_recommends works only on packages that are installed directly. If the packages get drawn in automatically, it doesn't seem to work (being installed without recommends). Instead when in pmbootstrap init explicitely naming package "pmbootstrap-base-ui-x11" in extra packages to install, "font-twemoji" get's installed too.
Maybe this should go into a separate issue report.
Add font-dejavu to the dependencies of onboard, and
Add fontconfig configuration to postmarketos-ui-(lxqt|mate)
I would make dependency chains explicit and clear if possible. However, as we may have overlooked other breakage in the default applications of LXQt ot Mate, !5638 (merged) may be indeed safer.
As mentioned in !5641 (closed), for solving the issue in the terminal a config file can be shipped. In the above example I used /etc/fonts/local.conf but that was just for a quick test. When shipping with a package, the file should go into the /etc/fonts/conf.d directory. According to the README in that directory (also available at https://gitlab.freedesktop.org/fontconfig/fontconfig/-/blob/2.15.0/conf.d/README.in), our file mapping generic->family should be in the range 60-69. I'm not fully sure on the order within that range, therefore I tried different numbers in MATE and LXQt. After a change, I reloaded the cache with sudo fc-cache --system-only and checked the order with fc-match --all monospace | less or fc-match --all monospace | head -n 2. For MATE number 65 would work but at LXQt it needs to be before "60-latin.conf". Therefore I suggest a filename of /etc/fonts/conf.d/60-droid-preferred.conf.
The content of the file can be basically the same as the example above. The above one contains a "description" line that I had copied from 60-latin.conf but didn't know what to put in. I see in other config files that a description is not needed, so just let's skipt that line. For the identation different config files do it differently. Personally I think identation by tabs make it better readable. It looks like the config files should actually be put into directory /etc/fonts/conf.avail and then the ones needed can be symlinked to /etc/fonts/conf.d. So that new file /etc/fonts/conf.avail/60-droid-preferred.conf could look like this:
I'm not sure yet if only LXQt and MATE need this – but that's our current state of knowledge. Accordingly, the config file should be shipped with the postmarketOS packages postmarketos-ui-lxqt and postmarketos-ui-mate. The pkgver and pkgrel counting of those two is different. For postmarketos-ui-lxqt the pkgver comes from another repository https://gitlab.com/antoni.aloytorrens/lxqt-tablet and therefore stays at 0.3, thus the pkgrel needs to be bumped to 3 when adding the config file. In postmarketos-ui-mate on the contrary there is no other repository, so changing "content" (by e.g. adding a config file) requires to bump the pkgver and setting the pkgrel back to 0. Unfortunately the pkgver number up to now consists of only one number. I suggest to switch to major-minor verion number in mate package and raising pkgver to 7.1 instead of 8.
The config file would need to be added to the folders of postmarketos-ui-lxqt and postmarketos-ui-mate. In the APKBUILD it needs to be added to the "source" and "sha512sums", keeping the alphabetic order. Installing the file to /etc/fonts/conf.avail can be done by something like this: https://gitlab.postmarketos.org/postmarketos/pmaports/-/blob/v24.06/main/postmarketos-ui-lxqt/APKBUILD#L80-81. For the linking to /etc/fonts/conf.d I'm not sure if this should be put in the APKBUILD or in a post-install script. Probably in APKBUILD is easier. It would look like this:
This config file would solve the terminal font issue but not the onboard return key issue.
In case we install font-dejavu to postmarketos-ui-lxqt and postmarketos-ui-mate, it would solve both issues and the config file would not be needed. But that would be more fonts being installed and the benefits of font-droid not being available in LXQt and MATE.
The way to go, either config file or installing font-dejavu, rather depends on the onboard return key issue.
However, I would say let's wait with implementing the config file. I'm still investigation the onboard virtual keyboard issue.
I was searching the onboard source code for the location where the return key symbol gets defined. It looks like this is done in "layouts/key_defs.xml" in the line with id='RTRN'.
Further up in a post I added a picture of a character map (I installed gucharmap in this case) where this character seems to be available for font "Droid Sans". Now I checked again and it's not there anymore. I realized that when I did the above picture, I had package font-dejavu installed. The picture below is without font-dejavu installed.
So installing font-dejavu has an impact on font-droid. Probably it's some fallback font situation. When one font doesn't provide a glyph, another font can provide it instead – if configured correctly.
I first hoped that font-dejavu has some config files that solve that issue. To test this, I downloaded package font-dejavu-2.37-r5.apk from https://dl-cdn.alpinelinux.org/alpine/edge/main (by command line with wget), did mkdir font-dejavu, extracted the content by tar -xf font-dejavu-2.37-r5.apk -C ./font-dejavu. Now I messed around by copying config files from that extracted package to the files in /etc/fonts. Unfortunately, this didn't help. Only when I moved the font data itself to /usr/share/fonts/dejavu, the return symbol became available in font-droid.
Well, I think that font-droid just doesn't contain that character U+23CE ⏎ .
I've just spotted your MR !5638 (merged) on installing font-dejavu to postmarketos-ui-lxqt and postmarketos-ui-mate. Maybe that's the easiest way for the time being.
Add font-dejavu to the dependencies of onboard, and
Add fontconfig configuration to postmarketos-ui-(lxqt|mate)
I would make dependency chains explicit and clear if possible. However, as we may have overlooked other breakage in the default applications of LXQt ot Mate, !5638 (merged) may be indeed safer.
Continuing the discussion here...
I don't have a strong opinion on this, meaning I'm open how to solve this. What I think is that Alpine handles dependecies more strict and actually there is no hard dependency between font-dejavu and onboard. Other fonts might serve charachter U+23CE ⏎ as well. It would need to be discussed in an MR at Alpine.