[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fw: How to have sharp fonts?

From: Peter Grandi
Subject: Re: Fw: How to have sharp fonts?
Date: Fri, 3 Mar 2023 00:50:34 +0000

> * Usually pure greyscale (pixel) antialasing is way better for
>   me, but it also depends on whether the background is dark or
>   light and whether the rendering library applies the right
>   gamma correction for that

Since many/most text setting libraries don't take this into
account, I would suggest experimenting with both black-on-light
and light-on-back terminal etc. text color schemes.

> * For me it is much better to turn off antialiasing entirely and
>   rely on the autohinter (for PS fonts) or hints to get sharp
>   shapes in black-white mode. This depends critically on finding
>   well-hinted fonts and on the screen resolution.

I use these 'xrdb' settings for a 4k/QHCD 27in screen:

 Xft.dpi:               160
 Xft.antialias:         false
 Xft.rgba:              none
 Xft.lcdfilter:         lcddefault
 Xft.hinting:           true
 Xft.autohint:          false
 Xft.hintstyle:         hintfull

Similar settings for 'dconf':

 hinting                ='full'
 rgba-order             ='rgb'
 antialiasing           ='none'

Similar settings for 'gsettings':

 gsettings set "$OGS".plugins.xsettings hinting        'full'
 gsettings set "$OGS".plugins.xsettings rgba-order     'rgb'
 gsettings set "$OGS".plugins.xsettings antialiasing   'none'

Similar settings for '~/.config/fontconfig/fonts.conf' or the
 global '/etc/fonts/local.conf' (most distributions will have
 under '/etc/fonts/conf.avail/' or similar some equivalent
 ready-made configuration files):

  <!-- Default size 10 points -->
  <match target="pattern">
    <edit name="size" binding="weak" mode="append"><double>10</double></edit>

  <!-- Ensure no fonts are too small in points or pixels -->
  <match target="pattern">
    <test name="size" compare="less"><double>7</double></test>
    <edit name="size" mode="prepend"><double>7</double></edit>
  <match target="font">
    <test name="pixelsize" compare="less"><double>8</double></test>
    <edit name="pixelsize" mode="prepend"><double>8</double></edit>

    Setting generic options like antialiasing and related ones
    like hinting and LCD filtering.
    The same can be done for specific font families.

  <match target="font">
    <edit name="antialias" binding="weak" mode="append_last"

    <edit name="hinting" binding="weak" mode="append_last"
    <edit name="autohint" binding="weak" mode="append_last"
    <edit name="hintstyle" binding="weak" mode="append_last"

    <edit name="rgba" binding="weak" mode="append_last"
    <edit name="lcdfilter" binding="weak" mode="append_last"

  <!--  Antialiasing only for small or large fonts -->
  <match target="font">
    <test name="antialias" compare="eq"><bool>true</bool></test>
    <test name="size" compare="more"><double>8</double></test>
    <test name="size" compare="less"><double>13</double></test>
    <edit name="antialias" mode="append"><bool>false</bool></edit>
  <match target="font">
    <test name="antialias" compare="eq"><bool>true</bool></test>
    <test name="pixelsize" compare="more"><double>10</double></test>
    <test name="pixelsize" compare="less"><double>16</double></test>
    <edit name="antialias" mode="append"><bool>false</bool></edit>

> People with low vision [...]

That's a bit of different topic from high-contrast rendering,
where "fuzzy" glyphs tire even people with good vision. For
low-vision cases a careful choice of simple sans-serif typefaces
and bigger point sizes usually helps more; also in many cases
using low-dioptre reading glasses. The "Tyresias" typeface seems
designed for low-vision users, but I think that Ubuntu and
DejaVu "sans" also would be good.

> Perhaps somebody can recommend a monitor that actually gets
> above 100dpi? [...]

Any UHD/4k/3840x2160 27in monitor, some of which are fairly
cheap, and there are even UHD/4k/3840x2160 24-25in monitors that
get above 200DPI.

Any UHD/4k/3840x2160 32in (or QHD/2K/2560x1440 24in) monitor is
also above 100DPI, but not by as much.

> Font creators and packagers no longer take into account users
> of non-antialised fonts, and the fonts are getting worse in
> this regard.. For example "fonts-liberation2" are much worse
> than the older "fonts-liberation" when it comes to
> non-antialiasing,

Adding "hints" to TTF fonts so they work well on low DPI
monitors is time consuming, and the FT TTF auto-hinter does not
seem to work as well as the FT PS1 one, probably because the PS1
font format seems designed to work well with an auto-hinter.

In some of the links I gave before there are lists of well
hinted monitor fonts, of which I think the best are the Ubuntu
and DejaVu ones among "freeware" fonts. There are also the
Microsoft "gratisware" TTF Web Fonts. There are also well hinted
Google Noto TTF fonts. Many commercial TTF fonts tend to be
well-hinted too. The classic URW PS1 fonts work well too (with
the PS1 autohinter). The TeX LM PS1 fonts also work well, but
they are not that popular. Some people will find the classic
Adobe "base" 14 and 35 fonts PS1 fonts.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]