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


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

PostPosted: Sun Sep 19, 2010 9:28 am    Post subject: Reply with quote

How to get the Windows and Apple fonts on Linux (apologies for the noob question - but I couldn't find Lucida Grande anywhere on the net).

Also, what are the fonts I need to have installed to use the .fonts.conf provided by Infinality.
_________________
Who shall guard the guards?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Sep 19, 2010 9:59 am    Post subject: Reply with quote

rahulthewall wrote:
what are the fonts I need to have installed to use the .fonts.conf provided by Infinality.

None in particular. Fontconfig can/will only use the fonts that are available on the system. Example, using my custom ~/.fonts.conf
Code:
$ fc-match serif
times.ttf: "Times New Roman" "Normal"  # Using a custom fontconfig rule

$ fc-match sans
DejaVuSans.ttf: "DejaVu Sans" "Book"  # Standard stuff

$ fc-match "this font is missing"  # No such font.
DejaVuSans.ttf: "DejaVu Sans" "Book"  # Fontconfig falls back to good ol' DejaVu
Back to top
View user's profile Send private message
wantilles
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2003
Posts: 136
Location: Athens - Greece

PostPosted: Sun Sep 19, 2010 1:07 pm    Post subject: Reply with quote

I studied the cairo-1.10-r3 ebuild in the lcd-filtering overlay, and I have a question to ask.

How do you really implement cleartype functionality - if you do implement it - since there is no epatch clause to apply the relevant patch (cairo-1.2.4-lcd-cleartype-like.diff) in the ebuild, under any condition (USE flag)?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Sep 19, 2010 1:41 pm    Post subject: Reply with quote

wantilles wrote:
implement cleartype functionality

Look in the freetype2 ebuild.

Infinality, to satisfy everyone, can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why :?
Back to top
View user's profile Send private message
rahulthewall
Veteran
Veteran


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

PostPosted: Sun Sep 19, 2010 2:26 pm    Post subject: Reply with quote

PaulBredbury wrote:
rahulthewall wrote:
what are the fonts I need to have installed to use the .fonts.conf provided by Infinality.

None in particular. Fontconfig can/will only use the fonts that are available on the system. Example, using my custom ~/.fonts.conf
Code:
$ fc-match serif
times.ttf: "Times New Roman" "Normal"  # Using a custom fontconfig rule

$ fc-match sans
DejaVuSans.ttf: "DejaVu Sans" "Book"  # Standard stuff

$ fc-match "this font is missing"  # No such font.
DejaVuSans.ttf: "DejaVu Sans" "Book"  # Fontconfig falls back to good ol' DejaVu


Thanks for this. Then I don't need to bother about installing all the extra fonts. Also could you tell me, how to change these defaults - I would like to make Droid Sans (Serif) the default.
_________________
Who shall guard the guards?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Sep 19, 2010 2:39 pm    Post subject: Reply with quote

rahulthewall wrote:
how to change these defaults

Read this thread, then you'll know. Just look at some sample fontconfig files, e.g. mine.
Back to top
View user's profile Send private message
rahulthewall
Veteran
Veteran


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

PostPosted: Sun Sep 19, 2010 2:55 pm    Post subject: Reply with quote

PaulBredbury wrote:
rahulthewall wrote:
how to change these defaults

Read this thread, then you'll know. Just look at some sample fontconfig files, e.g. mine.


Cool, that is all I wanted to know (whether the changes are to made in .fonts.conf). Will start editing. Thanks again.
_________________
Who shall guard the guards?
Back to top
View user's profile Send private message
wantilles
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2003
Posts: 136
Location: Athens - Greece

PostPosted: Sun Sep 19, 2010 7:42 pm    Post subject: Reply with quote

PaulBredbury wrote:
wantilles wrote:
implement cleartype functionality

Look in the freetype2 ebuild.

Infinality, to satisfy everyone, can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why :?


Indeed, I had been looking in packages-debian-org, and in here, for a way to implement the exact patch you are referring to, on top of the new cairo 1.10.
Back to top
View user's profile Send private message
wantilles
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2003
Posts: 136
Location: Athens - Greece

PostPosted: Sun Sep 19, 2010 7:48 pm    Post subject: Reply with quote

PaulBredbury wrote:
wantilles wrote:
implement cleartype functionality

Look in the freetype2 ebuild.


I just did. I admit that my ebuild-ish might be a bit rusty, but there is nothing specific happening if the USE flag cleartype is used - and the funny part is that it's used by default.

And the only patch that is applied regardless of USE flags specified, is the freetype2-2.3.2-enable-valid.patch.
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: Mon Sep 20, 2010 7:51 pm    Post subject: Reply with quote

PaulBredbury wrote:
can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why :?


Well, maybe I did something wrong by using lcdfilter Lucida Grande doesn't look good also DejaVu Sans doesn't look good. On the other hand Droid Sans looks much better nevetheless I'm still not sure wheter it looks better than cleartype or not. It seems to me quite much blurry.
_________________
hidentity.org
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Tue Sep 21, 2010 12:07 am    Post subject: Reply with quote

wantilles, the point is that the lcdfilter code *should* be in freetype2 (rather than cairo), under the control of the fontconfig rules.

Then you will be able to render e.g. Lucida Grande with lcdfilter, DejaVu Sans with cleartype, and Droid Sans with Infinality's rendering. Or whatever combination you want, by editing the fontconfig rules. Also, the apps which don't even use cairo (but do use freetype2) will not be excluded.
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 21, 2010 2:18 am    Post subject: Reply with quote

PaulBredbury wrote:
wantilles wrote:
implement cleartype functionality

Look in the freetype2 ebuild.

Infinality, to satisfy everyone, can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why :?


My goal is to make every existing option, and every new one configurable. In the particular case you are referring to: "infinality" vs. "cleartype" (which BTW is a very poor choice of package name that increases confusion), there is no way to enable one or the other through fontconfig currently, unless fontconfig is modified. I've been down that road already ;) . Currently this can only be done at compile time in freetype.

But this brings up a much larger issue, which is that the existing freetype / fontconfig interaction is a hodgepodge of band-aids on band-aids that is confusing, difficult to use, and hard to extend from a coding point of view due to lots of interdependencies and assumptions. For instance, "slight hinting" always implies autohint within freetype. Instead of something like this in fontconfig:

Code:
   <match target="font" >
      <edit mode="assign" name="hinting" >
         <bool>true</bool>
      </edit>
      <edit mode="assign" name="autohint" >
         <bool>false</bool>
      </edit>
      <edit mode="assign" name="antialias" >
         <bool>true</bool>
      </edit>
      <edit mode="assign" name="hintstyle" >
         <const>hintfull</const>
      </edit>
      <edit name="lcdfilter" mode="assign">
         <const>lcddefault</const>
      </edit>
   </match>


... I think we need something like ....


Code:
   <match target="font" >
      
      <!-- The two main options -->
      <edit mode="assign" name="hintstyle" >
         <const> [ none | autohint-light | autohint-full | TT-native | TT-subpixel | ....... ] </const>
      </edit>
      <edit mode="assign" name="rendering" >
         <const> [ monochrome | antialiased | subpixel | ......]  </const>
      </edit>

      <!-- Options for any of the above options -->
      <edit name="subpixel-filter" mode="assign">  <!-- applies if subpixel rendering is enabled -->
         <const>[ lcddefault | lcdlight | lcdnone | ........ ]</const>
      </edit>
      <edit name="subpixel-geometry" mode="assign">  <!-- applies if subpixel rendering is enabled -->
         <const>[ unknown | rgb | bgr | vrgb | vbgr | none ........ ]</const>
      </edit>
      .....
      .....

   </match>


This creates a proper separation between all the layers involved in bringing the font to the screen, allows for any combination of options that one desires, and is easily extensible. Everyone's needs can be met this way. The only problem is that the existing hodgepodge is pretty ingrained.
:x
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 21, 2010 2:30 am    Post subject: Afterthought.... Reply with quote

Just to translate the above into Gentoo-ese,

What you guys call cleartype is:
native-TT hinting, subpixel rendering

What you guys call infinality is:
subpixel-TT hinting, subpixel rendering

What Windows XP/Vista/7 Cleartype is:
subpixel-TT hinting, subpixel rendering

What Apple seems to do:
no hinting, subpixel rendering

The settings that look like Win98:
native-TT hinting, monochrome rendering

What Microsoft calls "smooth edges of screen fonts" in Win98:
native-TT hinting, antialiased rendering on bold

What mechmg93 on the archlinux forum likes:
native-TT hinting, antialiased rendering on everything


Everybody likes something different I guess. Of course.... they are wrong, but that is their right. :D
Back to top
View user's profile Send private message
^marcs
Apprentice
Apprentice


Joined: 09 Mar 2005
Posts: 169

PostPosted: Tue Sep 21, 2010 8:08 pm    Post subject: Reply with quote

wow, those patches are rly nice piece of work! keep it going please :)

in my configuration everything is looking good, but there is one thing that's bugging me, when i pick "subpixel rendering" in gnome fonts configuration, my terminal text scrolling it quite slow, especialy when maximized - it might be urxvt performance issue, no idea, when ill pick up "best shapes" urxvt works like a charm.




also fonts in java applications (netbeans, running on sun-jre) became totaly messed up, stretched in horizontal like hell, but thats offtopic.
Back to top
View user's profile Send private message
Infinality
n00b
n00b


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

PostPosted: Wed Sep 22, 2010 4:06 am    Post subject: Next update.... Reply with quote

... it will hopefully be coming soon. I'm thinking this one is going to "WOW" people. Legacy MS fonts just look fantastic, and I've got the code looking much nicer too. I know I said maybe last weekend, but maybe this weekend. ;)
Back to top
View user's profile Send private message
rahulthewall
Veteran
Veteran


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

PostPosted: Wed Sep 22, 2010 3:01 pm    Post subject: Reply with quote

I am using Droid Sans as my default fonts. I currently do not like how my bold fonts are rendered.

http://i.imgur.com/9MLcO.png
_________________
Who shall guard the guards?
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 23, 2010 9:02 am    Post subject: Reply with quote

Also, Inconsolata seems to misbehave in the terminal (konsole).

http://imgur.com/kx468
_________________
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: Thu Sep 23, 2010 12:23 pm    Post subject: Reply with quote

Yes, like I mention on my page at infinality.net, this patch is by no means perfect. Part of the problem you are running into actually has nothing to do with my patch, but the fact that those fonts have missing or poor TT hinting information in them- so, freetype is simply doing what the font tells it to do. Does the regular BCI-enabled freetype do any better on these fonts than the patched version? I don't know for sure but I'm guessing not.

Until fonts like this are somehow handled in my patch "by default", your best bet is to do what has always been available to do: Use fontfontconfig settings to adjust your preferred hint settings on a font by font basis. I'm guessing autohint "slight hinting" would be appropriate for these fonts.
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 23, 2010 2:15 pm    Post subject: Reply with quote

Infinality wrote:
Yes, like I mention on my page at infinality.net, this patch is by no means perfect. Part of the problem you are running into actually has nothing to do with my patch, but the fact that those fonts have missing or poor TT hinting information in them- so, freetype is simply doing what the font tells it to do. Does the regular BCI-enabled freetype do any better on these fonts than the patched version? I don't know for sure but I'm guessing not.

Until fonts like this are somehow handled in my patch "by default", your best bet is to do what has always been available to do: Use fontfontconfig settings to adjust your preferred hint settings on a font by font basis. I'm guessing autohint "slight hinting" would be appropriate for these fonts.


But Inconsolata is using slight hinting, or somehow the settings from .fonts.conf are not respected.

Code:

 <!-- Make these fonts use autohint slight hinting -->
 <match target="font">
  <test name="family" qual="any">
   ...
   <string>Inconsolata</string>
   ...
  </test>
  <edit mode="assign" name="autohint">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>


I am using the .fonts.conf that you provide.
_________________
Who shall guard the guards?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Sep 23, 2010 2:30 pm    Post subject: Reply with quote

rahulthewall wrote:
the settings from .fonts.conf are not respected

Do a tiny bit of actual work yourself, and you'll answer your own question.

Read this huge thread, which is full of essential information, and notice the patch I keep mentioning - cairo-respect-fontconfig.patch

Play with the fontconfig rules, and you can easily see for yourself whether the rules are being obeyed, e.g. set:

Code:
    <edit name="antialias" mode="assign"><bool>false</bool></edit>

And the font will look horrendously bitmapped, which is a dead giveaway.
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Thu Sep 23, 2010 2:36 pm    Post subject: Reply with quote

For the record, cairo-respect-fontconfig.patch is applied by the ebuilds of the LCD filtering overlay.
_________________
OGMRip - LCD filtering (Wiki)
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 23, 2010 8:28 pm    Post subject: Reply with quote

PaulBredbury wrote:
rahulthewall wrote:
the settings from .fonts.conf are not respected

Do a tiny bit of actual work yourself, and you'll answer your own question.

Read this huge thread, which is full of essential information, and notice the patch I keep mentioning - cairo-respect-fontconfig.patch

Play with the fontconfig rules, and you can easily see for yourself whether the rules are being obeyed, e.g. set:

Code:
    <edit name="antialias" mode="assign"><bool>false</bool></edit>

And the font will look horrendously bitmapped, which is a dead giveaway.


From what I understood, the cairo-respect-fontconfig.patch is supposed to respect the settings which are set via eselect fontconfig. And I knew the lcd-filtering overlay contained that patch and thus forgot to mention that I am in fact using that patch. I turned off antialiasing in .fonts.conf as you suggested and there was no change in how fonts are rendered which now confirms my suspicion that the settings in .fonts.conf are being ignored.

I think, (and I might be totally mistaken here), that the settings in fontconfing (the ones set via eselect fontconfig) are overriding the settings specified in .fonts.conf. I am now going to make some tests to verify this.
_________________
Who shall guard the guards?
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 Sep 23, 2010 8:55 pm    Post subject: Reply with quote

PaulBredbury wrote:
Read this huge thread, which is full of essential information

I think it would help if we create a wiki page for this issue or a seperated howto thread. This thread is huge and with discussions. A wiki/howto that gathers the information and summarizes it would help a lot i guess.
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Thu Sep 23, 2010 9:07 pm    Post subject: Reply with quote

I've just created a wiki on the gitorious page of LCD filtering. It's very limited at the moment, but feel free to improve it (everyone has write access).
_________________
OGMRip - LCD filtering (Wiki)
Back to top
View user's profile Send private message
pross
Apprentice
Apprentice


Joined: 30 Jul 2003
Posts: 156
Location: Ireland

PostPosted: Thu Sep 23, 2010 9:12 pm    Post subject: Reply with quote

bi3l wrote:
I've just created a wiki on the gitorious page of LCD filtering. It's very limited at the moment, but feel free to improve it (everyone has write access).

Nice idea :)
_________________
My Overlay [pross] | bfs-sources
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 ... 14, 15, 16 ... 27, 28, 29  Next
Page 15 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