Archive

Archive for November, 2011

Compile-time binary literals [via pseudorandom noise]

November 28, 2011 Leave a comment

Compile-time binary literals [via pseudorandom noise]

This is a great post that shows off the new user-defined literals feature in C++11, using it to implement binary number literals such as 1011101010111110_binary. Paul also shows off some great template metaprogramming to achieve this end including template specialization, variadic templates (with template parameter packs and template recursion), and the sizeof... operator, which I’d not previously come across.

Quite a collection of features to discuss in one post, but done clearly and cohesively.

Smoother fonts in Fedora

November 8, 2011 Leave a comment

I’ve just discovered there’s a way to get Fedora to display fonts on screen much more legibly using sub-pixel rendering (what Microsoft’s ‘ClearType’ does) and font hinting. It makes a world of difference on my screen, and should on any other LCD screen.

To enable it on Fedora 15, run the following commands as root. (This should also work up to and including Fedora 17.)I f your monitor uses a pixel layout other than RGB you’ll need to adjust the second link accordingly, though I believe RGB is the most common.
> ln -s /etc/fonts/conf.avail/10-autohint.conf /etc/fonts/conf.d/
> ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/

You may need to restart your X server for it to take effect, though on my machine (Fedora 15) the change was effective immediately – and very obviously! The change is like the first time I discovered how to enable ClearType in Windows:the text on screen momentarily looks beautiful, as if you’ve been looking at the screen through the bottom of a glass bottle all this time.

 

I’ve finally upgraded from Fedora 17 to 20, and it seems the available configs have been moved to /usr/share/fontconfig/conf.avail. From changelogs it looks like this was brought in with an updated fontconfig package in Fedora 18. The commands are now:

> ln -s /usr/share/fontconfig/conf.avail/10-autohint.conf /etc/fonts/conf.d/
> ln -s /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/

Incidentally, my favourite programming fonts are Inconsolata and Anonymous Pro; both are much clearer than typical defaults. If you’ve not yet tried a font specifically designed for programming then I recommend trying it now.

Categories: Uncategorized Tags: ,
Follow

Get every new post delivered to your Inbox.