-- Leo's gemini proxy

-- Connecting to bbs.geminispace.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

Enabling Subpixel Hinting for dwm


Recently I switched to dwm on all my machines which were originally XUbuntu. On 4K monitors things look fine, but recently I set up a box with a 2560 x 1080 LG monitor, and I noticed that fonts look crappy. Switching to an LXDE or XUbuntu session makes LibreFox look fine again, so it has to do with how dwm starts up.


After much searching and I found that I don't have a .fonts.conf file for fontconfig, and creating one seems to solve the problem (if you prefer subpixel hinting, that is).


<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
    <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
  </its:rules>

  <description>Set hintmedium to hintstyle</description>

  <match target="pattern">
    <!--
      This configuration is available on the major desktop environments.
      We shouldn't overwrite it with "assign" unconditionally.
      Most clients may picks up the first value only. so using "append"
      may simply works to avoid it.
    -->
    <edit name="hintstyle" mode="append"><const>hintmedium</const></edit>
  </match>
</fontconfig>

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
 </match>
</fontconfig>

Posted in: s/Linux

๐Ÿš€ stack

2023-10-01 ยท 8 months ago

-- Response ended

-- Page fetched on Sun May 19 20:37:23 2024