LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to Optimize Fonts in Slackware (https://www.linuxquestions.org/questions/slackware-14/how-to-optimize-fonts-in-slackware-640468/)

dugan 10-31-2015 01:55 PM

Here's a patch to enable subpixel hinting in FreeType 2.6.1 (the version in -current). Use it along with the subpixel rendering patch that's already included (but commented out):

Code:

diff -rupN freetype-2.6.1.orig/include/freetype/config/ftoption.h freetype-2.6.1/include/freetype/config/ftoption.h
--- freetype-2.6.1.orig/include/freetype/config/ftoption.h      2015-10-31 11:13:39.744998876 -0700
+++ freetype-2.6.1/include/freetype/config/ftoption.h  2015-10-31 11:15:03.396998807 -0700
@@ -602,7 +602,7 @@ FT_BEGIN_HEADER
  /*  This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */
  /*  defined.                                                            */
  /*                                                                      */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
 
 
  /*************************************************************************/
Binary files freetype-2.6.1.orig/include/freetype/config/.ftoption.h.un~ and freetype-2.6.1/include/freetype/config/.ftoption.h.un~ differ


dc_eros 02-22-2016 07:02 PM

Hi Dugan.

Does it work the same as 2.6.2? Not sure what I did, but I manually patched the Slackbuild file (re: MS patch) and the package was well (foptionsomething.h).

I'm sure something is wrong with my current fonts as I did not upgrade from 2.5.5 for a long time (which is also patched and used to look good).

See what I did there: http://i.imgur.com/zTzxATq.png

dc_eros 02-23-2016 07:26 AM

I just did a restore from my VM backup (fortunately, latest was 3 days ago). I think I broke something when I did a `slackpkg upgrade-all`.

Back to beautiful fat fonts :D `freetype-2.5.5-x86_64-1subpixel`

spongetron 06-01-2016 04:03 AM

If someone is interested here is an updated set of nihilismus' infinaity-bundle for slackware-current:

https://github.com/rfmae/bob-infinality-bundle

gordydawg 06-03-2016 03:33 PM

Quote:

Originally Posted by spongetron (Post 5553861)
If someone is interested here is an updated set of nihilismus' infinaity-bundle for slackware-current:

https://github.com/rfmae/bob-infinality-bundle


Quite note for nihilismus. I tried installing his slackbuild bundle for the almost ready to be released Slackware64current (06/02/2016)

The build reinstalled freetype, but stalled at fontconfig with this message:

/tmp/bob-infinality-bundle/fontconfig-2.11.1/doc/fontconfig-user.sgml
No way to convert HTML to text found
MakeFile:1325:recipe for target 'fontconfig-user.txt' failed
make[3]: ***[fontconfig-user.txt]*** error8

The following slackbuilds were installed before running the bundle.

lxml, BeautifulSoup4 (with cssselect and html5lib installed first)

archfan 06-03-2016 04:09 PM

Gordydawg

you need to add teTeX to your PATH.

-> /usr/share/texmf/bin

gordydawg 06-03-2016 06:03 PM

Quote:

Originally Posted by archfan (Post 5555514)
Gordydawg

you need to add teTeX to your PATH.

-> /usr/share/texmf/bin

I tried that with PATH=$PATH:/usr/share/texmf/bin statement followed by export PATH before rebuilding and
while some sgml files were built during fontconfig, the fontconfig build halted with the same error message along with this:

makefile:725 recipe for target 'all' failed
makefile:581 recipe for target 'all-recursive' failed
makefile:465 recipe for target 'all' failed

archfan 06-03-2016 06:10 PM

Please try my updated version. I've just recompiled it and it worked fine on my machine.

https://github.com/archfan/bob-infinality-bundle

gordydawg 06-03-2016 08:04 PM

Quote:

Originally Posted by archfan (Post 5555571)
Please try my updated version. I've just recompiled it and it worked fine on my machine.

https://github.com/archfan/bob-infinality-bundle

I tried the updated version. Did you setup development path statements for your machine?

I tried the updated version on a fresh install of slackware64-current, with just lxml, beautifulsoup4, html5lib and cssselect. The build halted while working on fontconfig in the same area (the doc section and various sgml) with both no way to convert HTML to text error messages and the ones above.

What am I not doing?

archfan 06-04-2016 05:24 AM

Actually it worked almost right out of box when I reinstalled Slackware to test this. I just installed lxml and pointed the PATH to "/usr/share/texmf/bin". I didn't bother with the lxml dependencies such as beautifulsoup or html5lib.

I just uploaded the binaries here: https://github.com/archfan/bob-infin...es/tag/1231232

dugan 06-06-2016 12:32 PM

There's a program called qt5ct to set Qt 5 themes. One of things it does is set up user-level Fontconfig files for you.

I have a SlackBuild for it here:

https://raw.githubusercontent.com/du...5ct.SlackBuild

I'm using it on -current, where I built it against Alien Bob's Qt5 package.

Slackovado 11-05-2016 09:39 AM

Quote:

Originally Posted by archfan (Post 5555571)
Please try my updated version. I've just recompiled it and it worked fine on my machine.

https://github.com/archfan/bob-infinality-bundle

Hi,
I'd like to thank to all those who authored and contributed in any way to this "infinality fonts" setup.
It really makes a stunning difference from the stock font setup.
I had this on my Slackware 14 and am glad it's also available for 14.2.
Linux is great but this makes it so much better for those of us staring at computer screens all day long.

dimm0k 12-04-2016 03:30 PM

Quote:

Originally Posted by dugan (Post 5442915)
Here's a patch to enable subpixel hinting in FreeType 2.6.1 (the version in -current). Use it along with the subpixel rendering patch that's already included (but commented out):

Code:

diff -rupN freetype-2.6.1.orig/include/freetype/config/ftoption.h freetype-2.6.1/include/freetype/config/ftoption.h
--- freetype-2.6.1.orig/include/freetype/config/ftoption.h      2015-10-31 11:13:39.744998876 -0700
+++ freetype-2.6.1/include/freetype/config/ftoption.h  2015-10-31 11:15:03.396998807 -0700
@@ -602,7 +602,7 @@ FT_BEGIN_HEADER
  /*  This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */
  /*  defined.                                                            */
  /*                                                                      */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
 
 
  /*************************************************************************/
Binary files freetype-2.6.1.orig/include/freetype/config/.ftoption.h.un~ and freetype-2.6.1/include/freetype/config/.ftoption.h.un~ differ


dugan, thanks again for pointing this out to enable good looking fonts without modifying the system unnecessarily with Infinality...

dugan 12-05-2016 12:06 PM

Thanks for reminding me of this thread, dimm0k.

I got tired of having to make a new patch every time FreeType got updated. Here's a sed line that will enable subpixel hinting with FreeType's default hinter. It works with 2.6.5:

Code:

sed -i 's/\/\* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING  2[[:space:]]\+\*\//#define TT_CONFIG_OPTION_SUBPIXEL_HINTING  2/g' include/freetype/config/ftoption.h
Paste it into the FreeType SlackBuild under the line that applies the subpixel rendering patch. Also uncomment that line so that the subpixel rendering patch is applied.

If you want Infinality (which is directly supported by FreeType now), you should be able to just change the two 2s to to two 1s.

My font customizations are pretty simple:

1. FreeType rebuilt with both subpixel rendering and subpixel hinting, as above.

2. 11-lcdfilter-lcddefault.conf in /etc/fonts/conf.d

3. webfore-fonts from SBo (and /etc/fonts/conf.d/60-liberation.conf removed)

4. If I feel like it, /etc/fonts/conf.d/44-wqy-zenhei.conf removed and my sans, serif and monospace aliases overridden. It's typically Source Sans Pro or Fira Sans for sans, Gentium Plus for serif, and Hack, Source Code Pro or Fira Mono for monospace.

Daedra 12-05-2016 06:16 PM

1 Attachment(s)
I'm doing this exact same thing with freetype-2.7 on a -current virtual machine. The only thing I noticed is that certain things like firefox and XFce launcher/panel were not hinted. Adding a .Xresources file to home with the following options fixed it. It now looks almost identical to infinality and all I had to do was recompile freetype. BTW thanks for that sed line, that is much easier than making a patch each time. I did change the hinting style from 2 to 1, but I will probably try them both to see if I can find a discernible difference.

My .Xresources file

Xft.dpi: 96
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
Xft.autohint: 0

I still run infinality on my 14.2 machine but will probably go with this on the next stable release.

I edited the post to show the importance of the .Xresources file. The attached screenshot is of slashdot zoomed into show the difference.


All times are GMT -5. The time now is 02:19 AM.