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, 4, 5, 6 ... 27, 28, 29  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Wed Feb 25, 2009 1:45 pm    Post subject: Reply with quote

Update your overlay and it will go away.
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Wed Feb 25, 2009 1:47 pm    Post subject: Reply with quote

I updated it right before I posted the error message ;-)

But anyway - it's easy to fix. I just wanted to inform the overlay maintainers ...

Greetz
swimmer
Back to top
View user's profile Send private message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Wed Feb 25, 2009 1:58 pm    Post subject: Reply with quote

Is it about lcd-filtering overlay? In devnull overlay there is no such file and line in manifest, so evertithing is ok
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Wed Feb 25, 2009 2:35 pm    Post subject: Reply with quote

I have now fully switched to the newest version of the devnull overlay:
Code:

freddie@iodine ~ $ 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]  20-fix-globaladvance.conf *
  [14]  20-unhint-small-vera.conf *
  [15]  25-unhint-nonlatin.conf
  [16]  30-metric-aliases.conf *
  [17]  30-urw-aliases.conf *
  [18]  40-nonlatin.conf *
  [19]  45-latin.conf *
  [20]  49-sansserif.conf *
  [21]  50-user.conf
  [22]  51-local.conf
  [23]  60-latin.conf *
  [24]  65-fonts-persian.conf *
  [25]  65-khmer.conf
  [26]  65-nonlatin.conf *
  [27]  69-unifont.conf *
  [28]  70-no-bitmaps.conf *
  [29]  70-yes-bitmaps.conf
  [30]  80-delicious.conf *
  [31]  90-synthetic.conf *

and
Code:

iodine freddie # emerge -av fontconfig libXft freetype cairo

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/freetype-2.3.8  USE="X cleartype -bindist -debug -doc -fontforge -utils" 0 kB [1]
[ebuild   R   ] media-libs/fontconfig-2.6.0-r2  USE="cleartype -doc" 0 kB [1]
[ebuild   R   ] x11-libs/libXft-2.1.13  USE="cleartype -debug" 0 kB [1]
[ebuild   R   ] x11-libs/cairo-1.8.6-r1  USE="X cleartype glitz opengl svg xcb -debug -directfb -doc" 0 kB [0]

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /usr/local/portage/layman/devnull


Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?

Regards, Freddie.
Back to top
View user's profile Send private message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Wed Feb 25, 2009 2:47 pm    Post subject: Reply with quote

It could be problems in some user-specific configs. Try creating new user with empty home directory and see if font rendering will improve
Back to top
View user's profile Send private message
paladin-zero
Guru
Guru


Joined: 19 May 2004
Posts: 322

PostPosted: Wed Feb 25, 2009 4:36 pm    Post subject: Reply with quote

Evilguru wrote:
I have now fully switched to the newest version of the devnull overlay:

[...]

Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?


I responded to you on page 4 of this thread with a suggestion. Did you try it?
Back to top
View user's profile Send private message
paladin-zero
Guru
Guru


Joined: 19 May 2004
Posts: 322

PostPosted: Wed Feb 25, 2009 4:40 pm    Post subject: Reply with quote

ssmaxss wrote:
Try creating new user with empty home directory and see if font rendering will improve


I dont think this will help. For some reason, Qt does not use subpixel rendering when the font family in qtconfig is set to the default, generic "sans serif". Changing to DejaVu Sans or Bitstream Vera Sans should solve the problem.
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Wed Feb 25, 2009 4:41 pm    Post subject: Reply with quote

Moreover, 50-user.conf is not enabled.
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Wed Feb 25, 2009 5:36 pm    Post subject: Reply with quote

paladin-zero wrote:
Evilguru wrote:
I have now fully switched to the newest version of the devnull overlay:

[...]

Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?


I responded to you on page 4 of this thread with a suggestion. Did you try it?

I did. I set it to Bitstream Vera Sans. Saved it, quit Qt config. However, when I restart Qt config it went back to "Sans Serif". This happened irrespective of what font I selected as the default font. This I believe is because I use the GTK+ style. However, it is inconsequential, as if I change my theme to Plastique and change the font (which does 'stick') there is still no subpixel rendering.

Therefore the choice of font does not seem to have an effect, neither does the chosen style. Furthermore enabling 50-user.conf has no visible effect.

Edit: A screenshot: http://freddie.witherden.org/drop/fonts.png Notice the the GNOME terminal is well rendered, but qtconfig is not.

Regards, Freddie.
Back to top
View user's profile Send private message
paladin-zero
Guru
Guru


Joined: 19 May 2004
Posts: 322

PostPosted: Wed Feb 25, 2009 5:50 pm    Post subject: Reply with quote

Evilguru wrote:
paladin-zero wrote:
Evilguru wrote:
I have now fully switched to the newest version of the devnull overlay:

[...]

Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?


I responded to you on page 4 of this thread with a suggestion. Did you try it?

I did. I set it to Bitstream Vera Sans. Saved it, quit Qt config. However, when I restart Qt config it went back to "Sans Serif".


Do you have a default font set in .Xresources or something like that? Thats a wild guess. I have no idea why qtconfig would not respect your changes (unless you didnt save them but thought you did).
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Wed Feb 25, 2009 5:53 pm    Post subject: Reply with quote

paladin-zero wrote:
Evilguru wrote:
paladin-zero wrote:
Evilguru wrote:
I have now fully switched to the newest version of the devnull overlay:

[...]

Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?


I responded to you on page 4 of this thread with a suggestion. Did you try it?

I did. I set it to Bitstream Vera Sans. Saved it, quit Qt config. However, when I restart Qt config it went back to "Sans Serif".


Do you have a default font set in .Xresources or something like that? Thats a wild guess. I have no idea why qtconfig would not respect your changes (unless you didnt save them but thought you did).

I suspect this is because I use the GTK+ style (so uses some freedesktop voodoo to get the GNOME font, which is probably sans serif -- I'll check). However, since it still refuses to use subpixel rendering when another style is used (where setting/changing the font does work as expected) I suspect there is another issue at play here.

Edit: Yes the Qt font is linked to that chosen in GNOME when using the GTK+ style. As expected, changing it in GNOME to bitstream vera sans has no effect. (Although qtconfig does show that instead of sans for the font.)

Regards, Freddie.
Back to top
View user's profile Send private message
PinguinoLoco
n00b
n00b


Joined: 04 Feb 2009
Posts: 21

PostPosted: Wed Feb 25, 2009 6:28 pm    Post subject: Reply with quote

Hi again. Can anyone else comment if okular is doing subpixel hinting for him/her? It does grayscale hinting here and it gives me a headache. I installed Acrobat Reader and it renders fonts with subpixel hinting, but I'd preferto use okular if possible (I'm running 64 bits).

I tried evince too and can't get subpixel hinting either. All other apps I'm running (except wine) render good fonts.
Back to top
View user's profile Send private message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Wed Feb 25, 2009 6:32 pm    Post subject: Reply with quote

For me okular from kde 4.2.0 from portage looks as good as all other apps.
Back to top
View user's profile Send private message
PinguinoLoco
n00b
n00b


Joined: 04 Feb 2009
Posts: 21

PostPosted: Wed Feb 25, 2009 7:29 pm    Post subject: Reply with quote

Thanks for answering ssmaxss. It must be a configuration problem on my side then. Just to clarify, I get subpixel hinting in the interface but not in the render of the PDF.
Back to top
View user's profile Send private message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Wed Feb 25, 2009 7:50 pm    Post subject: Reply with quote

These are my screenshots of text pdf at different sizes. Looks quite odd on smaller though:
http://img17.imageshack.us/img17/5570/74196637jw3.png
http://img10.imageshack.us/img10/6959/82537988gu8.png
Back to top
View user's profile Send private message
PinguinoLoco
n00b
n00b


Joined: 04 Feb 2009
Posts: 21

PostPosted: Wed Feb 25, 2009 8:21 pm    Post subject: Reply with quote

ssmaxss, the PDF content of those screenshots doesn't have subpixel hinting. Same problem as mine. If you open the same PDF with Acrobat Reader (with the antialiasing option enabled in its preferences) you'ĺl see the difference.

Maybe it's intentional. Subpixel hinting alters the shape of the letters a bit, so maybe they don't use it to have WYSIWYG, but it's very hard to read for me.
Back to top
View user's profile Send private message
mwhitlock
Tux's lil' helper
Tux's lil' helper


Joined: 07 Aug 2006
Posts: 87
Location: New Hampshire, USA

PostPosted: Wed Feb 25, 2009 8:26 pm    Post subject: Reply with quote

Rendering a PDF is more similar to rendering an SVG than rendering text. The PDF contains vector drawing instructions (it's essentially a PostScript file), so the only way you'd get subpixel rendering would be if Okular's vector rasterizer supported it. In other words, this has nothing to do with FreeType or libXft; it's not even really font rendering, but more like shape painting.
Back to top
View user's profile Send private message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Wed Feb 25, 2009 8:40 pm    Post subject: Reply with quote

It looks good enough for me anyway :)
PinguinoLoco, sorry for wrong information.
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Thu Feb 26, 2009 12:13 am    Post subject: Reply with quote

It is a known 'bug' in Poppler (the rendering library used by evince and Okular). More information can be found here: https://bugs.freedesktop.org/show_bug.cgi?id=3307

When producing a PDF file the norm is to embed a subset of the font in question (as opposed to converting it to an outline/path). The reason for this is that the font often contains useful hinting information which can be used to produce a sharper rendering than would otherwise be possible. A side effect of this is that it is usually completely possible to get subpixel text rendering for PDF file. (Acrobat and Preview.app both do this.)

Sadly no major vector graphics libraries (Cairo and Qt) provide support for subpixel rendered primitives. However, there has been some discussion about adding them to Cairo (they are in the API for anti-aliasing). Might happen in the future (and would be *very* nice). Poke around the Cairo mailing list and you'll see there is quite a lot of discussion about where the LCD hinting code belongs -- Cairo of Freetype -- but I digress.

Other 'bad citizens' on Linux include: OpenOffice.org (it uses its own font rendering code) and Java (Swing applications) which take it upon themselves to AA/subpixel render fonts. Ugly stuff.

Regards, Freddie.
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Thu Feb 26, 2009 1:35 pm    Post subject: Reply with quote

Well that is interesting. It appears as eselect fontconfig enable/disable has no effect at all, on either Qt or GNOME applications. GNOME applications seem to instead use the GNOME appearance dialogue -- which does have an effect (i.e., there is a different between hint slight and hint full). However, it does not effect Qt applications.

Ideas?

Regards, Freddie.
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Thu Feb 26, 2009 2:37 pm    Post subject: Reply with quote

Perhaps we should re-add cairo-respect-fontconfig.patch
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Fri Feb 27, 2009 10:35 am    Post subject: Reply with quote

bi3l wrote:
Perhaps we should re-add cairo-respect-fontconfig.patch

Worth a shot.

It also might be worth providing a patched version of poppler with a cleartype USE flag so that people, if they so desire, can toy with subpixel rendered PDF files. (There are some patches on the freedesktop bug report.)

Regards, Freddie.
Back to top
View user's profile Send private message
bi3l
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 268
Location: France

PostPosted: Fri Feb 27, 2009 10:42 am    Post subject: Reply with quote

Evilguru wrote:
bi3l wrote:
Perhaps we should re-add cairo-respect-fontconfig.patch

Worth a shot.

Done in the lcd-filtering overlay.

Evilguru wrote:
It also might be worth providing a patched version of poppler with a cleartype USE flag so that people, if they so desire, can toy with subpixel rendered PDF files. (There are some patches on the freedesktop bug report.)

I'll see what I can do.
Back to top
View user's profile Send private message
Evilguru
Guru
Guru


Joined: 16 Aug 2005
Posts: 390
Location: England

PostPosted: Fri Feb 27, 2009 4:09 pm    Post subject: Reply with quote

Switching back to lcd-filtering.

With the cairo respect fontconfig patch: The GNOME appearance dialogue has very little effect on font rendering (good). The eselect fontconfig (as root) affects the hinting of GNOME and Qt apps. Qt apps still have no subpixel rendering, GNOME ones do.

Regards, Freddie.
Back to top
View user's profile Send private message
ssmaxss
Apprentice
Apprentice


Joined: 28 Jun 2005
Posts: 160
Location: Moscow, Russia.

PostPosted: Fri Feb 27, 2009 5:19 pm    Post subject: Reply with quote

bi3l wrote:

Done in the lcd-filtering overlay.

What's the point in supporting two similar overlays? AFAIR you were offered commit access to devnull overlay. Maybe you should join efforts with devnull overlay?
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, 4, 5, 6 ... 27, 28, 29  Next
Page 5 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