You are not logged in.
Pages: 1
I'm using xterm, with the following default setting in .Xresources:
XTerm.vt100.faceName: DejaVu Sans Mono
XTerm.vt100.faceSize: 9which displays the text in the terminal in that font.
However, the font does not have some characters such as ?, so I want to substitute it with some different font.
Using askubuntu.com/q/27598 I check which font contains the characters:
fc-list ":charset=0x1d54f"and get that DejaVu Sans contains it.
I try to follow Arch Wiki https://wiki.archlinux.org/title/Font_c … back_fonts to setup a fallback font
<alias>
<family>DejaVu Sans Mono</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>but the character just show up as blank in xterm.
Did I misunderstand anything?
Looking at the wiki page for XTerm https://wiki.archlinux.org/title/Xterm#Fonts I don't see any good explanation.
Offline
I don't require much from xterm.
I have
XTerm*faceName: Monospace
XTerm*faceSize: 14Gives me
abcdefghijklmnopqrstuvwxyz!@#$%^&*()-|\_+1234567890<>,.?/"':;~`Offline
FC_DEBUG=4 pango-view --font="DejaVu Sans Mono" -t "?" | grep family:resolves the glyph from "DejaVu Math TeX Gyre" for me.
Are you maybe using https://archlinux.org/packages/communit … javu-nerd/ ?
Otherwise some sanity checks:
xrdb -q | grep -i face
localeCan you copy & paste either ? or ü into the xterm?
Offline
Re-reading the original post I realize that the forum does not render the character "?" correctly, it becomes a question mark. It's supposed to be "MATHEMATICAL DOUBLE-STRUCK CAPITAL X" i.e. Unicode 0x1d54f.
Using the pango-view command shows the character correctly, showing the family as "DejaVu Sans". Meanwhile using it to show "?" (the actual question mark character) or "ü" results in the correct font (DejaVu Sans Mono) being used, because the font does have that character and I have the font installed.
Pacman gives
ttf-dejavu 2.37+18+g9b5d1b2f-3so it isn't the case.
One more detail, in case it helps: if I use it to show the "?" character (MATHEMATICAL BOLD SMALL A, 0x1d41a) then it occasionally shows, but only at some font sizes; in other font sizes it's blanked out. pango-view gives family: "DejaVu Math TeX Gyre".
Last edited by k395 (2023-02-16 07:39:41)
Offline
if I use it to show the "?" character (MATHEMATICAL BOLD SMALL A, 0x1d41a) then it occasionally shows, but only at some font sizes; in other font sizes it's blanked out
That's because it's a variable width glyph while xterm (as pretty much every TE) renders in a fixed width box.
The consequence is that some glyphs will be too small, others too big and TEs deal w/ that by either clamping or overflowing. The result is never pretty.
Eg. urxvt doesn't use the fontconfig substitution and allows you to specify a font cascade w/ different sizes (ie. I'd eg. got a default 9pt and set DVMTG to 7pt to make sure it fits; there're also patached versions in the AUR w/ specific code to deal w/ wide characters momre automatically.
Offline
I realize that issue (for example when it works, the bold m (0x1d426) is truncated and looks like bold n instead), but anyway the issue here is that sometimes the character is blanked out entirely.
How can I specify a fallback font for xterm then? (the question of which font look good can be left for later)
Offline
https://wiki.archlinux.org/title/Font_c … back_fonts - but that doesn't allow you to control the size and even if you prefer a different monospace font, that doesn't mean that the pixel sizes align.
You could try and see whether the glyph is included in the patched nerd fonts.
Offline
Isn't that what I already do? From the original post:
<alias>
<family>DejaVu Sans Mono</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>This should use glyphs from DejaVu Sans whenever the glyph is not available in DejaVu Sans Mono, right? (the match-test-edit one in the wiki will completely replaces the font with the new font, which is not what I want)
For the suggestion of trying the nerd fonts, I'll consider that.
Offline
Yes and assumign you ddi it correctly, DJVSM will now fall back to DJVS
~/.config/fontconfig/conf.d/99-dejavumonofallback.conf
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>DejaVu Sans Mono</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
</fontconfig>which should™ be reflected in the pango-view test.
This does however not change anything about the fixed/variable width situation - DJVS is variable width just as DJVMTG.
Offline
Pages: 1