Chris's Wiki :: blog/linux/ModernXFontDrawbackII Commentshttps://utcc.utoronto.ca/~cks/space/blog/linux/ModernXFontDrawbackII?atomcommentsDWiki2014-05-29T16:59:33ZRecent comments in Chris's Wiki :: blog/linux/ModernXFontDrawbackII.By mMontu on /blog/linux/ModernXFontDrawbackIItag:CSpace:blog/linux/ModernXFontDrawbackII:9712f4d5bbbdae130b8666ba605e092878dc3e3cmMontu<div class="wikitext"><p>This problem was driving me insane. The following ~/.fonts.conf solved it:</p>
<pre>
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font" >
<edit mode="assign" name="hintstyle"> <const>hintfull</const></edit>
</match>
</fontconfig>
</pre>
<p>Chris, Adam: thank you very much!!</p>
</div>2014-05-29T16:59:33ZBy Chris Siebenmann on /blog/linux/ModernXFontDrawbackIItag:CSpace:blog/linux/ModernXFontDrawbackII:9d7e2a5038c8faf56ecf50423f7ba148b3ddf92aChris Siebenmann<div class="wikitext"><p>Thank you! This seems to be pretty much it, and it's fixable by creating
a <code>$HOME/.fonts.conf</code> to override it.</p>
<p>(The rendering still looks slightly different between TK apps and
<code>xterm</code>, but there's so many things that that could be.)</p>
<p>I'll theorize that the applications that this doesn't happen in
are consulting the Gnome preferences system and overriding all of
fontconfig's various decisions and settings. I find it surprising and
irritating that fontconfig's config files override explicit fontname
settings for this stuff, but apparently that's life in the modern era
where all sorts of people know better than you do.</p>
</div>2012-01-27T16:42:02ZFrom 94.194.126.16 on /blog/linux/ModernXFontDrawbackIItag:CSpace:blog/linux/ModernXFontDrawbackII:390a4b2545715fed5a8f253f480df93318dbf5e5From 94.194.126.16<div class="wikitext"><p>Looking at <a href="http://packages.ubuntu.com/oneiric/fontconfig-config">the patch that Ubuntu applies to fontconfig</a>, they ship it with a file <code>/etc/fonts/conf.d/10-hinting-slight.conf</code> that contains exactly the rule I've given above -- so it'll overwrite any hinting preference you or an application sets with <code>hintslight</code> (i.e. specifying <code>hintstyle=hintfull</code> will have no effect, because the rule tells fontconfig to rewrite it).</p>
<p>If you want something other than slight hinting, you'll need to either remove that file or add a rule in your user config that forces it to be something else. It looks like they have some other sample <code>hintstyle</code>-changing configurations in <code>/etc/fonts/conf.avail</code>.</p>
<p>-- <a href="http://offog.org/">Adam Sampson</a></p>
</div>2012-01-27T01:29:13ZBy Chris Siebenmann on /blog/linux/ModernXFontDrawbackIItag:CSpace:blog/linux/ModernXFontDrawbackII:b92a954443bf04b72ebe6c88ee77d395619982d6Chris Siebenmann<div class="wikitext"><p>As far as I can tell, '<code>hintstyle=</code>' doesn't have an effect on the
rendering on Ubuntu for xterm. It does make a difference on Fedora,
where <code>hintstyle=hintlight</code> makes things darker in the same way as
<code>autohint=true</code>.</p>
</div>2012-01-26T21:07:20ZFrom 94.194.126.16 on /blog/linux/ModernXFontDrawbackIItag:CSpace:blog/linux/ModernXFontDrawbackII:3c4bb13f523b72b22b20688803654c55aa148b4fFrom 94.194.126.16<div class="wikitext"><p>I'm sorry -- I meant to comment on this when you put the original post up, and completely forgot about it.</p>
<p>What you're seeing is a difference in hinting style: the Fedora window is rendering with <code>hintstyle=hintfull</code>, and the Ubuntu window is rendering with <code>hintstyle=hintslight</code>. <a href="http://offog.org/stuff/hintstyle-dejavu.png">This screenshot</a> shows how to get both by specifying the hintstyle explicitly in the font name.</p>
<p>If you want to force all fonts chosen through fontconfig to be rendered with full hinting, you can do so with a rule in <code>~/.fonts.conf</code>:</p>
<pre>
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
</match>
</fontconfig>
</pre>
<p>I'd guess that Ubuntu has something like that to make slight hinting the default in one of their <code>/etc/fonts/conf.d</code> files. It's a shame the fontconfig rules syntax isn't better-documented, since it's actually very flexible...</p>
<p>-- <a href="http://offog.org/">Adam Sampson</a></p>
</div>2012-01-26T19:43:42Z