Thread Tools Display Modes
  #1  
Old 05-25-2012, 03:46 PM
baitisj baitisj is offline
Junior Member
 
Join Date: Apr 2012
Posts: 14
Thanks: 5
Thanked 2 Times in 2 Posts
Cool Subpixel font antialiasing / hinting / smoothing / rendering? (especially in PBIs)
Hi all!

First of all, I'm LOVING PC-BSD 9. It's great, and has been serving me very well for many months now.

My first observation when using PC-BSD was that subpixel (or sub-pixel) font antialiasing was not available. I ended up patching several packages manually as described in the following thread:

http://forums.freebsd.org/showpost.p...9&postcount=10

However, I've noticed that many PBI packages don't support subpixel hinting and smoothing. Is there some way to enable this for PBIs that I love and adore (e.g. Chromium?)

Thank you!
-Jeff
  #2  
Old 05-30-2012, 02:57 PM
kmoore134's Avatar
kmoore134 kmoore134 is offline
Administrator
 
Join Date: May 2005
Location: Knoxville, TN
Posts: 2,568
Thanks: 0
Thanked 163 Times in 127 Posts
Default Subpixel font antialiasing / hinting / smoothing / rendering? (especially in PBIs)
Looking at that post, did you do the same and rebuild some of the cairo
/ freetype stuff on the system? I may have to put those patches into our
PBI builds, so that they get built with the better font support. I'll
try this out and report back
__________________
----
Kris Moore
PC-BSD Founder
  #3  
Old 05-30-2012, 04:26 PM
kmoore134's Avatar
kmoore134 kmoore134 is offline
Administrator
 
Join Date: May 2005
Location: Knoxville, TN
Posts: 2,568
Thanks: 0
Thanked 163 Times in 127 Posts
Default Subpixel font antialiasing / hinting / smoothing / rendering? (especially in PBIs)
Ok, so I've done some testing on this, and so far it seems that changing
the packages doesn't do anything. Rather if you just take a system, and
change /usr/local/etc/fonts/local.conf to this:

<?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>hintslight</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
</fontconfig>

It then starts applying the new settings to all applications, PBI's
included.

If some of you want to test this out, let me know if you prefer the way
fonts look with, or without this change to local.conf.
__________________
----
Kris Moore
PC-BSD Founder
  #4  
Old 01-04-2013, 03:34 AM
baitisj baitisj is offline
Junior Member
 
Join Date: Apr 2012
Posts: 14
Thanks: 5
Thanked 2 Times in 2 Posts
Default
Hi Kris!

Sorry I am so late in responding to this message. I appreciate your efforts to improve anti-alising. I actually did apply many patches to my ports tree and slowly started creeping away from PC-BSD PBIs and into FreeBSD ports. However, with 9.1 out the door, I'm definitely going to try modifying local.conf as you have suggested.
  #5  
Old 01-04-2013, 11:22 AM
baitisj baitisj is offline
Junior Member
 
Join Date: Apr 2012
Posts: 14
Thanks: 5
Thanked 2 Times in 2 Posts
Default
I upgraded to FreeBSD 9.1, and verified that it ships with /usr/local/etc/fonts/local.conf as you have described above. Only my window manager, Fluxbox, is subpixel antialiased...

I've also verified that
/usr/pbi/chromium-amd64/etc/fonts/local.conf is the same as above.

I've tested Firefox, Chromium, and Inkscape, and none of these packages have subpixel enabled.

I also have my ~/.fonts.conf set to the above.

In my earlier hacking, I patched only FreeType because the Cairo patches didn't apply cleanly. Patching FreeType was sufficient to get the LCD filtering working for most everything. However, programs that relied on Cairo for rasterizing vector graphics (e.g. evince) did not perform LCD filtering without the Cairo patches, and I was too lazy to finish off Cairo.

I would imagine that there are some much newer Cairo patches that could be pulled over from the Ubuntu project.

I'm going to experiment with anti-aliasing within Warden because, thanks to PC-BSD, I know much more now than I did in back in May about both FreeBSD and how PBIs work.

:-)
  #6  
Old 01-04-2013, 11:51 AM
baitisj baitisj is offline
Junior Member
 
Join Date: Apr 2012
Posts: 14
Thanks: 5
Thanked 2 Times in 2 Posts
Default
I think that a "simple" fix to this problem is just to make Freetype with WITH_LCD_FILTERING defined; e.g.
make -DWITH_LCD_FILTERING deinstall reinstall

and then rebuild every PBI that depends on FreeType...

By the way, FreeType 2 has LCD filtering disabled by default due to patent encumbrances in the land of the free, home of the brave (United States).

http://david.freetype.org/cleartype-patents.html
  #7  
Old 01-04-2013, 11:29 PM
David30 David30 is offline
Senior Member
 
Join Date: Jun 2012
Posts: 325
Thanks: 20
Thanked 30 Times in 29 Posts
Default
Originally Posted by baitisj View Post
I think that a "simple" fix to this problem is just to make Freetype with WITH_LCD_FILTERING defined; e.g.
make -DWITH_LCD_FILTERING deinstall reinstall

and then rebuild every PBI that depends on FreeType...

By the way, FreeType 2 has LCD filtering disabled by default due to patent encumbrances in the land of the free, home of the brave (United States).

http://david.freetype.org/cleartype-patents.html
Why not allow the user to choose the best font rendering when installing PC-BSD? Given that LCD filtering is disabled by default, the user can just enable it and see which combination of settings looks best.

Much more productive than staring at installation progress bars.
  #8  
Old 01-05-2013, 05:52 AM
baitisj baitisj is offline
Junior Member
 
Join Date: Apr 2012
Posts: 14
Thanks: 5
Thanked 2 Times in 2 Posts
Default
Hi David:

The issue is that the FreeType library that every PBI is compiled against is effectively lacking the code that performs LCD filtering. In order to allow users the ability to choose this option, the code must be included in the FreeType library object...

-DWITH_LCD_FILTERING enables the patent-encumbered code, compiles it, and places it in the FreeType library. The end-user will then be able to tailor his or her font rendering options (through modifying /usr/local/etc/fonts/local.conf, ~/.fonts.conf, or other means).

I should mention that, according to FreeType documentation, modifying fonts/local.conf is deprecated in favor of symlinking the appropriate configuration options in fonts/conf.avail to fonts/conf.d.
  #9  
Old 01-05-2013, 07:14 PM
David30 David30 is offline
Senior Member
 
Join Date: Jun 2012
Posts: 325
Thanks: 20
Thanked 30 Times in 29 Posts
Default
Originally Posted by baitisj View Post
Hi David:

The issue is that the FreeType library that every PBI is compiled against is effectively lacking the code that performs LCD filtering. In order to allow users the ability to choose this option, the code must be included in the FreeType library object...

-DWITH_LCD_FILTERING enables the patent-encumbered code, compiles it, and places it in the FreeType library. The end-user will then be able to tailor his or her font rendering options (through modifying /usr/local/etc/fonts/local.conf, ~/.fonts.conf, or other means).

I should mention that, according to FreeType documentation, modifying fonts/local.conf is deprecated in favor of symlinking the appropriate configuration options in fonts/conf.avail to fonts/conf.d.
My question is: could there be a GUI option at install time (when installing PC-BSD) to enable the correct font smoothing? The options already exist in the Control Panel, but the font rendering is a little bit blurry, even with LCD subpixel smoothing enabled, but still good.
  #10  
Old 01-05-2013, 08:02 PM
baitisj baitisj is offline
Junior Member
 
Join Date: Apr 2012
Posts: 14
Thanks: 5
Thanked 2 Times in 2 Posts
Default
Originally Posted by David30 View Post
My question is: could there be a GUI option at install time (when installing PC-BSD) to enable the correct font smoothing? The options already exist in the Control Panel, but the font rendering is a little bit blurry, even with LCD subpixel smoothing enabled, but still good.
David, maybe I'm thick, but I'm not seeing the option that you are describing in the Control Panel... maybe I don't have the correct PBIs installed? Could you include a screen shot? Is LCD filtering working for your Firefox / Chrome browser? (It's not working on mine.)
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.