<div dir="ltr"><div><div><div><div>Hi,<br></div> I have been fiddling with fontconfig with the aim of rejecting fonts by glob, and then accepting a small sub-set. (*See end of post for why.)<br><br></div>I can't get the voodoo right. After a rejectfont glob on "/usr/share/fonts/*", no amount of "acceptfont" seems to work.<br><br></div>What I have found that *does* work is this strategy:<br><br></div>1. I reject all like this:<br><div><div><div><div><div><br>The reject file in ~/.config/fontconfig/conf.d/1.killemall.conf</div><div><br></div><div><?xml version="1.0"?><br><!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br><fontconfig><br> <selectfont><br>  <rejectfont><glob>/usr/share/fonts/*</glob></rejectfont><br> </selectfont><br></fontconfig></div><div><br></div><div>2. I then place soft links to a few "standard" fonts in ~/.local/share/fonts, (user fonts dir) say:<br></div><div>cd ~/.local/share/fonts</div><div>ln -s /usr/share/fonts/truetype/freefont/FreeSans.ttf .<br></div><div><br></div><div></div><div>Now  FreeSans shows along with whatever other fonts I have in my user fonts dir, when I use fc-list<br></div><div><br></div><div>Done. I think...?</div><div><br></div><div>My thinking is that I can keep a small pack of typical fonts like DejaVu, FreeXXX, LiberationXXX, UbuntXXX around so that apps don't crash.<br></div><div><br></div><div>Questions:</div><div>1. Is this a valid strategy to reject/accept, or is it a bug in fontconfig? (Allowing ln -s paths through a reject glob. It seems like it's not a bug, but I don't know if it's intentional.)</div><div><br></div><div>2. Is there a better/safer way to do this all in the XML files?<br></div><div><br></div><div></div><div>3. What "system" fonts are essential to keep gui apps from failing? I realize this is a complex question because of the vast range of locales and distros. Is there some informal list of fonts which one should never reject?</div><div>(In the end, I am going to leave this up to the user - they will choose the fonts that must never be rejected.)<br></div><div><br></div><div><br></div><div>Thanks,</div><div>/d</div><div><br></div><div>* Why: I am aiming for a way to cut down on the crazy font clutter on my system. I can't use Inkscape or Gimp effectively when there are hundreds of font names in the choosers. I want a way to filter them out while I work. (They'd come back after by some toggle.) That's the plan.</div><div><br></div><div> I posted here about a month ago. Jerry Casiano's posts got me to where I am now. Thanks.<br></div></div></div></div></div></div>