You are not logged in.

#1 2019-05-15 11:14:05

nasci
Member
From: Melbourne, AU
Registered: 2018-12-08
Posts: 24
Website

Unicode rendering in URxvt (jagged edges and misshapen symbols)

My zsh prompt contains two unicode symbols: ● and ❯. These two symbols display perfectly in Chromium, but in urxvt they do not render properly. The font is Ubuntu Mono Derivative Powerline.

screenshot

The first problem is the jagged edges, which I expected would be fixed with antialising and/or hinting. I have enabled these in .Xdefaults as well as /etc/fonts/conf.d, but there is still pixelation on the edges of these characters.

The second problem is that the circle symbol does not render as a circle at smaller font sizes. The attached screenshot shows the same text at pizelsize=14 and pixelsize=24 (set in .Xdefaults). In the first example, the symbol is clearly the wrong shape, but at 24px it seems okay. I'm not sure what could cause a font to completely misrender characters like that.

Some things I've tried:

  • changing to a non-powerline font

  • changing to a different font family

  • changing DPI in xrandr

  • enabling antialiasing and hinting

Interestingly, if I put an invalid font name in my .Xdefaults, the symbols render fine and there is no aliasing. So whatever font it falls back to doesn't have these issues.

Could I get some guidance from someone? Thanks.

Offline

#2 2019-05-15 15:40:00

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: Unicode rendering in URxvt (jagged edges and misshapen symbols)

Link to the font?
If you make the font *really* HUUUUGE, do the dots still grow with it?

Offline

#3 2019-05-16 05:29:20

Batou
Member
Registered: 2017-01-03
Posts: 259

Re: Unicode rendering in URxvt (jagged edges and misshapen symbols)

.Xresources ?


Please vote for all the AUR packages you're using. You can mass-vote for all of them by doing: "pacman -Qqm | xargs aurvote -v" (make sure to run "aurvote --configure"  first)

Offline

#4 2019-05-16 06:49:11

nasci
Member
From: Melbourne, AU
Registered: 2018-12-08
Posts: 24
Website

Re: Unicode rendering in URxvt (jagged edges and misshapen symbols)

seth wrote:

Link to the font?

https://github.com/powerline/fonts/tree … UbuntuMono
Same issue with other fonts though.
Yes, the dots grow with font size. At 24px they seem rougly circular. Here is another screenshot with pixelheight 64, 128 and 256: https://i.imgur.com/PrRw5ws.png.

Batou wrote:

.Xresources ?

The alternative to .Xdefaults. See https://superuser.com/questions/243914/ … -xdefaults.

Offline

#5 2019-05-16 08:19:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unicode rendering in URxvt (jagged edges and misshapen symbols)

nasci wrote:
Batou wrote:

.Xresources ?

The alternative to .Xdefaults. See https://superuser.com/questions/243914/ … -xdefaults.

He knows what it is, he is asking to see it...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2019-05-16 08:21:48

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: Unicode rendering in URxvt (jagged edges and misshapen symbols)

The font doesn't provide that glyph (u+25cf), so it's substituted from somewhere.
strace/grep urxvt to see which other fonts are loaded.

Offline

#7 2019-05-17 08:22:03

nasci
Member
From: Melbourne, AU
Registered: 2018-12-08
Posts: 24
Website

Re: Unicode rendering in URxvt (jagged edges and misshapen symbols)

Thanks for the replies, I worked it out. Here's some information (mostly for my own records):

As I suspected, when I used gucharmap to inspect Ubuntu Mono, those unicode positions are empty. I assumed that since the glyphs were being rendered, they were part of the font. I didn't specify a fallback font in Xresources, so I'm surprised they rendered at all. Still not sure how this works. I think there was a preset in /etc/fonts/conf.d which was providing the bad glyphs, but I had so many that I'm not sure which one. It seems there are two ways around it:

- copy in the glyphs from another font and recompile the ttf file (would be broken by AUR updates)
- add a fallback font in .Xresources

I tried both but ended up going with the second. Turns out I only had one font installed which rendered the glyphs properly, which was Free Serif.

Offline

Board footer

Powered by FluxBB