termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
12.97k stars 2.98k forks source link

[Bug]: can't set aterm font #21009

Closed natebragg closed 1 week ago

natebragg commented 1 month ago

Problem description

In spite of a font being installed, aterm cannot find it. I tried with multiple fonts. Here is one example:

u0_a109@localhost:~$ aterm -fn "DejaVu Sans Mono"
aterm: can't load font "DejaVu Sans Mono"

u0_a109@localhost:~$ fc-match -s monospace | grep "DejaVu Sans Mono"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
DejaVuSansMono-Oblique.ttf: "DejaVu Sans Mono" "Oblique"

What steps will reproduce the bug?

see above

What is the expected behavior?

That this error doesn't occur, and that aterm launches using the corresponding font.

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=12166
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX_X11_XSTARTUP=xmonad
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.sau.edu.cn/termux/apt/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://mirrors.sau.edu.cn/termux/apt/termux-root root stable
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.sau.edu.cn/termux/apt/termux-x11 x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.43.1
Android version:
12
Kernel build information:
Linux localhost 5.10.198-01439-ge143c3adb0d8 #1 SMP PREEMPT Thu Jul 11 01:38:03 PDT 2024 aarch64 Android
Device manufacturer:
Oculus
Device model:
Quest 3
LD Variables:
LD_LIBRARY_PATH=/data/data/com.termux/files/usr/opt/gurobi1101/armlinux64/lib
LD_PRELOAD=
Installed termux plugins:
com.termux.x11 versionCode:15
natebragg commented 3 weeks ago

To amend this, I can use the fonts listed by xlsfonts, e.g., aterm -fv lucidasans-10. Are these built in? I found no such files under $PREFIX/share/fonts. I need to change fonts, the default ones have really awful Unicode support.

niten94 commented 2 weeks ago

I do not know where X11 fonts are placed but fonts printed when running xlsfonts are X11 fonts. Fonts printed when running fc-match are TrueType fonts but X11 fonts only can probably be used in aterm.

natebragg commented 2 weeks ago

@niten94 Do you know if it's possible to install more X11 fonts? If not, does that mean that aterm just can't support unicode? If that's the case, then I guess this ticket can't be resolved as fixed. Does termux support any other graphical terminal other than aterm? Unicode support seems like a pretty basic feature for a graphical terminal.

niten94 commented 1 week ago

To amend this, I can use the fonts listed by xlsfonts, e.g., aterm -fv lucidasans-10. Are these built in? I found no such files under $PREFIX/share/fonts.

The xorg-fonts-75dpi package is a dependency of aterm package so I tried looking at the files in the package, but the filename extension of X11 fonts in Termux packages seems to be .pcf.gz. Lucida Sans typefaces are probably in font files with lu at beginning in name. X11 fonts are mixed with fonts in other formats in $PREFIX/share/fonts.

Do you know if it's possible to install more X11 fonts?

I think there are X11 fonts in xorg-fonts-75dpi and xorg-fonts-100dpi packages only. The package content is probably only different in the sizes of the fonts.

If not, does that mean that aterm just can't support unicode?

I tried looking at the homepage of aterm but aterm does not seem to be maintained now. Programs not supporting TrueType fonts are usually old and not used much now, so Unicode may not be supported in aterm.

If that's the case, then I guess this ticket can't be resolved as fixed.

I do not know how Termux package issues are resolved but package maintainers do not usually maintain the programs in packages. Programs are distributed using packages only, so the source code of programs is not usually modified to add features.

Does termux support any other graphical terminal other than aterm? Unicode support seems like a pretty basic feature for a graphical terminal.

The only graphic terminal I have used a lot is xterm but it is not in Termux, so I cannot give suggestions. I think other graphic terminals support Unicode and TrueType fonts. I tried running pkg search terminal emulator but there are packages with other graphic terminals that can be used in X11:

natebragg commented 1 week ago

Thank you, I didn't know how to do that search. I wish this was documented somewhere, I'll have to switch to one of those! Hopefully this ticket can serve to point someone else in the right direction in the future.