Skip to content
Prev 3456 / 3656 Next

Font issue under X11() (Ubuntu 20.04)

On Tue, 23 Aug 2022, Wolfgang Viechtbauer wrote:
Another follow-up. So I think this is really an Ubuntu issue. R looks for 
Helvetica, but this gets matched to Nimbus Sans, as shown by:

fc-match Helvetica

and that font has these strangely dropped symbols (e.g., =<>), at least 
for the version that ships with Ubuntu 20.04.

The fix for this is to create ~/.config/fontconfig/fonts.conf with:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
     <match>
         <test name="family">
             <string>Helvetica</string>
         </test>
         <edit mode="assign" name="family" binding="same">
             <string>Liberation Sans</string>
         </edit>
     </match>
</fontconfig>

(or whatever font you want to use in place of Helvetica). Then X11(), but 
also other devices like png() and so on will make use of the desired font 
in place of Helvetica.

I don't think that there is anything for R to address here, so I'll skip 
contacting Paul.

Best,
Wolfgang