~eliasnaur/gio

5 2

Blurry text at small sizes

Rajiv Kanchan
Details
Message ID
<CABydZCyyhYKih3CahOXzG-2hZm4Vz9DR0ypTny7VivbQDLJguw@mail.gmail.com>
DKIM signature
pass
Download raw message
I see that the text at small sizes are blurry. Is this due to lack of
anti aliasing, and is there a way to improve this?
Details
Message ID
<BYGCR3LF924G.3OBMVNMPEVIB0@testmac>
In-Reply-To
<CABydZCyyhYKih3CahOXzG-2hZm4Vz9DR0ypTny7VivbQDLJguw@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On Fri Nov 15, 2019 at 11:55 AM Rajiv Kanchan wrote:
> I see that the text at small sizes are blurry. Is this due to lack of
> anti aliasing, and is there a way to improve this?

What are you comparing with? Some systems (Windows) render text at
smaller sizes in a different way.

What's the DPI of the screen you're seeing blurry text on?

Text is rendered with anti-aliasing, but not with sub-pixel AA. That
is one possible reason.

Another is that text could be improperly aligned (hinted) with the
underlying pixel grid.

To really compare, you'll need to get a sample with the same font and
size rendered better. That way, we can see the subtle differences
more clearly.

-- elias
Details
Message ID
<CAMAFT9XNki4Df1G6X74exiU-jg9j6G2EBDDWew5LDqWK6LmoOA@mail.gmail.com>
In-Reply-To
<BYGCR3LF924G.3OBMVNMPEVIB0@testmac> (view parent)
DKIM signature
pass
Download raw message
On Fri, Nov 15, 2019 at 10:11 AM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Fri Nov 15, 2019 at 11:55 AM Rajiv Kanchan wrote:
> > I see that the text at small sizes are blurry. Is this due to lack of
> > anti aliasing, and is there a way to improve this?
>
> What are you comparing with? Some systems (Windows) render text at
> smaller sizes in a different way.
>
> What's the DPI of the screen you're seeing blurry text on?
>
> Text is rendered with anti-aliasing, but not with sub-pixel AA. That
> is one possible reason.
>
> Another is that text could be improperly aligned (hinted) with the
> underlying pixel grid.
>
> To really compare, you'll need to get a sample with the same font and
> size rendered better. That way, we can see the subtle differences
> more clearly.
>

I almost forgot another important reason for blurry text at small sizes:
Gio does not (yet) perform stem widening. See

    https://www.freetype.org/freetype2/docs/text-rendering-general.html

-- elias
Rajiv Kanchan
Details
Message ID
<CABydZCwX=gWGrKSYdH-BTF+iUV_nkL5k8ea2DhYcBvNrXmbUPA@mail.gmail.com>
In-Reply-To
<CAMAFT9XNki4Df1G6X74exiU-jg9j6G2EBDDWew5LDqWK6LmoOA@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
> What are you comparing with? Some systems (Windows) render text at smaller sizes in a different way.
I am comparing it with how the system applications(GTK3 based) on my
linux OS(elementary OS) render small fonts. Below are links to the
screenshots of a GTK3 based text editor and a gio app rendering "Go
regular" font at size 16px

> What's the DPI of the screen you're seeing blurry text on?
Mine is a 100 dpi screen (22 inch, 1920x1080), but it appears like
GTK/OS is snapping it to 96 dpi


gio: https://drive.google.com/open?id=15wxlMY3mGMnkKdvPfsyW5wYahHY8JFkk
gtk_app: https://drive.google.com/open?id=1S9M5VOjLxkkmBwaBYZJ-vQ0QzSxY9Sb8


On Fri, Nov 15, 2019 at 3:45 PM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Fri, Nov 15, 2019 at 10:11 AM Elias Naur <mail@eliasnaur.com> wrote:
> >
> > On Fri Nov 15, 2019 at 11:55 AM Rajiv Kanchan wrote:
> > > I see that the text at small sizes are blurry. Is this due to lack of
> > > anti aliasing, and is there a way to improve this?
> >
> > What are you comparing with? Some systems (Windows) render text at
> > smaller sizes in a different way.
> >
> > What's the DPI of the screen you're seeing blurry text on?
> >
> > Text is rendered with anti-aliasing, but not with sub-pixel AA. That
> > is one possible reason.
> >
> > Another is that text could be improperly aligned (hinted) with the
> > underlying pixel grid.
> >
> > To really compare, you'll need to get a sample with the same font and
> > size rendered better. That way, we can see the subtle differences
> > more clearly.
> >
>
> I almost forgot another important reason for blurry text at small sizes:
> Gio does not (yet) perform stem widening. See
>
>     https://www.freetype.org/freetype2/docs/text-rendering-general.html
>
> -- elias
Details
Message ID
<BYGI6RYFIQ28.RXIB5PCPRI47@testmac>
In-Reply-To
<CABydZCwX=gWGrKSYdH-BTF+iUV_nkL5k8ea2DhYcBvNrXmbUPA@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On Fri Nov 15, 2019 at 4:54 PM Rajiv Kanchan wrote:
> > What are you comparing with? Some systems (Windows) render text at smaller sizes in a different way.
> I am comparing it with how the system applications(GTK3 based) on my
> linux OS(elementary OS) render small fonts. Below are links to the
> screenshots of a GTK3 based text editor and a gio app rendering "Go
> regular" font at size 16px
> 
> > What's the DPI of the screen you're seeing blurry text on?
> Mine is a 100 dpi screen (22 inch, 1920x1080), but it appears like
> GTK/OS is snapping it to 96 dpi
> 
> 
> gio: https://drive.google.com/open?id=15wxlMY3mGMnkKdvPfsyW5wYahHY8JFkk
> gtk_app: https://drive.google.com/open?id=1S9M5VOjLxkkmBwaBYZJ-vQ0QzSxY9Sb8
> 

Indeed, the GTK rendering is a bit "thicker" than Gio's. To make matters
worse, Gio needs slightly more stem darkening than other font renderers
because Gio's text rendering uses sRGB-correct anti-aliasing.

Unfortunately, I don't know when I'll work on text rendering again, so please file an issue
in case someone else is interested.

-- elias
Rajiv Kanchan
Details
Message ID
<CABydZCx=YNtS==0+Bd2v0=QxRUwHCjCmmLHJiCi41afQzKocSA@mail.gmail.com>
In-Reply-To
<BYGI6RYFIQ28.RXIB5PCPRI47@testmac> (view parent)
DKIM signature
pass
Download raw message
Thanks for the explanations.
Filed an issue at https://todo.sr.ht/~eliasnaur/gio/68