LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-23-2018, 01:03 PM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Current and freetype font rendering


I am unable to get nice looking fonts in my Current VirtualBox instance. I am using Xfce.

Regardless of my efforts, the fonts are always "blurry" or "fuzzy."

I am a long-time MS core fonts user. I much prefer Arial for my desktop font. I have tried other fonts and prefer Arial. Enough said about that, please.

For more than a decade I have used 120 dpi, anti-aliasing, full hinting, and RGB sub-pixel ordering. I long have used my own /etc/fonts/local.conf for when desktop environments do not support those options. For many years I rebuilt the freetype package to gain use of sub-pixel ordering.

I never had a problem with the True Type fonts until the latest freetype changes.

I am aware the changes in the latest package affect True Type fonts. Allegedly the cure for using True Type fonts with the latest freetype is to use various environment variables. I tried all three options in /etc/profile.d/freetype.sh.

In a CentOS 7.6 virtual machine, which includes the same freetype changes, I am using the following environment variable:

export FREETYPE_PROPERTIES="truetype:interpreter-version=35 cff:no-stem-darkening=1 autofitter:warping=1"

This variable has no effect in Current. Rebuilding the freetype package has no effect. Updating the latest VirtualBox GA has no effect.

Any ideas?

Thanks.

Last edited by upnort; 12-23-2018 at 01:14 PM.
 
Old 12-23-2018, 03:24 PM   #2
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,691

Rep: Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377
With -current this is how I set my fonts, not sure if this is the look you are going for though. The newest versions of freetype don't require recompiling to get subpixel rendering anymore, they have there own method called harmony. All I do now is set these symlinks in my /etc/fonts/conf.d file

Code:
cd /etc/fonts/conf.d
ln -s /etc/fonts/conf.avail/10-hinting-full.conf   (I use 10-hinting-slight.conf, but you mentioned you like full)
ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf
ln -s /etc/fonts/conf.avail/11-lcdfilter-default.conf
and then add an .Xresources file in my home directory with these settings, this is for a few programs that don't play nice with fontconfig

Code:
Xft.dpi: 96
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
Xft.autohint: 0
I have tried the both mode 38 and 40 in /etc/profile.d/freetype.sh and didn't see a difference, so I just use the default.

Based on what you said you'll probably want to tweak the DPI and such but this is what I do and this is what my fonts look lile.
https://www.dropbox.com/s/ogpnnsb0wo...rent1.png?dl=0

Last edited by Daedra; 12-23-2018 at 04:20 PM.
 
3 members found this post helpful.
Old 12-23-2018, 10:50 PM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by Daedra View Post
The newest versions of freetype don't require recompiling to get subpixel rendering anymore, they have there own method called harmony. All I do now is set these symlinks in my /etc/fonts/conf.d file
Right answer.

All you have to do in order to change the appearance of your screen fonts is symlink files from /etc/fonts/conf.avail to /etc/fonts/conf.d.
 
Old 12-24-2018, 02:33 AM   #4
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
hi,

I had a similar issues:
https://www.linuxquestions.org/quest...ml#post5811584

and this is how a fixed them:
https://www.linuxquestions.org/quest...ml#post5815939
 
Old 12-24-2018, 12:58 PM   #5
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Thanks for the tips. As often is the case, discussing an issue with others reveals the root cause. In my case, the problem is caused by 60-liberation.conf. I should have thought about that sym link right away because I long have used the MS core fonts and always have had to remove that link.

After removing that link the fonts look sharper. Yet oddly the entire VirtualBox screen looks blurry or fuzzy. All other VirtualBox guests (not Slackware) do not have this problem. Might be an Xfce thing, I don't know. I have no patience for KDE and I have not tried that. I need to find time to install the MATE packages as that is what I use daily and that would provide my eyes an equivalent presentation. I probably should find time to run Current on bare metal too. Time -- the one thing nobody ever has enough of.

Side note: I realize the Liberation fonts are supposed to be a replacement for the MS fonts, but to me they don't look the same and are not as sharp. The metrics are not the same and the fonts always look thicker to me. Because of the recent upstream freetype changes I have been tinkering with other fonts. I don't seem to find anything I am content with. Probably two decades of eye and memory muscle fighting against me because I started using the core fonts as soon as I started using Linux systems in 2002. Back in that day, fonts on a Linux system were awful. As I was dual booting for a few years, I used the core fonts in both systems. By using the core fonts I never had font issues in any Linux system I used. Some might call that "cheating." I call that being pragmatic.
 
Old 12-24-2018, 02:48 PM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Current and freetype font rendering

Did you enable sub-pixel hinting? It is not enabled by default.
 
Old 12-24-2018, 03:02 PM   #7
max-user
LQ Newbie
 
Registered: Jan 2018
Posts: 12

Rep: Reputation: Disabled
Quote:
Originally Posted by rkelsen View Post
Did you enable sub-pixel hinting? It is not enabled by default.
How to enable it ?
 
Old 12-24-2018, 03:14 PM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Current and freetype font rendering

Add a symlink as mentioned in Daedra's post above.
 
Old 12-24-2018, 04:38 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Quote:
Did you enable sub-pixel hinting? It is not enabled by default.
Yes.

Quote:
How to enable it ?
Also can be enabled with the older local.conf that is sourced through 51-local.conf.

Question:
Is sub-pixel hinting now built in? If yes then perhaps the build script should be updated to removed the freetype.subpixel.rendering.diff.gz patch?
 
Old 12-24-2018, 04:45 PM   #10
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,691

Rep: Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377
Quote:
Originally Posted by upnort View Post
Yes.


Also can be enabled with the older local.conf that is sourced through 51-local.conf.

Question:
Is sub-pixel hinting now built in? If yes then perhaps the build script should be updated to removed the freetype.subpixel.rendering.diff.gz patch?
Well freetype's own method of subpixel rendering called harmony is enabled by default now because it doesn't infringe on any patents. You can still enable the old Microsoft patented method with that patch if you want it, so personally I hope Pat leaves it in the buildscript. I was using the patented method until recently because some programs like Wine didn't support harmony yet and fonts would looks terrible with harmony, so using the old patented method was the safest option. However it seems most programs have caught up to freetype so there is very little reason to use the old patented method anymore. but it is still nice having the option in the buildscript IMO
 
Old 12-25-2018, 01:25 PM   #11
max-user
LQ Newbie
 
Registered: Jan 2018
Posts: 12

Rep: Reputation: Disabled
Quote:
Originally Posted by Daedra View Post
Code:
ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf
Does it makes sense, if Slackware has
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
by default ?
 
Old 12-25-2018, 04:18 PM   #12
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,691

Rep: Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377
Yes and no, that line just specifies the pixel order of your LCD monitor. The vast majority of monitors sold today have a pixel order of red,green,blue (RGB). There are monitors out there that different pixel orders like blue,green,red (BGR). I believe the default is RGB so you really don't have to set that if you don't want to. I just do it for peace of mind. If you had a monitor that used BGR, you would have to symlink the appropriate entry into /etc/fonts/conf.d, however I have personally never seen a monitor that uses anything other than RGB, but I do know they exist.

And remember, #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING is the patented subpixel rendering method, freetype 2.9.1 has two ways of doing subpixel rendering, the patented cleartype Microsfoft method, which is that line, and is disabled in default Slackware. And the non-patented freetype method called harmony which is now automatically enabled in freetype. You just have to "turn it on" either in your desktop environment or with the symlinks I mention above.

So quick answer, if you decided to turn on subpixel rendering, setting your pixel order is probably only necessary if your monitor is using something other than RGB, but I always set it anyway.

Last edited by Daedra; 12-25-2018 at 04:51 PM.
 
Old 12-26-2018, 12:21 AM   #13
max-user
LQ Newbie
 
Registered: Jan 2018
Posts: 12

Rep: Reputation: Disabled
Quote:
Originally Posted by Daedra View Post
And remember, #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING is the patented subpixel rendering method, freetype 2.9.1 has two ways of doing subpixel rendering, the patented cleartype Microsfoft method, which is that line, and is disabled in default Slackware. And the non-patented freetype method called harmony which is now automatically enabled in freetype. You just have to "turn it on" either in your desktop environment or with the symlinks I mention above.
Thanks !

AFAIU These two methods may coexist (may be enabled) simultaneously in the same system.
True ?
 
Old 12-26-2018, 03:03 AM   #14
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,691

Rep: Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377
I don't believe so. if you enable #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING with the patch included in the slackbuild then the patented method will be used and harmony will be disabled. I am not 100% sure about this, but it really doesn't matter which one you choose to use. visually they are identical. If you read this, it implies its one or the other.

Code:
  /*************************************************************************/
  /*                                                                       */
  /* Uncomment the line below if you want to activate LCD rendering        */
  /* technology similar to ClearType in this build of the library.  This   */
  /* technology triples the resolution in the direction color subpixels.   */
  /* To mitigate color fringes inherent to this technology, you also need  */
  /* to explicitly set up LCD filtering.                                   */
  /*                                                                       */
  /* Note that this feature is covered by several Microsoft patents        */
  /* and should not be activated in any default build of the library.      */
  /* When this macro is not defined, FreeType offers alternative LCD       */
  /* rendering technology that produces excellent output without LCD       */
  /* filtering.                                                            */
  /*                                                                       */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */

Last edited by Daedra; 12-26-2018 at 03:10 AM.
 
Old 12-26-2018, 04:52 PM   #15
Poprocks
Member
 
Registered: Sep 2003
Location: Toronto, Canada
Distribution: Slackware
Posts: 522

Rep: Reputation: 279Reputation: 279Reputation: 279
Yes, I recompile freetype 2.9.x on my machine with ``#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING'' enabled, because WINE does some very bizarro low-level things to enable smoothed fonts rather than using, say, the Xft API. Try enabling smoothed fonts in WINE without that option enabled, and it will not work and fonts will appear jagged and un-antialiased.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Changes to default freetype / font appearance on -current coralfang Slackware 8 04-27-2017 02:43 PM
Programming with FreeType: Rendering fonts a little better. narc Programming 0 12-09-2013 10:44 PM
Slightly odd font rendering with Freetype bytecode interpreter Daedra Slackware 1 02-08-2007 07:46 AM
Fedora, Steam ==> no font, Winex: Freetype and Xrender error burn0ut Linux - Software 0 05-05-2004 03:10 PM
Freetype-devel for freetype-2.1.4-1 (redhat 9) Goog Linux - Distributions 0 05-05-2003 06:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration