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 ... 12, 13, 14 ... 27, 28, 29  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Tue Aug 24, 2010 9:19 am    Post subject: Reply with quote

would using the auto-hinter useflag on freetype help or cause more issues?
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Tue Aug 24, 2010 12:33 pm    Post subject: Reply with quote

Carps wrote:
would using the auto-hinter useflag on freetype help or cause more issues?

Disable it - it won't help in the slightest. You can see from the ebuild what it does.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Tue Aug 24, 2010 12:38 pm    Post subject: Reply with quote

its not enabled, i was just wondering, i am using your fonts.conf atm and am trying to tweak the hell out anything i can to make the fonts look good :-)

edit what about the lcdfilter flag?
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
norg
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2010
Posts: 104
Location: Augsburg (Germany)

PostPosted: Tue Aug 24, 2010 12:59 pm    Post subject: Reply with quote

How did you manage to get this overlay ebuild working, so that the overlay ebuild is used instead of the one from the default portage tree?
Code:
root@gentoo_ws:~ # layman -a lcd-filtering
* Running command "/usr/bin/git clone "git://gitorious.org/lcd-filtering/lcd-filtering.git" "/var/lib/layman/lcd-filtering""...
Initialized empty Git repository in /var/lib/layman/lcd-filtering/.git/
remote: Counting objects: 121, done.
remote: Compressing objects: 100% (117/117), done.
remote: Total 121 (delta 41), reused 0 (delta 0)
Receiving objects: 100% (121/121), 77.59 KiB | 63 KiB/s, done.
Resolving deltas: 100% (41/41), done.
* Successfully added overlay "lcd-filtering".
root@gentoo_ws:~ # eix-update -a lcd-filtering
Reading Portage settings ..
Building database (/var/cache/eix) ..
[0] "gentoo" /usr/portage/ (cache: metadata-flat)
     Reading category 154|154 (100%) Finished             
[1] "" /usr/portage/local/overlay (cache: parse|ebuild*#metadata-flat#assign)
     Reading category 154|154 (100%) Finished     
[2] "" lcd-filtering (cache: parse|ebuild*#metadata-flat#assign)
     Reading category 154|154 (100%) EMPTY!

So layman -a did succeed but it seems to be empty

Edit: i forgot to update the /etc/make.conf :)

So still the issue with fonts like Verdana, Arial etc. that they look messed up.

On my old debian system i used dpkg-reconfigure fontconfig and the settings that made everything fine were:
1. Hinting: Native (instead of Automatic or None) 2. Subpixel: Automatich (instead of Always/Never, although it doesn't affect firefox) 3. Bitmapfonts: yes (without yes fonts like terminus wont work).
So i made two screenshots to show the difference.

Screenshots with Gentoo:
http://andi.wootstube.de/up/2010-08-25-024230_1280x1006_scrot.png
http://andi.wootstube.de/up/2010-08-25-024317_1280x1006_scrot.png

Screenshots with Debian:
http://andi.wootstube.de/up/2010-08-24-220836_1280x1006_scrot.png
http://andi.wootstube.de/up/2010-08-24-220933_1280x1006_scrot.png

corefonts are installed on both system.

Edit2: Another confusing fact, on my gentoo system at work i have the same settings and the fonts are much better. What i found out that xdpyinfo tells me that the 19" LCD at work has 96x96DPI but the 19" LCD has 85x86DPI although both are running on 1280x1024. May this be the issue for the fonts?

Edit3: A nice tool to see what effects hinting and antialiasing will have is "gwaterfall" (you need to get the source from debian). It's just weird that it needs to be started by root to get hint/antialias switch working. Maybe this will help some of you with generating a suitable font.conf.
Ah the issue with root is, that gwaterfall won't work when you have a .fonts.conf, so move it to test font settings.

ok i found the problem but i have no good fix. Althought the FontPath for corefonts is the first in my xorg.conf the corefonts aren't used as first choice.
Code:
Section "Files"
    FontPath        "/usr/share/fonts/terminus"
    FontPath        "/usr/share/fonts/corefonts"
    FontPath        "/usr/share/fonts/100dpi/"
    FontPath        "/usr/share/fonts/75dpi/"
    FontPath        "/usr/share/fonts/misc/"
   ...
EndSection

But when i use lsof:
Code:
root@gentoo_ws:~ # lsof | grep fonts
firefox-b 17590       andi  mem       REG              253,5   139640    1976947 /usr/share/fonts/corefonts/verdana.ttf
firefox-b 17590       andi  mem       REG              253,5   154264    1976951 /usr/share/fonts/corefonts/verdanai.ttf
firefox-b 17590       andi  mem       REG              253,5   360337    1859245 /usr/share/fonts/misc/12x13ja.pcf.gz
firefox-b 17590       andi  mem       REG              253,5    96263    2362229 /usr/share/fonts/default/ghostscript/n022003l.pfb
firefox-b 17590       andi  mem       REG              253,5   275572    1976933 /usr/share/fonts/corefonts/arial.ttf
firefox-b 17590       andi  mem       REG              253,5    17969    1859416 /usr/share/fonts/misc/7x13B.pcf.gz
firefox-b 17590       andi  mem       REG              253,5    66372    2362267 /usr/share/fonts/TTF/luxisri.ttf
firefox-b 17590       andi  mem       REG              253,5    26355    1859376 /usr/share/fonts/misc/6x10.pcf.gz
firefox-b 17590       andi  mem       REG              253,5   136032    1978205 /usr/share/fonts/corefonts/verdanab.ttf
firefox-b 17590       andi  mem       REG              253,5    71784    2362294 /usr/share/fonts/TTF/luximr.ttf
firefox-b 17590       andi  mem       REG              253,5     4459    1859430 /usr/share/fonts/misc/6x10-ISO8859-1.pcf.gz
firefox-b 17590       andi  mem       REG              253,5     5063    1880230 /usr/share/fonts/terminus/ter-112n.pcf.gz

So now Courier from corefonts is used to render the code section here in the forum. At least some are working like arial and verdana.
Is there anything else i have to check except xorg.conf?
Chromium is doing it right, lsof says /usr/share/fonts/corefonts/cour.ttf

I tried moving all the /usr/share/fonts directories except the corefonts and so i can force corefonts/cour.ttf but that seems to be the right way.
I also tried a fresh archlinux install in vbox and there it's working out of the box, here the comparison (left gentoo, right arch):
http://img178.imageshack.us/img178/4817/201008252133322560x1024.png
you can see the difference on the "@" for example.


Last edited by norg on Thu Aug 26, 2010 10:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
norg
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2010
Posts: 104
Location: Augsburg (Germany)

PostPosted: Thu Aug 26, 2010 10:16 pm    Post subject: Reply with quote

ok i think i fixed it, at least most of it. I switched back to firefox instead of firefox-bin. Although i don't know what's the exact difference.
But there seems to be a bug with "courier" in corefonts. The "code" segment here uses courier then courier new then monospace. If i forbid using courier firefox switches to courier new and it's looking fine. If i look at lsof, firefox doesn't user courier from corefonts but he uses courier new. Well cour.ttf is used when i force courier new, when courier is used lsof prints no relation to the corefonts folder so i guess it must be one of the pcf.gz from the misc folder.

So i want to have courier and maybe courier new replaced, so i tried:
Code:

 </match>
   <!-- Replace Courier New with a better-looking font -->
   <match target="pattern" name="family">
      <test name="family" qual="any">
         <string>Courier New</string>
      </test>
      <edit name="family" mode="assign">
         <!-- Other choices - Andale Mono, Courier New, Luxi Mono, Bitstream Vera Sans Mono -->
         <string>Bitstream Vera Sans Mono</string>
      </edit>
   </match>
   <!-- Replace Courier New with a better-looking font -->
   <match target="pattern" name="family">
      <test name="family" qual="any">
         <string>Courier</string>
      </test>
      <edit name="family" mode="assign">
         <!-- Other choices - Andale Mono, Courier New, Luxi Mono, Bitstream Vera Sans Mono -->
         <string>Bitstream Vera Sans Mono</string>
      </edit>
   </match>

But firefox ignores this, when i use the fontfinder addon and forbid courier/courier new it's working. And yes bitstream is installed :)

Edit:
The wrong courier is /usr/share/fonts/default/ghostscript/n022003l.pfb so Nimbus Mono L was mapped to Courier cause of 30-metric-aliases.conf. I think this should be removed from default fontconfig settings.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Aug 27, 2010 4:16 am    Post subject: Reply with quote

norg wrote:
firefox-bin

That won't use the system cairo - need --enable-system-cairo

Your fontconfig rant makes very little sense.

I will repeat again, Infinality's font rendering is superior to Ubuntu's, making most font substitutions unnecessary, because Infinality's font rendering makes the non-substituted fonts look good enough.
Back to top
View user's profile Send private message
lessless
n00b
n00b


Joined: 12 Aug 2010
Posts: 19

PostPosted: Fri Aug 27, 2010 8:23 am    Post subject: Reply with quote

where is the link to the how-to ? :)
Back to top
View user's profile Send private message
norg
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2010
Posts: 104
Location: Augsburg (Germany)

PostPosted: Fri Aug 27, 2010 12:11 pm    Post subject: Reply with quote

PaulBredbury wrote:
Your fontconfig rant makes very little sense.

May be but this fixed the issue with Nimbus Mono L used instead of switching to Courier New in Firefox. Chromium does this without changing 30-metric-aliases.conf
PaulBredbury wrote:
I will repeat again, Infinality's font rendering is superior to Ubuntu's, making most font substitutions unnecessary, because Infinality's font rendering makes the non-substituted fonts look good enough.

And i tried this patch and it looks nice, but the above problem with Nimbus Mono L for Courier was still there.

Edit:
Ok i found out, that with the patch "lcdfilter" from lcd-filtering overlay it looks worse :/
It's not that sharp.

freetype etc. with lcd-filtering overlay patch:

http://andi.wootstube.de/up/2010-08-27-144009_1280x1006_scrot.png

freetype etc. without the patch:

http://andi.wootstube.de/up/2010-08-27-144404_1280x1006_scrot.png

disabled 30-metric-alias.conf:

http://andi.wootstube.de/up/2010-08-27-144656_1280x1006_scrot.png

As you can see with gentoo default settings it looks sharper then with the patch from the overlay and disabling 30-metric helps for the code segment.
Although the rest of the 30-metric.conf is good for arial, so i just deleted the courier part.
Back to top
View user's profile Send private message
chabo
n00b
n00b


Joined: 25 Sep 2007
Posts: 24

PostPosted: Fri Sep 03, 2010 10:32 am    Post subject: Reply with quote

to PaulBredbury:

Hello,
so You use only /etc/fonts/local.conf and and your ~/.fonts.conf after Infinality patch?
thanks
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Sep 03, 2010 10:57 am    Post subject: Reply with quote

chabo wrote:
use only /etc/fonts/local.conf and and your ~/.fonts.conf

Well, there's still the configuration from fontconfig's default install, in /etc/fonts/conf.d/ (as symlinks) which I don't mess with:

Code:
$ ls /etc/fonts/conf.d/

10-no-sub-pixel.conf       20-unhint-small-vera.conf  30-replace-bitmap-fonts.conf  40-nonlatin.conf  49-sansserif.conf  51-local.conf  65-fonts-persian.conf  69-unifont.conf    90-synthetic.conf
20-fix-globaladvance.conf  30-metric-aliases.conf     30-urw-aliases.conf            45-latin.conf     50-user.conf       60-latin.conf  65-nonlatin.conf       80-delicious.conf
Back to top
View user's profile Send private message
chabo
n00b
n00b


Joined: 25 Sep 2007
Posts: 24

PostPosted: Fri Sep 03, 2010 11:02 am    Post subject: Reply with quote

Thanks, will try
Back to top
View user's profile Send private message
Infinality
n00b
n00b


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

PostPosted: Sat Sep 04, 2010 5:16 am    Post subject: Updated Patch Reply with quote

If anyone is interested, I updated my patch to include the Gentoo modifications as well as a new enhancement to synthetic emboldening. Enjoy:

http://www.infinality.net/blog/?p=67
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Sep 04, 2010 10:45 am    Post subject: Re: Updated Patch Reply with quote

Infinality wrote:
a new enhancement to synthetic emboldening

Yeah, it looks better - and gotten from just removing one line of code :)
Code:
outline->points[n].y = v_cur.y + strength + in.y;


I've updated my git-following patch.
Back to top
View user's profile Send private message
Infinality
n00b
n00b


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

PostPosted: Sat Sep 04, 2010 12:04 pm    Post subject: Reply with quote

You don't want to know how much time I spent finding and commenting out that line of code. ;)
Back to top
View user's profile Send private message
chabo
n00b
n00b


Joined: 25 Sep 2007
Posts: 24

PostPosted: Sun Sep 05, 2010 6:13 pm    Post subject: Reply with quote

PaulBredbury wrote:
chabo wrote:
use only /etc/fonts/local.conf and and your ~/.fonts.conf

Well, there's still the configuration from fontconfig's default install, in /etc/fonts/conf.d/ (as symlinks) which I don't mess with:

Code:
$ ls /etc/fonts/conf.d/

10-no-sub-pixel.conf       20-unhint-small-vera.conf  30-replace-bitmap-fonts.conf  40-nonlatin.conf  49-sansserif.conf  51-local.conf  65-fonts-persian.conf  69-unifont.conf    90-synthetic.conf
20-fix-globaladvance.conf  30-metric-aliases.conf     30-urw-aliases.conf            45-latin.conf     50-user.conf       60-latin.conf  65-nonlatin.conf       80-delicious.conf


Just one more question.
Do You use some packages from lcd-filtering overlay or only default gentoo repository plus patched freetype?
I've tried that patch, it looks really nice, but don't know if is it using by all application.
Thanks
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Sep 05, 2010 7:31 pm    Post subject: Reply with quote

chabo wrote:
Do You use some packages from lcd-filtering overlay

I use Lunar Linux, and for now am still using my own versions of fontconfig, libXft and cairo which include Ubuntu's patches (and my cairo-respect-fontconfig.patch) - basically equivalent to those in the lcd-filtering overlay.

Edit: You need fontconfig, libXft and cairo from the lcd-filtering overlay, otherwise cairo *won't* use the patched freetype's improved rendering.


Last edited by PaulBredbury on Thu Sep 09, 2010 5:58 am; edited 1 time in total
Back to top
View user's profile Send private message
jsevilleja
n00b
n00b


Joined: 21 May 2010
Posts: 14

PostPosted: Mon Sep 06, 2010 11:56 pm    Post subject: Reply with quote

PaulBredbury wrote:
Infinality has a great freetype patch for sub- rather than whole-pixel hinting, which has better font spacing, as an alternative to Ubuntu's freetype LCD patch.

Here's a freetype-2.4.2-infinality-20100904.patch all-in-one patch I've made for freetype 2.4.2 - take a look at it, to see what it contains.

I still also recommend adding:
sed -i -e "s:0x10, 0x40, 0x70, 0x40, 0x10:0x1c, 0x38, 0x55, 0x38, 0x1c:" src/base/ftlcdfil.c


Old stuff:

freetype-2.4.2-infinality-20100903.patch
freetype-2.4.2-infinality-20100828.patch
Old patch
Here's an all-in-one patch I've made for freetype 2.4.0 (also works with freetype 2.4.1)
Edit: Got "hinting" vs "filtering" confused :)
Edit2: Here's the patch for freetype 2.4.2
Edit3: Added upstream patches.


Is there any guide or something? I've edited freetype ebuild from lcd-filtering and tried to apply the patch (freetype-2.4.2-infinality-20100904.patch), but when emerging, it always fails.

EDIT: I managed to build freetype with infinality patch (lcd-filtering ebuild + infinality). What do I've to do now? Thanks
Back to top
View user's profile Send private message
chabo
n00b
n00b


Joined: 25 Sep 2007
Posts: 24

PostPosted: Wed Sep 08, 2010 2:25 pm    Post subject: Reply with quote

I think after pacth of freetype You should use .fonts.conf from PaulBredbury or /etc/fonts/local.conf from Infinality's web. Also You have to use "lcdfilter" flag for x11-libs/cairo and it's all(same for x11-libs/libXft if You use lcd-filtering overlay)
Back to top
View user's profile Send private message
rahulthewall
Veteran
Veteran


Joined: 01 Nov 2007
Posts: 1264
Location: Zürich

PostPosted: Thu Sep 09, 2010 10:31 pm    Post subject: Reply with quote

I just updated the following packages from the lcd-filtering overlay:

Code:

##LCD Filtering Overlay
media-libs/fontconfig lcdfilter -cleartype
media-libs/freetype lcdfilter -cleartype
x11-libs/cairo glitz lcdfilter -cleartype
x11-libs/libXft lcdfilter -cleartype


Whether or not this is a horrible combination of use flags I would like to know. Also, what should my .fonts.conf look like?
_________________
Who shall guard the guards?
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 10, 2010 12:47 am    Post subject: Updated Patch Reply with quote

Yet another patch update. Among a few enhancements, this one also removed a couple things I think you guys had enabled in modules.cfg, just so you are aware.

http://www.infinality.net/blog/?p=67
Back to top
View user's profile Send private message
SlashBeast
Moderator
Moderator


Joined: 23 May 2006
Posts: 2843

PostPosted: Sat Sep 11, 2010 8:21 pm    Post subject: Reply with quote

Is lcd-filtering still maintained? Maybe some of you will ask for commit rights and will push updates because looks like owner of this overlay does not (for some reason) update it.
_________________
BitBucket -- better-initramfs
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


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

PostPosted: Mon Sep 13, 2010 4:30 am    Post subject: Reply with quote

Can someone please tell what patch needs to be applied on top what's in portage at this time?

Which packages are to be modified? freetype, libXft. Anything else?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Sep 13, 2010 10:38 am    Post subject: Reply with quote

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 - this is the "backup" settings for crappy/old programs which don't use fontconfig.
7. Restart your apps (e.g. firefox) and marvel at the beautiful fonts.

Edit: Clarified why ~/.Xresources is used.


Last edited by PaulBredbury on Sun Sep 04, 2011 8:44 pm; edited 2 times in total
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1310
Location: Netherlands

PostPosted: Mon Sep 13, 2010 11:04 am    Post subject: Reply with quote

Thank you very much Paul for this splendid summary!

Can't Infinality's freetype patches not be merged in the lcd-filtering overlay (like all the other patches)? Otherwise it's quite some hazzle to get all the bits & pieces together from different overlays and keep them uptodate ...

Kindly yours
swimmer
Back to top
View user's profile Send private message
ssteinberg
Apprentice
Apprentice


Joined: 09 Jul 2010
Posts: 206
Location: Israel

PostPosted: Mon Sep 13, 2010 11:55 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).
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.


Tried this and took screenshot to compare against cairo with cleartype. Quality isn't bad, but as much as I tried, cleartype seems to produce clearer, crispier fonts on my LCD. I am sticking with cleartype.
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 ... 12, 13, 14 ... 27, 28, 29  Next
Page 13 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