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


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Feb 24, 2010 6:14 am    Post subject: Reply with quote

SlashBeast wrote:
Only for me small fonts with 'ubuntu' useflag are very hard to read?

So? Read this thread. You can change how they are rendered. E.g.:
Code:
   <!-- Greyscale for small fonts -->
   <match target="font">
      <test name="pixelsize" compare="less_eq"><double>7</double></test>
      <edit name="rgba"><const>none</const></edit>
   </match>


Here's my ~/.fonts.conf for Infinality's rendering, which is the best rendering - but, use Infinality's own configuration, since he does a better job than me.

For posterity, here's my old ~/.fonts.conf for Ubuntu's rendering.

Edit: Updated my ~/.fonts.conf for Postscript substitutions.
Edit2: Updated for better rendering of small italics.
Edit3: Better rendering of Arial Bold.
Edit4: Many miscellaneous tweaks, for individual fonts, and generalities such as small bold.
Edit5: Stopped replacing Helvetica 11pt with Arial - it's not needed anymore, and such replacing is nasty.
Edit6: Reorganized rules, stopped using "append_replace" (seems to have bad side-effect of also replacing other fonts in the same "family), and further tweaked the hinting rules.
Edit7: Tweaked Luxi Sans bold. Now using <match target="font"> instead of the seemingly-weird <match name="family" target="pattern">
Edit8: Tweaked Arial Black.
Edit9: Made Microsoft fonts hintfull.
Edit10: Tweaked Verdana bold.
Edit11: Tweaked Baskerville font.
Edit12: Am partially replacing Arial with Calibri, because Arial looks so bad.
Edit13: Tweaked Arial Black bold with hintnone.
Edit14: Split the horrible Arial into Calibri (small) and Corbel (small bold). Enabled embeddedbitmap for small sizes.
Edit15: Tweaked smallish Arial Bold to use hintnone instead of hintslight.
Edit17: Disabled "embeddedbitmap" - it's pointless for our purposes of getting nice anti-aliasing.
Edit18: Using CartoGothic Std and PT Sans (both free fonts) to replace Arial small-ish.
Edit19: Tweaked PT Sans bold and not-so-small.
Edit20: Tweaked Aller, Lucida Grande bold, and Luxi Sans bold & small.
Edit21: Minor tweaks to some free fonts: Aller, Droid, Fontin.
Edit22: Switched to Infinality's superior rendering, which makes the Ubuntu-specific tweaking obsolete.


Last edited by PaulBredbury on Sun Sep 12, 2010 2:18 am; edited 25 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Mar 06, 2010 6:57 am    Post subject: Reply with quote

The devnull overlay has removed cairo-respect-fontconfig.patch in cairo-1.8.8.ebuild, which is a mistake.

The patch is needed, so as not to partially ignore the fontconfig files in /etc/fonts/conf.d/ and ~/.fonts.conf

Can you put it back in please? Why was it taken out?

Edit: I've finally reported this patch upstream.


Last edited by PaulBredbury on Sat Mar 27, 2010 6:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Sat Mar 06, 2010 10:46 am    Post subject: Reply with quote

Fixed both in devnull and lcd-filtering. I can't remember why it was taken out but I'm pretty sure there is no good reason.

Edit. BTW, I've switched lcd-filtering to gitorious. See my signature.
_________________
OGMRip - LCD filtering (Wiki)
Back to top
View user's profile Send private message
savalas
n00b
n00b


Joined: 10 Dec 2009
Posts: 40

PostPosted: Sat Mar 20, 2010 11:10 pm    Post subject: Reply with quote

The more I read this thread, the less I understand any of it. I've tried installing from the overlays mentionned in this thread but I couldn't see any difference in KDE. Could anyone be kind enough to take a couple of screenshot both with antialiasing and full hinting, one with the default Gentoo stuff (with the cleartype use flag) and another with any of devnull/lcd-filtering/callisto overlays (as it seems they all share the same patches?) to highlight the difference between the two? That would be really great, thanks!
Back to top
View user's profile Send private message
na641
Apprentice
Apprentice


Joined: 27 Jun 2002
Posts: 169
Location: Sacramento

PostPosted: Thu Mar 25, 2010 12:06 am    Post subject: Reply with quote

bi3l wrote:
Fixed both in devnull and lcd-filtering. I can't remember why it was taken out but I'm pretty sure there is no good reason.

Edit. BTW, I've switched lcd-filtering to gitorious. See my signature.


i tried adding that gitorious layman overlay to my layman list of repos but its not listing. the format seems to be a little different.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Mar 27, 2010 5:01 am    Post subject: Reply with quote

Wow, Gentoo's cairo now contains Ubuntu patches - never thought I'd see the day.
Back to top
View user's profile Send private message
na641
Apprentice
Apprentice


Joined: 27 Jun 2002
Posts: 169
Location: Sacramento

PostPosted: Sat Mar 27, 2010 10:23 pm    Post subject: Reply with quote

PaulBredbury wrote:
Wow, Gentoo's cairo now contains Ubuntu patches - never thought I'd see the day.


i'm a little confused. so does this mean we don't need the cairo overlay anymore? also, is the portage cairo lcdfilter flag the same as the ubuntu flag from the overlay cairo?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Tue Apr 13, 2010 1:48 pm    Post subject: Reply with quote

I've been tweaking my ~/.fonts.conf a lot recently, and here it is - any decent feedback? :)

I'm especially interested in fontconfig ruleset tweaks, if anyone has them, for fonts that I've ignored, or where they greatly disagree with my choice (then we'll get into the complexities of e.g. DPI, screen resolutions, font versions, etc.).

Some useful miscellaneous debugging commands:

fc-match --sort "Symbol"
fc-match -a | uniq | sort | less
fc-match -a | grep -i n019003l
fc-list "Nimbus Sans L"
fc-cat ~/.fonts/ | grep Condensed | cut -c-78
fc-query ~/.fonts/n019003l.pfb
lsof | grep -i firefox | egrep -i 'ttf|pfb'
Back to top
View user's profile Send private message
Ruzbeh
Apprentice
Apprentice


Joined: 23 Jun 2004
Posts: 223

PostPosted: Fri Apr 23, 2010 3:43 pm    Post subject: Reply with quote

PaulBredbury wrote:
I've been tweaking my ~/.fonts.conf a lot recently, and here it is - any decent feedback? :)

I was testing your config earlier, some fonts are still too fat. Example: the font of the name of the blog isn't fat, that's good, but the headline is. I'm running Windows and configuring my fonts in Linux in VirtualBox, so I can compare easily.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Apr 24, 2010 2:22 am    Post subject: Reply with quote

Ruzbeh wrote:
the font of the name of the blog isn't fat, that's good, but the headline is.

The headline ("Good teachers help students...") is Tahoma (bold): tahomabd.ttf

Code:
$ fc-query ~/.fonts/tahomabd.ttf | grep -i weight
   weight: 200(i)(s)


200 is bold. But anyway, you're right. I've added a rule to make Microsoft's fonts hintfull. Try it now :)
Back to top
View user's profile Send private message
Ruzbeh
Apprentice
Apprentice


Joined: 23 Jun 2004
Posts: 223

PostPosted: Sun Apr 25, 2010 5:56 pm    Post subject: Reply with quote

My bad. I later found out it was tahoma and I didn't have that installed.

I've been testing a lot of different stuff lately, using your conf as a guide. Not that I mind, but issuing the kill command over and over again (kill, kill, kill, kill, kill, kill...) makes me a bit uneasy.

I like your conf, and it pretty much renders stuff correctly as far as I can tell, but it does make everything look too thin. Perhaps preferential, but I do like my fonts to look slightly fuzzy. (Rather too fuzzy than too thin.) I'm using my own fonts.conf right now, using anti-alias, rgb, hintslight, and hintnone for Arial specifically. Testing this stuff out isn't the easiest thing to do. Is there a website that displays fonts that are used very often in their oft-used sizes? That would make comparing fonts between Windows and Linux so much easier.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Apr 25, 2010 10:03 pm    Post subject: Reply with quote

Too fat or too thin, based on whether we use hintmedium or hintfull :cry: Maybe we need hintabitmorebutnottoomuch :P

Well, state specific examples, so I can look at tweaking them. Within the confines of what fontconfig provides, obviously.

Arial is the font that I hate the most - it won't look great when small, no matter what options are chosen. Most of my font-specific tweaking is for Arial small/bold, at e.g. digg. I think I might even replace it (with Calibra? Liberation Sans?).

It will be easy to create a test HTML page (example), and I'll do this soon. Also, typetester may be useful.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Apr 26, 2010 1:37 pm    Post subject: Reply with quote

Here's a Python program to generate HTML of various fonts, and its outputted HTML page - save it, then open it in e.g. firefox.

Of course, your web browser relies on the fonts you have installed (and its settings, e.g. minimum font size) - the fc-query and fc-match commands will help to explain what you see.
Back to top
View user's profile Send private message
aoeuaoue
n00b
n00b


Joined: 26 Feb 2010
Posts: 31

PostPosted: Fri Apr 30, 2010 3:09 am    Post subject: Xorg driver Reply with quote

A lot of this also depends on the Xorg driver being used. I've tested nouveau and nvidia, the former has absolutely no anti-aliasing, the latter does have some form of anti-aliasing in nvidia-settings. Though I am not sure how and to what decides applying it. I like microfonts (really tiny) and the Nouveau driver made them blurry and had some sort of glitch where in terminals bold r's would stick out like an overgrown wart full of hair.

Using 'nvidia-settings' I have anti-aliasing at max and now changed to 'Use Application Settings', it was set to 'Override Applications Settings'.

so ppl, please bear this in mind when making accusations about fonts!! radeonhd, fglrx, nvidia, nouveau, vesa, your screen resolution etc, there isn't a silver bullet to fix ALL fonts in ALL systems.

Also another thing I've noticed is that some settings only take effect after re-starting X. For instance testing terminal fonts xrdb -load .Xdefaults just changes the font but not the hinting and anti-aliasing settings that are either in .Xdefaults or .fonts.conf file.

Having said that, I am using for my terminal Inconsolata font and firefox uses the following:
Code:
lsof | grep -i firefox | egrep -i 'ttf|pfb'                                                                                                     
/usr/share/fonts/umeplus-fonts/umeplus-p-gothic.ttf                           
/usr/share/fonts/dejavu/DejaVuSerif.ttf                                       
/usr/share/fonts/dejavu/DejaVuSans.ttf                                         
/usr/share/fonts/corefonts/verdanaz.ttf                                       
/usr/share/fonts/corefonts/verdanai.ttf                                       
/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf                               
/usr/share/fonts/corefonts/trebucbd.ttf                                       
/usr/share/fonts/corefonts/verdana.ttf                                         
/usr/share/fonts/corefonts/verdanab.ttf


So far letting default stuff on without changes everything looks better than all those custom .fonts.conf that've tried.

cheers!!
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Apr 30, 2010 6:27 am    Post subject: Re: Xorg driver Reply with quote

aoeuaoue wrote:
nvidia-settings

Hang on a minute, aren't you talking complete nonsense?

nvidia-settings is for opengl anti-aliasing - this thread is talking about 2D apps like Abiword, Openoffice, geany, etc. What apps are you using, in which nvidia-settings' anti-aliasing affects text rendering?

Quote:
Also another thing I've noticed is that some settings only take effect after re-starting X

Wrong. You just need to restart the app (maybe you had multiple xterms open, and need to close every instance?). This is easily proved in e.g. qtconfig:

Code:
(Set e.g. Xft.dpi: 120 in ~/.Xresources)
xrdb -merge ~/.Xresources
qtconfig
(See fonts change size)

Quote:
without changes everything looks better than all those custom

That is most certainly absolute nonsense. Try the sample font HTML I provided above, and experiment with your settings, and you'll see that some fonts need e.g. hintslight/hintfull to prevent looking ugly or too bold, whereas other fonts may need e.g. autohint (a good example is Luxi Sans at Market Ticker, which looks ridiculously mis-shapen with hintmedium instead of hintslight). Look at my ~/.fonts.conf above, and you'll see the tweaks that I've found that can be used to improve the look of the fonts.

In other news, I've updated my ~/.fonts.conf above to replace Arial *sometimes*, because it looks so poor when small/bold and cannot be fixed, and it's so ubiquitous that I cannot tolerate its ugliness, when other fonts manage to look decent at the same size :)
Back to top
View user's profile Send private message
aoeuaoue
n00b
n00b


Joined: 26 Feb 2010
Posts: 31

PostPosted: Sat May 01, 2010 10:50 pm    Post subject: 3D apps Reply with quote

PaulBredbury wrote:

nvidia-settings is for opengl anti-aliasing - this thread is talking about 2D apps like Abiword, Openoffice, geany, etc. What apps are you using, in which nvidia-settings' anti-aliasing affects text rendering?


oops, you are right I got confused then. I assumed anti-aliasing always referred to fonts LAWL!! Didn't think linux actually HAD 3D games needing anti-aliasing and associated games and anti-aliasing with m$$ games.

Also that didn't change a thing.

Code:
(Set e.g. Xft.dpi: 120 in ~/.Xresources)
xrdb -merge ~/.Xresources
qtconfig
(See fonts change size)


I have two 23" with a res 2048x1152 apiece.

Code:
[    80.986] (II) NVIDIA(0): Computing DPI using physical size from Samsung SyncMaster
[    80.986] (II) NVIDIA(0):     (DFP-0)'s EDID and first mode to be programmed on Samsung
[    80.986] (II) NVIDIA(0):     SyncMaster (DFP-0):
[    80.986] (II) NVIDIA(0):   width  : 2048 pixels  510  mm (DPI: 101)
[    80.986] (II) NVIDIA(0):   height : 1152 pixels  290  mm (DPI: 100)


From my /var/log/Xorg.0.log. Is this the same dpi as Xft.dpi: in .Xresources/.Xdefaults? I am confused about this. Concerning fonts there are a few places where to set them in .Xresources/.Xdefaults:

Code:
xft.dpi:   101
xft.antialias: true
!Xft.lcdfilter: lcdfilterlegacy
Xft.hintstyle: hintfull


And then it's possible to pass anti-alias and hinting options individually at:
Code:
URxvt*font:     xft:Inconsolata:autohint=true:antialias=true:size=6


I wonder what's the relationship between .fonts.conf settings, Xft* in .Xdefaults and the fonts sections.

cheers
Back to top
View user's profile Send private message
mwhitlock
Tux's lil' helper
Tux's lil' helper


Joined: 07 Aug 2006
Posts: 75
Location: Weare, NH

PostPosted: Mon May 10, 2010 5:50 am    Post subject: Reply with quote

na641 wrote:
i tried adding that gitorious layman overlay to my layman list of repos but its not listing. the format seems to be a little different.

Layman uses a different XML schema now. Here's what I have in my lcd-filtering.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE repositories SYSTEM "/dtd/repositories.dtd">
<repositories xmlns="" version="1.0">
   <repo quality="experimental" status="unofficial">
      <name>lcd-filtering</name>
      <description>LCD filtering</description>
      <homepage>http://forums.gentoo.org/viewforum-f-12.html</homepage>
      <owner>
         <email>billl@users.sourceforge.net</email>
      </owner>
      <source type="git">git://gitorious.org/lcd-filtering/lcd-filtering.git</source>
   </repo>
</repositories>
Back to top
View user's profile Send private message
na641
Apprentice
Apprentice


Joined: 27 Jun 2002
Posts: 169
Location: Sacramento

PostPosted: Tue May 18, 2010 12:08 am    Post subject: Reply with quote

mwhitlock wrote:
na641 wrote:
i tried adding that gitorious layman overlay to my layman list of repos but its not listing. the format seems to be a little different.

Layman uses a different XML schema now. Here's what I have in my lcd-filtering.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE repositories SYSTEM "/dtd/repositories.dtd">
<repositories xmlns="" version="1.0">
   <repo quality="experimental" status="unofficial">
      <name>lcd-filtering</name>
      <description>LCD filtering</description>
      <homepage>http://forums.gentoo.org/viewforum-f-12.html</homepage>
      <owner>
         <email>billl@users.sourceforge.net</email>
      </owner>
      <source type="git">git://gitorious.org/lcd-filtering/lcd-filtering.git</source>
   </repo>
</repositories>


thanks a lot buddy, works great
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat May 29, 2010 12:31 pm    Post subject: Reply with quote

So, who wants to add additional patches to cairo etc., to add support for the sub-LCD rendering method? It looks interesting 8)
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Jun 10, 2010 3:47 pm    Post subject: Reply with quote

There's some nice free fonts available.

The best from that list are: PT Sans, CartoGothic Std, Sansation, Aller.

PT Sans and CartoGothic Std are so good, that I'm currently using a combination of them to replace Arial small-ish.

Edit: freetype 2.4.0 misses out most of the characters of CartoGothic Std - so it's to be avoided currently - weird :?
Edit2: freetype 2.4.1 fixes the missing characters in CartoGothic Std :)


Last edited by PaulBredbury on Sun Jul 18, 2010 6:13 am; edited 2 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Tue Jul 13, 2010 7:46 pm    Post subject: Reply with quote

I noticed that NiLuJe prefers to patch default_filter, so I tried it myself. Here's an example to show the difference with the Gibson filter. It's "warmer" (some would say blurrier), and to my eyes it's an improvement :D

Easy alternative to the patch:
Code:
sed -i -e "s:0x10, 0x40, 0x70, 0x40, 0x10:0x1c, 0x38, 0x55, 0x38, 0x1c:" src/base/ftlcdfil.c

Just recompile freetype2, then restart firefox to see the change.

Edit: More combinations on Infinality's forum.

This looks like a nice way to fine-tune "lcddefault". It would be interesting to see if people prefer other variations.

In other news, freetype 2.4.0 is out - the 2 Ubuntu patches "freetype-bytecode-interpreter" and "enable-full-bytecode-interpreter" can be dropped as no longer needed.


Last edited by PaulBredbury on Thu Oct 28, 2010 4:56 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Jul 14, 2010 11:30 am    Post subject: Reply with quote

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.


Last edited by PaulBredbury on Sat Sep 04, 2010 10:42 am; edited 8 times in total
Back to top
View user's profile Send private message
sipingal
n00b
n00b


Joined: 12 May 2008
Posts: 62
Location: China

PostPosted: Fri Jul 16, 2010 3:23 am    Post subject: Reply with quote

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

Here's an all-in-one patch I've made for freetype 2.4.0


That's great. Why not push to upstream? Seems it solve the memu delay problem as well.

Gilles said: I bit worried about speed in activities menu as well, it's damn slow on my Core2@2.2Ghz which I can't understand.
Details see here: http://blogs.gentoo.org/index.php/2009/10/25/gnome-2-28-1-is-there?blog=86
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 5729
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sat Jul 17, 2010 10:41 am    Post subject: Reply with quote

PaulBredbury wrote:
There's some nice free fonts available.

The best from that list are: PT Sans, CartoGothic Std, Sansation, Aller.

PT Sans and CartoGothic Std are so good, that I'm currently using a combination of them to replace Arial small-ish.


thanks for those fonts ! :)
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.3.0-r2
2.6.37.2_plus_v1: BFS, CFS,THP,compaction, zcache or TOI
Hardcore Linux user since 2004 :D
Back to top
View user's profile Send private message
KejPi
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 122
Location: Prague, Czech republic

PostPosted: Sun Jul 18, 2010 7:29 am    Post subject: Reply with quote

Hi, is there any plan to release freetype 2.4.0 with patches in devnull or should I switch to standard Gentoo version?
Thanks!
_________________
hidentity.org
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 ... 10, 11, 12 ... 27, 28, 29  Next
Page 11 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