Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO]Freetype subpixel font rendering - lcd monitors Pt 2
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 13, 14, 15 ... 27, 28, 29  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
ssteinberg
Apprentice
Apprentice


Joined: 09 Jul 2010
Posts: 206
Location: Israel

PostPosted: Mon Sep 13, 2010 12:13 pm    Post subject: Reply with quote

Here is a quickly hacked together comparison screenshots:
http://i56.tinypic.com/dxjko0.jpg
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Sep 13, 2010 12:35 pm    Post subject: Reply with quote

ssteinberg wrote:
clearer, crispier fonts

I suggest you try e.g.:

sed -i -e "s:0x10, 0x40, 0x70, 0x40, 0x10:0, 85, 86, 85, 0:" src/base/ftlcdfil.c
in freetype2 (I got those numbers from here).

Looks ugly to me, though.
Back to top
View user's profile Send private message
guiohm
n00b
n00b


Joined: 13 Sep 2010
Posts: 1

PostPosted: Mon Sep 13, 2010 9:16 pm    Post subject: Reply with quote

PaulBredbury wrote:
People seem confused, so let's recap. To get the current state-of-the-art in font rendering:

1. Apply Infinality's freetype patches (example: pross overlay).
2. Apply Ubuntu's patches to fontconfig. This step doesn't seem to be strictly required.
3. Apply Ubuntu's patches to libXft, so that apps which use libXft will use the better rendering.
4. Apply Ubuntu's patches to cairo, so that apps which use cairo will use the better rendering. Also apply my cairo-respect-fontconfig.patch, so that ~/.fonts.conf isn't occasionally ignored.
5. Use Infinality's fontconfig rules, in /etc/fonts/conf.d/ or as ~/.fonts.conf
6. For completeness, set up ~/.Xresources
7. Restart your apps and marvel at the beautiful fonts.

First, thanks a lot for this recap (and for the hard work behind it -> PaulBredbury, Infinality, Ubuntu's team...)
My fresh gentoo install can now stand the comparison with OS X that is running just aside.

I think we should make a sort of "Cleartype Settings Tool", at least for gentoo (like a "Cleartype USE-flag setting tool" maybe ?) to permit users to choose easily their "cleartype" preferences.
The first reason is that I spend at least 2 hours to figure how to get a "correct rendering of fonts" (it's subjective I know).
The second reason is that even if I much prefer the result of this recap, it may not be the taste of someone else. So the user should have a choice.

Anyway, Thanks.
Back to top
View user's profile Send private message
Infinality
n00b
n00b


Joined: 12 Aug 2010
Posts: 24
Location: Wisconsin, USA

PostPosted: Tue Sep 14, 2010 1:31 am    Post subject: Fontconfig / LCD Filter Weights Reply with quote

Anybody seen patches around that will allow you to specify the LCD filter weights with fontconfig? In other words, inside your fonts.conf or local.conf?

(edit: I'm referring to custom FIR weights, like: [0.1, 0.2, 0.4, 0.2, 0.1] )


Last edited by Infinality on Tue Sep 14, 2010 12:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Tue Sep 14, 2010 9:20 am    Post subject: Reply with quote

Thanks to Olivier Rolland, lcd-filtring overlay is now in gentoo's layman.
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Tue Sep 14, 2010 8:54 pm    Post subject: Reply with quote

I've commited infinality's patchset to the LCD filtering overlay. Enable the lcd-filter USE flag for cairo, fontconfig, libXft and freetype and you'll have everything you need except infinality's fontconfig rules and .Xresources configuration.
_________________
OGMRip - LCD filtering (Wiki)
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Wed Sep 15, 2010 2:57 am    Post subject: Reply with quote

PaulBredbury wrote:
People seem confused, so let's recap. To get the current state-of-the-art in font rendering:

1. Apply Infinality's freetype patches (example: pross overlay). Edit: Also consider the Gibson filter - sed one-liner, which I still think looks smoother than the default.
2. Apply Ubuntu's patches to fontconfig. (This step doesn't seem to be strictly required, but this would be the right time to do it.)
3. Apply Ubuntu's patches to libXft, so that apps which use libXft will use the better rendering.
4. Apply Ubuntu's patches to cairo, so that apps which use cairo will use the better rendering. Also apply my cairo-respect-fontconfig.patch, so that ~/.fonts.conf isn't occasionally ignored.
5. Use Infinality's fontconfig rules, in /etc/fonts/conf.d/ or as ~/.fonts.conf
6. For completeness, set up ~/.Xresources
7. Restart your apps (e.g. firefox) and marvel at the beautiful fonts.


Quote:
I've commited infinality's patchset to the LCD filtering overlay. Enable the lcd-filter USE flag for cairo, fontconfig, libXft and freetype and you'll have everything you need except infinality's fontconfig rules and .Xresources configuration.


OK, someone help me please. My fonts have taken a turn for the worse with this change. They look washed up and have blurs around turns. What I did:

1. Added lcd-filtering overlay as bi3l has added all patches to his overlay.
2. Enabled lcdfilter and removed cleartype USE flag.
3. Emerged cairo fontconfig freetype libXft. They had lcdfilter enabled as shown by emerge command output with -v.
4. I copied the /etc/fonts/local.conf to /etc/fonts/conf.d/51-local.conf.
5. Edited ~/.Xresources and added:
Code:
! Settings from Infinality
Xft.autohint:                   0
Xft.lcdfilter:                  lcddefault
Xft.hintstyle:                  hintfull
Xft.hinting:                    1
Xft.antialias:                  1
Xft.dpi:                        96
Xft.rgba:                       rgb

6. Made the 'eselect fontconfig list' look like the following:
Code:
# eselect fontconfig list
Available fontconfig .conf files (* is enabled):
  [1]   10-antialias.conf *
  [2]   10-autohint.conf
  [3]   10-hinting.conf *
  [4]   10-hinting-full.conf *
  [5]   10-hinting-medium.conf
  [6]   10-hinting-slight.conf
  [7]   10-no-sub-pixel.conf
  [8]   10-sub-pixel-bgr.conf
  [9]   10-sub-pixel-rgb.conf *
  [10]  10-sub-pixel-vbgr.conf
  [11]  10-sub-pixel-vrgb.conf
  [12]  10-unhinted.conf
  [13]  11-lcd-filter-lcddefault.conf
  [14]  20-fix-globaladvance.conf
  [15]  20-unhint-small-dejavu-sans.conf
  [16]  20-unhint-small-dejavu-sans-mono.conf
  [17]  20-unhint-small-dejavu-serif.conf
  [18]  20-unhint-small-vera.conf
  [19]  25-unhint-nonlatin.conf
  [20]  30-metric-aliases.conf *
  [21]  30-urw-aliases.conf *
  [22]  40-nonlatin.conf *
  [23]  45-latin.conf *
  [24]  49-sansserif.conf *
  [25]  50-user.conf
  [26]  51-local.conf *
  [27]  53-monospace-lcd-filter.conf
  [28]  57-dejavu-sans.conf
  [29]  57-dejavu-sans-mono.conf
  [30]  57-dejavu-serif.conf
  [31]  60-latin.conf *
  [32]  65-fonts-persian.conf *
  [33]  65-khmer.conf
  [34]  65-nonlatin.conf *
  [35]  69-unifont.conf *
  [36]  70-no-bitmaps.conf *
  [37]  70-yes-bitmaps.conf
  [38]  80-delicious.conf *
  [39]  90-synthetic.conf *
I restarted thunderbird and bam! Fonts are worse than before.

So, what did I do to deserve faded, blurry, washed up fonts? My favorite font 'Fontin' is looking horrible!
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Wed Sep 15, 2010 3:17 am    Post subject: Reply with quote

bi3l wrote:
I've commited infinality's patchset to the LCD filtering overlay. Enable the lcd-filter USE flag for cairo, fontconfig, libXft and freetype and you'll have everything you need except infinality's fontconfig rules and .Xresources configuration.
How come the Emboldening patch is not included in the patchset?
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Wed Sep 15, 2010 4:30 am    Post subject: Reply with quote

This was as painful as I had expected it. The end result is I can't even restore the damn thing to my font appearance that I had earlier....sigh!

What a classic waste of time! Man, I am really upset now!
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Sep 15, 2010 9:04 am    Post subject: Reply with quote

devsk wrote:
Emerged cairo fontconfig freetype libXft

Your compilation order is wrong. God knows what made you do that. The correct order is as I already stated above, and have repeated many times in this huge thread.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Wed Sep 15, 2010 3:57 pm    Post subject: Reply with quote

PaulBredbury wrote:
devsk wrote:
Emerged cairo fontconfig freetype libXft

Your compilation order is wrong. God knows what made you do that. The correct order is as I already stated above, and have repeated many times in this huge thread.
Does the order matter if you fire that command twice?

And i just checked: portage emerges them in order, no matter how you specify them on the command line as long as they are all specified, which I did.

So, that's not the cause.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Sep 16, 2010 10:13 am    Post subject: Reply with quote

devsk wrote:
Does the order matter if you fire that command twice?

No.

devsk wrote:
/etc/fonts/conf.d/51-local.conf

That's a bad choice of filename, because it already exists, as a symlink created by fontconfig. I prefer and use ~/.fonts.conf

Infinality wrote:
Anybody seen patches around that will allow you to specify the LCD filter weights with fontconfig?

I looked, but can't find any. There's the bug report, resulting in FT_Library_SetLcdFilterWeights in freetype2, but no fontconfig patch to use it.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Thu Sep 16, 2010 2:18 pm    Post subject: Reply with quote

PaulBredbury wrote:
devsk wrote:
/etc/fonts/conf.d/51-local.conf

That's a bad choice of filename, because it already exists, as a symlink created by fontconfig. I prefer and use ~/.fonts.conf
Why do you think I wouldn't have verified what that contained originally and either merged it or deemed it unnecessary? It was just setting hintslight and rgba=none for Segui UI and Consolas fonts.

Again, not a problem.

Got something else?

One thing I notice is that cairo's ubuntu patch in lcd filtering overlay is very minimal and changes only config or makefile stuff in 1.10 whereas it changed a tonne of real C code for 1.8. Is that right?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Sep 16, 2010 2:45 pm    Post subject: Reply with quote

Ubuntu's patches were applied upstream - example.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Thu Sep 16, 2010 5:02 pm    Post subject: Reply with quote

OK. It seems like infinality's patches screw up certain fonts while making some other fonts look good. When I moved to Lucida Grande, things are looking much better.

My favorite font Fontin is rendered pretty crappy by infinality's patch.

@infinality: can you please use the Fontin font and test to see what tuning is needed to render that font better with your patch? I see you have tweaks for Lucida, Verdana etc. in the code. Fontin rendering is full of smears in 'e', 'S' etc. Basically, wherever there is a curve. Bold Fontin is completely unreadable.

Yes, Lucida Grande is rendered much better than I have ever seen it. At all sizes.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Sep 16, 2010 5:15 pm    Post subject: Reply with quote

Infinality has more changes - for the "main patch", use 20100916-1 instead of 20100909-2.

My quick impression is that it looks better, and "sharper".
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Thu Sep 16, 2010 5:19 pm    Post subject: Reply with quote

PaulBredbury wrote:
Infinality has more changes - for the "main patch", use 20100916-1 instead of 20100909-2.

My quick impression is that it looks better, and "sharper".
Crap! Another one! I just downloaded the 0914 yesterday night and replaced it inside lcd-filtering overlay.
Back to top
View user's profile Send private message
Infinality
n00b
n00b


Joined: 12 Aug 2010
Posts: 24
Location: Wisconsin, USA

PostPosted: Thu Sep 16, 2010 11:55 pm    Post subject: Reply with quote

devsk wrote:
OK. It seems like infinality's patches screw up certain fonts while making some other fonts look good. When I moved to Lucida Grande, things are looking much better.

My favorite font Fontin is rendered pretty crappy by infinality's patch.

@infinality: can you please use the Fontin font and test to see what tuning is needed to render that font better with your patch? I see you have tweaks for Lucida, Verdana etc. in the code. Fontin rendering is full of smears in 'e', 'S' etc. Basically, wherever there is a curve. Bold Fontin is completely unreadable.

Yes, Lucida Grande is rendered much better than I have ever seen it. At all sizes.


It looks like this font has few or no truetype instructions in it, in which case, it isn't going to render will with a truetype interpreter. One of my goals is to make it so that fonts without instructions render nicely, however there is already a solution that is most of the way there- the freetype autohinter. Why not just have this font use autohinting, via your fonts.conf or local.conf?
Back to top
View user's profile Send private message
Infinality
n00b
n00b


Joined: 12 Aug 2010
Posts: 24
Location: Wisconsin, USA

PostPosted: Thu Sep 16, 2010 11:58 pm    Post subject: Reply with quote

PaulBredbury wrote:
Infinality has more changes - for the "main patch", use 20100916-1 instead of 20100909-2.

My quick impression is that it looks better, and "sharper".


I would tend to agree with your impression. Some of the change is very subtle, but I did notice this as well. The only significant change I did was to disable the "grayscale" flag when "subpixel" was enabled. Apparently some bytecode instructions DO make a differentiation there. Previously, I just left the grayscale flag enabled, because I *assumed* it didn't matter! :D
Back to top
View user's profile Send private message
Infinality
n00b
n00b


Joined: 12 Aug 2010
Posts: 24
Location: Wisconsin, USA

PostPosted: Fri Sep 17, 2010 12:05 am    Post subject: Fontin Reply with quote

devsk- I'll add all the fonts from this page into my /etc/fonts/local.conf under "autohint" for the time being, until they look nicer with the TT interpreter:

http://www.josbuivenga.demon.nl/fontin.html

(edit: Oh yeah, and Lucida Grande looks awesome with the patch! Completely agree!)


Last edited by Infinality on Fri Sep 17, 2010 12:09 am; edited 1 time in total
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Fri Sep 17, 2010 12:09 am    Post subject: Reply with quote

Infinality wrote:
devsk wrote:
OK. It seems like infinality's patches screw up certain fonts while making some other fonts look good. When I moved to Lucida Grande, things are looking much better.

My favorite font Fontin is rendered pretty crappy by infinality's patch.

@infinality: can you please use the Fontin font and test to see what tuning is needed to render that font better with your patch? I see you have tweaks for Lucida, Verdana etc. in the code. Fontin rendering is full of smears in 'e', 'S' etc. Basically, wherever there is a curve. Bold Fontin is completely unreadable.

Yes, Lucida Grande is rendered much better than I have ever seen it. At all sizes.


It looks like this font has few or no truetype instructions in it, in which case, it isn't going to render will with a truetype interpreter. One of my goals is to make it so that fonts without instructions render nicely, however there is already a solution that is most of the way there- the freetype autohinter. Why not just have this font use autohinting, via your fonts.conf or local.conf?
Ohh you bugger! You really know what you are talking about! Done! Fontin looks very good now.

One more issue, and I think I would stop bugging you after that: The capital letters look zoomed out and total stand out. I think way more than they should. This is with the Lucida Grande font.
Back to top
View user's profile Send private message
Infinality
n00b
n00b


Joined: 12 Aug 2010
Posts: 24
Location: Wisconsin, USA

PostPosted: Fri Sep 17, 2010 12:10 am    Post subject: Reply with quote

devsk wrote:
One more issue, and I think I would stop bugging you after that: The capital letters look zoomed out and total stand out. I think way more than they should. This is with the Lucida Grande font.


Can you post a screenshot somewhere?
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Fri Sep 17, 2010 12:32 am    Post subject: Reply with quote

Infinality wrote:
devsk wrote:
One more issue, and I think I would stop bugging you after that: The capital letters look zoomed out and total stand out. I think way more than they should. This is with the Lucida Grande font.


Can you post a screenshot somewhere?
I think it just may be the fact that I am not used to this look. But I will try to post a screenshot.
Back to top
View user's profile Send private message
Infinality
n00b
n00b


Joined: 12 Aug 2010
Posts: 24
Location: Wisconsin, USA

PostPosted: Fri Sep 17, 2010 1:56 am    Post subject: Update Soon... Reply with quote

I will have an update soon... maybe this weekend, that will make even more dramatic improvements to most MS legacy fonts in particular. Arial, Trebuchet, and Tahoma look fantastic! I found a nice tweak in light of the latest grayscale variable removal.
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Fri Sep 17, 2010 9:21 am    Post subject: Reply with quote

That would be great!

EDIT: Best. Overlay. Ever. At last SegoeUI looks like in Win7. :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3 ... 13, 14, 15 ... 27, 28, 29  Next
Page 14 of 29

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum