7

I'm using urxvt with DejaVu Sans Mono as font:

urxvt.font:     xft:DejaVu Sans Mono

But I'm not possible to see Unicode characters like '⌚'.

Why that ? Is urxvt able to display these symbols?

Thank You

1
  • xterm on OpenBSD can display that using the Noto Emoji font (at the cost of making all the other characters tofu).
    – thrig
    Nov 16, 2016 at 20:48

3 Answers 3

5

The manual page is the place to go, for options:

-fn fontlist
Select the fonts to be used. This is a comma separated list of font names that are checked in order when trying to find glyphs for characters. The first font defines the cell size for characters; other fonts might be smaller, but not (in general) larger. A (hopefully) reasonable default font list is always appended to it. See resource font for more details.

and resource settings:

font: fontlist
Select the fonts to be used. This is a comma separated list of font names that are checked in order when trying to find glyphs for characters. The first font defines the cell size for characters; other fonts might be smaller, but not (in general) larger. A (hopefully) reasonable default font list is always appended to it; option -fn.

Each font can either be a standard X11 core font ( XLFD ) name, with optional prefix "x:" or a Xft font (Compile xft), prefixed with "xft:".

Given the comment by @thrig, you should be able to do this:

urxvt.font:     xft:DejaVu Sans Mono, xft:Noto Emoji

(if you have those fonts installed).

However, the package google-noto-emoji-fonts in Fedora24 appears to be a mixed-width font, which urxvt doesn't handle, giving this message:

$ urxvt -fn 'xft:DejaVu Sans Mono,xft:Noto Emoji'                               
urxvt: unable to calculate font width for 'Noto Emoji:slant=0:weight=100:pixelsize=19:minspace=True', ignoring.

According to a Font-Awesome bug report Cannot be used with urxvt #3681, urxvt doesn't check the widths for glyphs in the private use area (i.e., non-standardized). That applies to any of the Emoji fonts.

If you only care about Emoji, urxvt runs with just that font (and uses double-width cells for everything):

urxvt -fn 'xft:Noto Emoji'

urxvt in the background

2
  • Sorry didn't worked, I installed these fonts. KWrite with Noto Emoji is able to display the symbols, but in urxvt I just get the ugly squres. I already tried just to use Noto Emoji in urxvt but the symbols are not shown as well..
    – dudas
    Nov 17, 2016 at 12:21
  • urxvt does not need several fonts to be specified, it will do font substitution even if you only specify one font.
    – njsg
    Sep 6, 2017 at 12:17
2

I can display ⌚ as well as 📦 box by using Symbola font

Here's the config:

URxvt*font:                 xft:Fira Code Retina:pixelsize=11:minspace=False, xft:DejaVu Sans:pixelsize=8, xft:Symbola
URxvt*boldFont:             xft:Fira Code Retina:pixelsize=11:minspace=False, xft:DejaVu Sans:pixelsize=8, xft:Symbola
1

Do you change your letter spacing:

  -letsp number
       Compile frills: Amount to adjust the computed character width by to
       control overall letter spacing. Negative values will tighten up the
       letter spacing, positive values will space letters out more. Useful
       to work around odd font metrics; resource letterSpace.

If you use a negative value to improve readability, letters that are too wide cannot be printed. This is the case for many Unicode characters.

1
  • 1
    This turned out to be an indication of the problem for me, though you don't actually need to widen your letter spacing; you can instead force the fallback font to a smaller size: xft:Source Code Pro:size=10,xft:Source Han Sans,xft:DejaVu Serif:size=9. Note that if you don't specify a size for the fallback font the problem may or may not appear depending on the size of the main font; e.g., for me letterspacing of -0.5 worked with size=9 but not size=10 with some fonts.
    – cjs
    Jan 10, 2018 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .