This is what Jayesh Bhoot looks like, with a lopsided smile on its right, which almost closes his right eye while smiling, which strongly implies that he needs to work on his lazy left-side cheek muscles.

Improved font rendering in Guix

Posted on

Collected in

There is a neat trick to make fonts on Linux look thicker and smoother and sharper. Set the following variable in /etc/environment:

FREETYPE_PROPERTIES="cff:no-stem-darkening=0 cff:darkening-parameters=500,400,1000,350,1500,325,2000,300 autofitter:no-stem-darkening=0 autofitter:darkening-parameters=500,400,1000,350,1500,325,2000,300"

FREETYPE_PROPERTIES is set in /etc/environment so that it sticks as a global configuration. You can see the effect in the following screenshots stitched together from before and after applying the configuration:

Left-hand side - fonts in browser before applying the configuration. Right-hand side - fonts after applying the configuration look thicker and sharper.
Left-hand side - fonts in terminal before applying the configuration. Right-hand side - fonts after applying the configuration look thicker and sharper.

I was able to set FREETYPE_PROPERTIES in Guix with the help of a great tip from Lo Peter on how to set a global environment variable in a Guix system.

Here is the final configuration, to be put in the Guix system's configuration file (I call it os.scm).

(operating-system
 (services
  (cons*
   (simple-service
    'global-environment-variables
    session-environment-service-type
    '(("FREETYPE_PROPERTIES" . "cff:no-stem-darkening=0 cff:darkening-parameters=500,400,1000,350,1500,325,2000,300 autofitter:no-stem-darkening=0 autofitter:darkening-parameters=500,400,1000,350,1500,325,2000,300"))))))

Post author's photo Written by Jayesh Bhoot

Comments