Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

[HOWTO]New freetype subpixel font rendering for lcd monitors

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Locked
Advanced search
728 posts
  • Page 26 of 30
    • Jump to page:
  • Previous
  • 1
  • …
  • 24
  • 25
  • 26
  • 27
  • 28
  • …
  • 30
  • Next
Author
Message
ocin
Guru
Guru
Posts: 500
Joined: Sun Jan 01, 2006 9:19 pm

Post by ocin » Fri Sep 26, 2008 5:55 pm

font ebuilds are in "devnull" now too.
Last edited by ocin on Mon Oct 06, 2008 7:44 pm, edited 2 times in total.
Top
kokoko3k
n00b
n00b
Posts: 72
Joined: Fri May 06, 2005 4:16 pm

Post by kokoko3k » Mon Sep 29, 2008 7:19 am

mwhitlock wrote:
kokoko3k wrote:What about kde4 and/or qt4?
As far as i know, qt4 doesn't use cairo nor Xft.
I have the Last.fm player installed, and it uses Qt4, and its fonts look identical to those of the rest of my system, so I would guess that Qt4 refrains from messing with the glyphs it receives from FreeType, which means they remain properly filtered for LCD.
That's not true for me, as you can check here:
http://www.hdimage.org/images/mycnapq2q ... _zool1.png
qtconfig from qt-3.3.8-r4 on the left (which uses xft), qtconfig from qt-4.3.4-r1- on the right, both uses Lucida Sans Unicode, but they look different.
My .fonts.conf, nothing special:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>rgb</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintmedium</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>rgb</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font" >
  <test compare="more" name="weight" >
   <const>medium</const>
  </test>
  <edit mode="assign" name="hintstyle" >
   <const>hintfull</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="antialias" >
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>
By the way, i used: http://ogmrip.sourceforge.net/misc/gent ... ng.tar.bz2
Top
mwhitlock
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 89
Joined: Mon Aug 07, 2006 10:52 am
Location: New Hampshire, USA
Contact:
Contact mwhitlock
Website

Post by mwhitlock » Mon Sep 29, 2008 10:21 am

kokoko3k wrote:
mwhitlock wrote:I have the Last.fm player installed, and it uses Qt4, and its fonts look identical to those of the rest of my system, so I would guess that Qt4 refrains from messing with the glyphs it receives from FreeType, which means they remain properly filtered for LCD.
That's not true for me, as you can check here:
http://www.hdimage.org/images/mycnapq2q ... _zool1.png
qtconfig from qt-3.3.8-r4 on the left (which uses xft), qtconfig from qt-4.3.4-r1- on the right, both uses Lucida Sans Unicode, but they look different.
My comparison shot: http://img407.imageshack.us/my.php?imag ... sonal0.png
You are right that they aren't identical. However, I think the Qt4 rendering looks better in my case. I think Qt4 looks worse in your case. Of course, this is all subjective.
Top
natros
n00b
n00b
Posts: 70
Joined: Fri Sep 26, 2003 10:46 pm

Post by natros » Mon Sep 29, 2008 7:49 pm

just to make clear about qt4 font rendering
http://labs.trolltech.com/blogs/2008/09 ... ng-on-x11/
-=[abit ip35 pro core2quad q6600 (oc 3.0 ghz) 8 gb ram 2x320 raid0 ext4 xfx8800gt 512mb]=-
Top
kokoko3k
n00b
n00b
Posts: 72
Joined: Fri May 06, 2005 4:16 pm

Post by kokoko3k » Wed Oct 01, 2008 3:14 pm

Glad to read your link.
I think sroedal is talking about a bug i submitted some months ago to trolltech, i totally missed it, thanks.
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

Post by PaulBredbury » Wed Oct 01, 2008 3:24 pm

Regarding the cairo bug with qt4, try this patch from my Fedora 9 font packages:

Code: Select all

-    if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)
+    options->base.hint_style = CAIRO_HINT_STYLE_DEFAULT;
+
+    if (other->base.hint_style != CAIRO_HINT_STYLE_DEFAULT)
Taken from bug 11838 and bug 13335.

Edit: Qt4 is broken and doesn't use Cairo anyway. But this patch is useful to make Gnome respect ~/.fonts.conf :)
Last edited by PaulBredbury on Fri Oct 10, 2008 4:14 pm, edited 2 times in total.
Top
octoploid
n00b
n00b
User avatar
Posts: 65
Joined: Sat Oct 21, 2006 7:09 am

Post by octoploid » Wed Oct 01, 2008 5:58 pm

aliquid wrote:From cairo 1.8.0 release announcement:
Note also that the code that had been in cairo 1.7.x calling into
freetype's optional lcd_filter function was removed from cairo before
the 1.8.0 release. We do expect this code to come back in some form in
the future.
Sad, but no lcd font rendering for now.

Edit:
Here's a reason:
Remove all lcd_filter code.
We reverted the public API for setting lcd_filter font options back in 1b42bc8033bc , but we had left the implementation which would examine fontconfig and Xft properties for the option, and which would call into freetype for subpixel glyph rasterization. However, I recently realized, (and the test suite had been trying to tell me for a while), that this approach would cause a regression for users who were previously using sub-pixel text, but without sub-pixel rendering built directly into freetype. That's not acceptable, so all the code is coming out for now.
Well, I just reverted the revert and cairo 1.8.0 is working fine here.

(this is what I did:

Code: Select all

git clone git://anongit.freedesktop.org/git/cairo
cd cairo
git revert 5d887ad5dca5af0f8216830d1b04d08a5aba9bee
git format-patch -k -m --stdout origin > cairo.patch
And than added "epatch cairo.patch" to the cairo-1.8.0.ebuild...)
Myself and mine gymnastic ever
Top
mwhitlock
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 89
Joined: Mon Aug 07, 2006 10:52 am
Location: New Hampshire, USA
Contact:
Contact mwhitlock
Website

Post by mwhitlock » Fri Oct 03, 2008 7:12 am

octoploid wrote:Well, I just reverted the revert and cairo 1.8.0 is working fine here.
Thanks for the instructions, octoploid.

If anyone else wants the patch without needing to emerge git, here it is: http://www.mattwhitlock.com/cairo-1.8.0-lcdfilter.patch

Also, you don't have to hack the cairo-1.8.0 ebuild. You can just manually do the patch after the unpack phase but before compilation:

Code: Select all

ebuild /usr/portage/x11-libs/cairo/cairo-1.8.0.ebuild unpack
( cd /var/tmp/portage/x11-libs/cairo-1.8.0/work/cairo-1.8.0/ && patch -p1 < ~/cairo-1.8.0-lcdfilter.patch )
ebuild /usr/portage/x11-libs/cairo/cairo-1.8.0.ebuild merge
EDIT: Cairo 1.8.0 with this patch looks terrible. Do I need to do something with my ~/.fonts.conf?

EDIT #2: Apparently, "lcddefault" is not the default for the "lcdfilter" option. How counter-intuitive! It appears that "lcdlegacy" is the value used for the "lcdfilter" option if the option is absent. I added the following to my ~/.fonts.conf:

Code: Select all

<match target="font">
 <edit mode="assign" name="lcdfilter">
  <const>lcddefault</const>
 </edit>
</match>
and now my cairo-1.8.0 looks identical to cairo-1.6.4-r1 with bi3l's patch.
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

Post by PaulBredbury » Fri Oct 03, 2008 11:43 am

mwhitlock wrote:Apparently, "lcddefault" is not the default for the "lcdfilter" option. How counter-intuitive!
Yep. Happily, Ubuntu does the sensible thing:
* add debian/patches/06_ubuntu_lcddefault.patch: set lcddefault as default for the lcd-filter now that Cairo prefers lcdlegacy. This is needed to restore our previous behavior.
Although I prefer adding a single line to /etc/X11/Xresources:

Code: Select all

Xft.lcdfilter: lcddefault
Top
manwe_
l33t
l33t
User avatar
Posts: 650
Joined: Wed Feb 01, 2006 4:10 pm
Location: Universe

Post by manwe_ » Fri Oct 03, 2008 3:05 pm

Yesterday I was working on OS X and have to say, fonts are looking great on Mac. Is there any way to config Gentoo to display fonts similiar? This is my system now [Segoe UI, 10pt]:
http://img125.imageshack.us/img125/218/ ... toorf7.png

And this is small comparison between XP and OS X I've found:
http://images.damieng.com/blog/WindowsAt11.png
http://images.damieng.com/blog/MacAt13.png

I just luv this boldness.
Top
bi3l
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Thu Feb 06, 2003 10:37 am
Location: France

Post by bi3l » Fri Oct 03, 2008 9:53 pm

I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.

The tarball is here: http://ogmrip.sourceforge.net/misc/gent ... ng.tar.bz2
Top
solshark
n00b
n00b
Posts: 17
Joined: Sat Mar 24, 2007 11:00 am
Contact:
Contact solshark
Website

Post by solshark » Fri Oct 03, 2008 10:11 pm

bi3l wrote:I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.

The tarball is here: http://ogmrip.sourceforge.net/misc/gent ... ng.tar.bz2
Thx for your great job!
my russian blog: http://solshark.i-seo.biz
Top
mwhitlock
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 89
Joined: Mon Aug 07, 2006 10:52 am
Location: New Hampshire, USA
Contact:
Contact mwhitlock
Website

Post by mwhitlock » Fri Oct 03, 2008 11:42 pm

manwe_ wrote:Yesterday I was working on OS X and have to say, fonts are looking great on Mac. Is there any way to config Gentoo to display fonts similiar?
libXft at 12pt (101 dpi): http://img521.imageshack.us/my.php?imag ... 2ptjm2.png

I personally think it looks better than both Windows and Mac.

My FreeType config is:
hinting=false
hintstyle=hintnone
antialias=true
rgba=rgb
lcdfilter=lcddefault
Top
manwe_
l33t
l33t
User avatar
Posts: 650
Joined: Wed Feb 01, 2006 4:10 pm
Location: Universe

Post by manwe_ » Sun Oct 05, 2008 4:38 pm

mwhitlock wrote:libXft at 12pt (101 dpi): http://img521.imageshack.us/my.php?imag ... 2ptjm2.png
I personally think it looks better than both Windows and Mac.
8O I've similiar config, and can't get look like this. The only difference is screen DPI [93x92]. Could DPI be a problem?

Code: Select all

# cat /etc/fonts/local.font
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font" >
  <edit mode="assign" name="rgba" >     <const>rgb</const> </edit>
  <edit mode="assign" name="hinting" >  <bool>false</bool>  </edit>
  <edit mode="assign" name="antialias"> <bool>true</bool> </edit>
  <edit mode="assign" name="autohint" > <bool>false</bool> </edit>
  <edit mode="assign" name="hintstyle"> <const>hintnone</const> </edit>
  <edit mode="assign" name="lcdfilter"> <const>lcddefault</const> </edit>
 </match>
</fontconfig>

# ls -1 /etc/fonts/conf.d/
10-antialias.conf@
10-sub-pixel-rgb.conf@
20-fix-globaladvance.conf@
30-metric-aliases.conf@
30-urw-aliases.conf@
40-nonlatin.conf@
45-latin.conf@
49-sansserif.conf@
50-user.conf@
51-local.conf@
53-monospace-lcd-filter.conf@
57-dejavu.conf@
60-latin.conf@
60-liberation.conf@
65-fonts-persian.conf@
65-nonlatin.conf@
69-unifont.conf@
80-delicious.conf@
90-synthetic.conf@


Another thing is, cairo-1.8.0 from "lcd-filtering" looks worse [thinner] than 1.6.4-r1. Example: http://img353.imageshack.us/img353/6162 ... 193yy5.png It might look like small differece, but with whole screen of code cairo-1.8.0 looks just awful.
Top
bi3l
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Thu Feb 06, 2003 10:37 am
Location: France

Post by bi3l » Sun Oct 05, 2008 4:44 pm

Can you reinstall fontconfig and see if your display is better ?
Top
manwe_
l33t
l33t
User avatar
Posts: 650
Joined: Wed Feb 01, 2006 4:10 pm
Location: Universe

Post by manwe_ » Sun Oct 05, 2008 8:18 pm

bi3l wrote:reinstall fontconfig and see if your display is better ?
It's not. I've upgraded to cairo-1.8.0, reemerged fontconfig-2.6.0-r2 and fonts are still thinner. I've tried even to reemerge freetype-2.3.7 and libXft-2.1.13 but it didn't help either.
Top
bi3l
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Thu Feb 06, 2003 10:37 am
Location: France

Post by bi3l » Sun Oct 05, 2008 8:35 pm

After emerging fontconfig, did you change your /etc/fonts/conf.d ? Because you should at least have 11-lcd-filter-lcddefault.conf (it changes the lcd filter to default instead of legacy). Here is my /etc/fonts/conf.d:

Code: Select all

10-antialias.conf
10-autohint.conf
10-hinting.conf
10-hinting-medium.conf
10-no-sub-pixel.conf
10-sub-pixel-rgb.conf
11-lcd-filter-lcddefault.conf
20-fix-globaladvance.conf
20-unhint-small-vera.conf
25-unhint-nonlatin.conf
30-metric-aliases.conf
30-urw-aliases.conf
40-nonlatin.conf
45-latin.conf
49-sansserif.conf
50-user.conf
51-local.conf
53-monospace-lcd-filter.conf
59-dejavu.conf
60-latin.conf
65-fonts-persian.conf
65-nonlatin.conf
69-unifont.conf
80-delicious.conf
90-synthetic.conf
Top
manwe_
l33t
l33t
User avatar
Posts: 650
Joined: Wed Feb 01, 2006 4:10 pm
Location: Universe

Post by manwe_ » Sun Oct 05, 2008 9:57 pm

I did't but looks like emerge did. Because right now I have:

Code: Select all

10-antialias.conf
10-hinting.conf
10-hinting-medium.conf
10-sub-pixel-rgb.conf
11-lcd-filter-lcddefault.conf
20-fix-globaladvance.conf
20-unhint-small-vera.conf
30-metric-aliases.conf
30-urw-aliases.conf
40-nonlatin.conf
45-latin.conf
49-sansserif.conf
50-user.conf
51-local.conf
53-monospace-lcd-filter.conf
57-dejavu.conf
60-latin.conf
60-liberation.conf
65-fonts-persian.conf
65-nonlatin.conf
69-unifont.conf
80-delicious.conf
90-synthetic.conf
Top
nihues
n00b
n00b
User avatar
Posts: 47
Joined: Tue May 20, 2003 7:24 pm
Location: Balneário Camboriú / SC
Contact:
Contact nihues
Website

Post by nihues » Mon Oct 06, 2008 1:50 am

do you had enabled it?

Code: Select all

eselect fontconfig enable 5
if 5 is the number before 11-lcd-filter-lcddefault.conf

then restart X
Top
acevery
n00b
n00b
Posts: 53
Joined: Thu Nov 03, 2005 4:40 pm
Location: Amoy, China

Post by acevery » Tue Oct 07, 2008 6:29 am

bi3l wrote:I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.

The tarball is here: http://ogmrip.sourceforge.net/misc/gent ... ng.tar.bz2
Great works!
Thanks :D
Top
swimmer
Veteran
Veteran
User avatar
Posts: 1330
Joined: Mon Jul 15, 2002 10:42 am
Location: Netherlands

Post by swimmer » Tue Oct 07, 2008 10:02 am

Time indeed to thank you bi3l - your efforts are very much appreciated!!!

Greetz
swimmer
Top
manwe_
l33t
l33t
User avatar
Posts: 650
Joined: Wed Feb 01, 2006 4:10 pm
Location: Universe

Post by manwe_ » Tue Oct 07, 2008 10:04 am

nihues wrote:do you had enabled it?

Code: Select all

eselect fontconfig enable 5
Like I've said, looks like reemerging fontconfig [when bi3l suggested] enabled 11-lcd-filter-lcddefault.conf by itself, because I don't remember doin' it. Before that my config looked like this http://forums.gentoo.org/viewtopic-p-52 ... ml#5238170 , and now looks like this http://forums.gentoo.org/viewtopic-p-52 ... ml#5238520 . X was also restarted [or to be precise, tested on new session -- :1 ].

-- update:
Config <edit mode="assign" name="lcdfilter"> <const>lcddefault</const> </edit> accepts only lcdnone, lcddefault, lcdlight and lcdlegacy [any other value throws error], but fonts look doesn't change. Somehow Cairo sees this value, but ignores it.
Top
GoofyX
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 90
Joined: Wed Feb 23, 2005 9:35 pm
Location: Greece
Contact:
Contact GoofyX
Website

Post by GoofyX » Tue Oct 07, 2008 2:46 pm

bi3l wrote:After emerging fontconfig, did you change your /etc/fonts/conf.d ? Because you should at least have 11-lcd-filter-lcddefault.conf (it changes the lcd filter to default instead of legacy).
Where do I find that file?
... Morpheus: What is "real"? How do you define "real"? If you 're talking about what you can feel, what you can smell, what you can taste and see, then "real" is simply electrical signals interpreted by your brain...
Top
bi3l
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Thu Feb 06, 2003 10:37 am
Location: France

Post by bi3l » Tue Oct 07, 2008 2:49 pm

In /etc/fonts/conf.d. It should be a link to /etc/fonts/conf.avail/11-lcd-filter-lcddefault.conf.
Top
GoofyX
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 90
Joined: Wed Feb 23, 2005 9:35 pm
Location: Greece
Contact:
Contact GoofyX
Website

Post by GoofyX » Tue Oct 07, 2008 2:53 pm

bi3l wrote:In /etc/fonts/conf.d. It should be a link to /etc/fonts/conf.avail/11-lcd-filter-lcddefault.conf.
OK, but I don't seem to have that file at all:

Code: Select all

/etc/fonts/conf.avail $ ls
10-antialias.conf       20-fix-globaladvance.conf                 53-monospace-lcd-filter.conf
10-autohint.conf        20-unhint-small-dejavu.conf               57-dejavu.conf
10-hinting.conf         20-unhint-small-dejavu-experimental.conf  60-latin.conf
10-hinting-full.conf    20-unhint-small-vera.conf                 61-dejavu-experimental.conf
10-hinting-medium.conf  25-unhint-nonlatin.conf                   65-fonts-persian.conf
10-hinting-slight.conf  30-metric-aliases.conf                    65-khmer.conf
10-no-sub-pixel.conf    30-urw-aliases.conf                       65-nonlatin.conf
10-sub-pixel-bgr.conf   40-nonlatin.conf                          69-unifont.conf
10-sub-pixel-rgb.conf   45-latin.conf                             70-no-bitmaps.conf
10-sub-pixel-vbgr.conf  49-sansserif.conf                         70-yes-bitmaps.conf
10-sub-pixel-vrgb.conf  50-user.conf                              80-delicious.conf
10-unhinted.conf        51-local.conf                             90-synthetic.conf
... Morpheus: What is "real"? How do you define "real"? If you 're talking about what you can feel, what you can smell, what you can taste and see, then "real" is simply electrical signals interpreted by your brain...
Top
Locked

728 posts
  • Page 26 of 30
    • Jump to page:
  • Previous
  • 1
  • …
  • 24
  • 25
  • 26
  • 27
  • 28
  • …
  • 30
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic