How to fix ugly fonts in Qt-based applications

I was using Qt Creator and tried to change the editor’s font to Monaco, 9. But hey, Monaco is not that ugly:

Monaco before fix

So I googled a way to fix for this problem, and found the fix at Arch Linux forums. You’ll need to create a file called .fonts.conf in your home directory with this content:

<?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>
</fontconfig>

I closed Qt Creator and reopened it. The result was this:

Monaco after fix