LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Making non-antialiased fonts looks nice. (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/making-non-antialiased-fonts-looks-nice-257705/)

Franklin 11-21-2004 04:55 PM

Making non-antialiased fonts looks nice.
 
Hello all.

From time to time I see posts from people who feel that linux has ugly fonts and want to know how can they be improved. More often than not, people are looking for font antialiasing, much like the way Apple/OSX renders fonts.

I, for one, dislike that manner of font rendering. The fonts always seem slightly blurry and I feel like I'm straining my eyes to create a clearer image. For this reason, I set out to create a situation where my fonts in linux render exactly as they do in windows - the manner of rendering I prefer.

As any one who uses linux will tell you, turning of antialiasing can produce... well, really crappy results. This situation can be improved considerably, as I have tried to show here. These screen shots are aimed at trying to show several things:

* Well rendered, non-antialiased fonts
* Consistency between KDE and GTK2 applications
* Readable terminal fonts
* Consistent and well rendered fonts across all browsers

While this look is not for everyone, I am very happy with it. If anyone is interested, I would be happy to detail what needs to be done to achieve this on your box.

Thanks for reading.

MWtee 11-22-2004 06:06 AM

Your screenshots look really nice for me and it would be great to read how you achieved this results.
I'm the half-way doing the same thing :)

sunilgeo 11-22-2004 08:37 AM

I have gone through several forums trying to get the fonts look just like as in windows for my linux installation and so far everything failed. Your screenshots looks like exactly what I want, could you please tell me how to achieve this?

Franklin 11-22-2004 09:01 AM

Thank for the replies!

I'll write up something and try to get it posted tonight.

Franklin 11-22-2004 11:18 PM

OK, here it is. My "Make Your Fonts Looks Like They Do in Windows" Howto - Hope it helps someone.

First, some warnings:

1. Some of the things I will be suggesting may be in violation of patent laws depending on where you live. They also require you to install fonts that I will assume you have the right to use because you paid for them by buying Windows or a computer with Windows installed. Nuff said.

2. Recompiling freetype2 may have some undesired effects such as 1) Breaking the KDE font installer in KDE 3.2.x (no observed problem in 3.3.1) 2) Changing the way antialiased fonts are rendered in Fluxbox. Blackbox is not adversely effected because it does not use aa. This is likely very fixable but since I don't use it, I don't care. 3) Possibly changing the antialising in KDE/Gnome ever so slightly for the worse. This last one is really a subjective assessment and mentioned only because I seen it mentioned elsewhere (i.e. SuSE newsgroups) so I felt you should be warned. Your distro and your mileage may vary.

3. I have NOT tested this on every distro. My screenshots are from Slackware-current, up to date as of Pat getting sick (11/16 last official changelog). For those who don't know, slack uses Xorg, KDE 3.3.1, Gnome 2.6, freetype 2.1.9, kernel 2.4.27. I have done this before in SuSE 8.2, slackware 9.1, slackware 8.1, and will be trying this with Debian over the next several days, however I "hear" freetype already is compiled with the byte code interpreter enabled in Debian so I don't expect much difference. That being said I see room for improvement so who knows. I am VERY new to Debian.

Alright - enough BS.

Step 1: Deciding on a good resolution.

This is mostly determined by your monitor/vidcard combo and your personal prefs. I have a 19 inch ViewSonic that works well at 1280x1024 @ 75hz. 17 inch monitors generally run best at 1024x768 - YMMV. Configure XF86Config or xorg.config to display your desired resolution and refresh rate. (If you don't know how, man xorg.conf) Don't worry if your fonts are too small - we'll take care of that later by changing the dpi.

Step 2: WWWD - What Would Windows Do?

Windows does three things that we need to make linux do. 1. Use decent quality fonts 2. Use a sane DPI (dots per inch) 3. BYTE_CODE_INTERPRETER

1. Getting TrueType Fonts

Some distros like SuSE come with a little script that allows you to download the Windows Core Font package. If you own a windows disk, there are some cabextract programs out there that will allow you to mine the disc for fonts. If you dual-boot, like me, then just mount your windows partition and copy the font folder to /home/<user>. Copying the font folder is not needed, but may be a good idea seeing as you never know when something will hose your windows partition. At least then you'll have it for easy access in the future.

Now we need to add the True Type fonts to linux. Fonts in linux are usually located in the /usr/X11R6/lib/X11/fonts directory. A quick peek at xorg/XF86Config will tell you where yours are:

Code:

#  FontPath  "/usr/X11R6/lib/X11/fonts/local"
#  FontPath  "/usr/X11R6/lib/X11/fonts/CID"
#  FontPath  "/usr/X11R6/lib/X11/fonts/Speedo"
    FontPath  "/usr/X11R6/lib/X11/fonts/misc"
    FontPath  "/usr/X11R6/lib/X11/fonts/TTF"
    FontPath  "/usr/X11R6/lib/X11/fonts/100dpi"
    FontPath  "/usr/X11R6/lib/X11/fonts/75dpi"
    FontPath  "/opt/kde/share/fonts"
    FontPath  "/usr/X11R6/lib/X11/fonts/Type1"
    FontPath  "/usr/X11R6/lib/X11/fonts/cyrillic"
    FontPath  "/usr/local/share/fonts"
    FontPath  "/usr/X11R6/lib/X11/fonts"
    FontPath  "/usr/local/share/fonts/TTF"  <-- Created by KDE font installer
    FontPath  "/usr/share/fonts"
    FontPath  "/usr/share/fonts/default"

In my case, True Type fonts are in the TTF directory. Yours may be in truetype directory, or you may need to create a TTF folder. You can also add then to your ~/fonts directory if you don't want them system-wide, but I usually do install them system wide. If you do create a new folder for them, be sure to install a FontPath line to let X know where to find them.

The simplest way to install new fonts is with the KDE font installer module in the Control Center under System Administration. Be sure to use Administrator Mode (system-wide) and click on the TTF directory in the tree. Click the "Add Fonts" button in the tool bar. Navigate to the directory where the windows fonts are and select all the fonts you want to add: Arial, Comic Sans MS, Courier New, Tahoma, Times New Roman, and Verdana are the main ones you will need. You can add whatever you want of course. If you use this method, the fonts will be installed to the /usr/local/share/fonts/TTF directory and a path will be created in xorg.conf as you can see above. We do this first because recompiling freetype2 can break the font installer - this allways happened to me in 3.2.x.

While you are editing xorg.conf, you should do one more bit of housekeeping and make sure that the 100dpi fonts are listed above the 75dpi font lines

2. DPI - dots per inch

Windows uses a default setting of 96 dpi. Linux defaults to 75 or 81 dpi. This is why linux fonts are always so damn small compared to the same fonts in windows at the same screen resolution and font size. There are several things we need to do to get linux to run at 96 dpi depending on your situation:

A) If you boot into runlevel 3 and use "startx" to start X, we need to edit the /usr/X11/bin/startx script. Depending on your distro, this may be a symlink to /usr/X11R6/bin/startx.

Code:

userclientrc=$HOME/.xinitrc
userserverrc=$HOME/.xserverrc
sysclientrc=/usr/X11R6/lib/X11/xinit/xinitrc
sysserverrc=/usr/X11R6/lib/X11/xinit/xserverrc
defaultclient=/usr/X11R6/bin/xterm
defaultserver=/usr/X11R6/bin/X
defaultclientargs=""
defaultserverargs="-dpi 96"  <--- LOOK HERE
clientargs=""
serverargs=""

Just add the "-dpi 96" to the end of the 'defaultserverargs=' line and that's it. Now, everytime you use startx, you will boot to 96x96 dpi which can be confirmed from the command line after starting X by typing:
Code:

xdpyinfo | grep resolution
B) If you automatically startx by using KDM or GDM, then we need to edit xorg.conf or XF86Config. This is a little more complicated. We need to use the DisplaySize variable and this will be different for each resolution. I use 1280x1024:
Code:

# **********************************************************************
# Monitor section
# **********************************************************************

# Any number of monitor sections may be present

Section "Monitor"

    Identifier  "My Monitor"

# HorizSync is in kHz unless units are specified.
# HorizSync may be a comma separated list of discrete values, or a
# comma separated list of ranges of values.
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR'S
# USER MANUAL FOR THE CORRECT NUMBERS.

    HorizSync  31 - 86

#    HorizSync 30-64        # multisync
#    HorizSync 31.5, 35.2    # multiple fixed sync frequencies
#    HorizSync 15-25, 30-50  # multiple ranges of sync frequencies

# VertRefresh is in Hz unless units are specified.
# VertRefresh may be a comma separated list of discrete values, or a
# comma separated list of ranges of values.
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR'S
# USER MANUAL FOR THE CORRECT NUMBERS.

    VertRefresh 50-180
    Option      "dpms"
    DisplaySize 337.5 270.0  <--- LOOK HERE
EndSection

The [DisplaySize 337.5 270.0] setting will cause X to load at 96x96 dpi when at 1280x1024 resolution. When the numbers go up, the dpi will go down. When the resolution goes down, the dpi goes down as well, so this is not a constant if you are one to change resolutions. The startx script edit is a constant regardless of resolution. The following may help you figure your own values:
Code:

      1280        1024
      ------  X  ------              1280 * 270 = 345600;  1024 * 337.5 = 345600   
      337.5        270.0

C) If you use Gnome, then even if we have done both of the above, we need to go into Gnome/Desktop Prefs/Fonts/Details and change the DPI setting at the top of the page to read 96. Even if you don't use gnome, but use the gnome-setting daemon to carry the Gnome themes into KDE, you will need to do this to maintain consistency. Even If you don't, apps like evolution, I believe, still carry the dpi setting into KDE and may lead to font-size inconsistency.

OK, so now we have TT Fonts, and or dpi is set at 96x96 now we need to...

3. Recompile Freetype2 to enable the Bytecode Interpreter.

Download the source from http://www.freetype.org/

While it likely doesn't matter, I alway make sure that I am installing the same version that is already installed in my distro. For example, for a while slack-current used 2.1.8 even though 2.1.9 had been released, so I only recompiled the 2.1.8 source. I just feel that the fewer the variables, the less to troubleshoot. Download and extract the tarball - I always compile in /tmp - and read the readme's!!!!

The following is from the TRUETYPE readme in the source package of freetype2:

Code:

How to enable the TrueType native hinter if you need it
--------------------------------------------------------

  The TrueType  bytecode interpreter is disabled in  all public releases
  of    the    FreeType    packages    for    patents    reasons    (see
  http://www.freetype.org/patents.html for more details).


  However,  many Linux distributions  do enable  the interpreter  in the
  FreeType packages (DEB/RPM/etc.) they produce for their platforms.  If
  you are using TrueType fonts on your system, you most probably want to
  enable it manually by doing the following:

    - open the file "include/freetype/config/ftoption.h"

    - locate a line that says:

          #undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER

    - change it to:

          #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER

  These steps must be done _before_ compiling the library.


--- end of TRUETYPE ---

Couldn't have said it better myself ;)


Before compiling freetype and installing, you may want to uninstall the package that is currently installed on the system. I've seen this said other places, but I have not had a problem NOT doing that - slackware's stock freetype is imbedded in the X packages and cannot be uninstalled as a seperate package so I didn't. Made no difference.

Another thing you should do before installing is check your symlinks.

Code:

steve@peggyo:~$ cd /usr/lib
steve@peggyo:/usr/lib$ ls -la libfreetype*
-rw-r--r--  1 root root 2431914 2004-11-11 00:28 libfreetype.a
-rwxr-xr-x  1 root root    816 2004-11-11 00:28 libfreetype.la*
lrwxrwxrwx  1 root root      20 2004-11-11 00:28 libfreetype.so -> libfreetype.so.6.3.7*
lrwxrwxrwx  1 root root      20 2004-11-11 00:28 libfreetype.so.6 -> libfreetype.so.6.3.7*
-rwxr-xr-x  1 root root  415008 2004-06-05 17:48 libfreetype.so.6.3.5*  <-- OLD and UNLINKED;
-rwxr-xr-x  1 root root 1521734 2004-11-11 00:28 libfreetype.so.6.3.7*     
steve@peggyo:/usr/lib$

This can be very helpful if you choose to upgrade and you want to check that the links point to the new libs. This is also helpful if you want to delete the libraries before installing the new compile and want to see if new links were created. If not, the old listing will tell you what you need to do.

Also, be sure you have all the dev packages installed so you CAN compile!!! ;)

OK then, time to compile.....
Code:

./configure --prefix=/usr
I use this setting for slack, it may work for you, you may not need it. If libfreetype is in /usr/lib, them it's probably OK. Read ./configure --help to see defaults.
Code:

make
dum dee dum dum dum.....
things wizzing by....
lots of error messages like "blah blah violates strict antialiasing rules yada yada" ignore them.
su to root
Code:

make install
While you are still root run
Code:

ldconfig
and that should do it.

If you are in KDE, go to /Control Center/Appearance/Fonts and keep antialiasing enabled, but exclude range 0.0 pt to 14.0 or 15.0 pt. Change all fonts to arial or verdana at 9 or 10 and restart X.

You should see a big difference in how these fonts are rendered without antialiasing (at this size).


STEP 3: GTK2 (Gimp Tool Kit) Applications in KDE

Applications like Mozilla, Gnumeric, Gaim, Abiword, Blufish, Pan are GTK2 applications. They will not follow the font type and size rules you set up when you use them in KDE unless you create a hidden file in your /home/<user> directory.

Create a text file, call it .gtkrc-2.0, and add the line:

gtk-font-name = "Verdana 9"

or whatever your chosen font and size in KDE is.

That should be it.

I'll post some stuff about browsers tomorrow as well as some links I have regarding font issues. Too late now- time for bed.

Hopefully I did not forget too much.

pesari 12-05-2004 08:12 AM

Thank you!
 
Franklin,

Thanks a lot! I really appreciate instructions that are straight-forward enough for people to understand. :)

Oh, I forgot... Worked well with Fedora Core 2. I installed Freetype 2.1.9 without problems *cnock cnock*. :) It looks very good.

Franklin 12-14-2004 12:53 PM

Glad to hear it!
Been away for a few weeks. I'll add the browser info later this week - tho it's pretty self explanatory really.

Anyway, glad to hear my instructions worked for others.

Steve

jordzz 12-15-2004 05:51 AM

Quote:

Originally posted by Franklin
Glad to hear it!
Been away for a few weeks. I'll add the browser info later this week - tho it's pretty self explanatory really.

Anyway, glad to hear my instructions worked for others.

Steve

It also worked for me :) thnx! Im looking forward to the browsers part.
Because often they don't render nice fonts :)

Franklin 01-01-2005 08:52 AM

Hi again. Sorry this took so long - I was away for a while and returned to too much work.

I posted some new screenshots that are meant to show the Firefox, Mozilla, and Konqueror browsers with the font configurations
that I use. This is nothing you couldn't arrive at easily through trial and error, but since I was asked - here it is:

screenshots

All three browsers are set up to provide a consistant look between the three. I use all three for different tasks since, unfortunately,
there is no one browser that doesn't have some failing involving what I need a browser to do.

Like I said before, this style of font rendering isn't for everyone - most people on this forum seem to prefer the antialiased look.
But, for those who like thin fonts at small point sizes, I hope you have found this helpful.

Happy New Year.

jferrando 01-01-2005 07:01 PM

For me it worked installing nice making Linux (Suse 9.1 and Mandrake 10.1) display nice fonts with the help from http://convexhull.com/mandrake_fonts.html
I was desperate about fonts in Linux, so this is the answer!

mysterio 01-02-2005 10:00 AM

Nice Franklin, especially like the screenshots of the browsers with the settings.

Franklin 01-02-2005 10:27 AM

Quote:

Originally posted by mysterio
Nice Franklin, especially like the screenshots of the browsers with the settings.
Thanks!

It's amazing how much work I'll go through just to avoid a lot of typing ;)

Franklin 01-02-2005 02:31 PM

In the interest of fairness, I have included some shots of Gnome 2.8 (Dropline) on slackware-current running kernel 2.6.10 with the font setup for Epiphany. This is a new install on a separate partition to test the 2.6 kernel. I removed Dropline's freetype tgz prior to compiling and installing my own. I did a standard ./configure --prefix=/usr, make, make install. Just a word of warning - Dropline Gnome will not work correctly and definitely will not re-load untill you re-install freetype so don't fart arround too much and put everything where you know where to look in case you end up back at the command line.


BjornErik 01-06-2005 03:27 AM

Fonts in Firefox
 
Hi,

Thanks for the good instructions!
I've followed the guide and managed to get all the programs I run except Firefox 1.0 to look like your screenshots.
I've read a lot about fonts in Firefox but I still can't get them look like yours (Mozilla 1.7.5 looks nice though).

Can you please give me some hints about fonts in Firefox?

Thank you!

Idle 01-11-2005 06:22 AM

Marvellous! Thanks for the tips, it works just fine for me. There's one small problem after the changes, though. Firefox doesn't seem to like my blog anymore, it just crashes when I try to view it (idleblog.iceware.net, if someone else wants to try). Seems to be the only page I have the problem with. Ideas, anyone?

Franklin 01-11-2005 06:55 AM

Idle, no problem here with the blog and firefox. Try deleting the cache (edit. pref, priv, cache) Not sure what else to suggest. Also try starting firefox from the command line to see if it gives any error messages before it craps out. Also try it as another user - if this works you can delete the .firefox directory in your home folder - save your bookmarks first. I will create a new one and that may clear up the issue.

HTH

Idle 01-11-2005 07:29 AM

I tried what you suggested, including deleting the firefox directory, but nothing works. When I run it from the command line, I get this error:
"/opt/firefox/run-mozilla.sh: line 159: 11701 Segmentation fault "$prog" ${1+"$@"}"

Don't trouble yourself, I'll figure something out. Thanks. :)

lemuel 01-14-2005 06:49 PM

Thank you very much for your how-to franklin. I bow before thee!

I'm so glad I was able to read this thread. Now I dont have to suffer looking at the ugly fonts in Suse. I think the only thing I ever miss in Xp are the fonts, but now i dont have to anymore thanks to you!

I tried it in Suse 9.2 and Ubuntu and it worked for both distros.

You should transfer this how-to to the tutorial section so it can get better exposure and many more will be able to recieve help from it.

by the way, to those who still dont know, M$ true type core fonts can now be downloaded under the EULA license in this site

http://thelinuxbox.org/Downloads.php

just scroll down to the bottom of the webpage where you can download the fonts. there you can even download 6760 FONTS IN A SINGLE FILE WHOOOHOOO!! check it out!

Franklin 01-15-2005 09:16 AM

Glad things worked for you lemuel.

I think that this is a fine place for this thread for a couple reasons:

1. It seems to be getting plenty of views.
2. I labled the thread such that anyone willing to do a search will find it. ;)
3. While it works for me and the few who have also confirmed success, I have only tested
this on a handful of distros and was not confident that this was a general "fix".
4. Placing a thread like this in the "Answers" forum might make LQ look as though it
endorses doing things that might be "problematic" depending on a users situation.

If a mod sees it and suggests moving it so be it. It's not for me to decide and, like I said, it seems to be getting some views where it is.

By the way, no bowing required: ;)

Much of this can be found in other places on the web anyway, I just tried to consolidate it a bit and add a couple tweaks I came up with. Must give credit where credit is due.

The Dropline-Gnome forum has a font-FAQ that discusses some of this.
Also, do a search in Google <groups> under alt.os.linux.suse for posts by softedges. He had some pages posted that go into some more detail regarding font.config files etc in SuSE 8.2. Also varius font-deuglification Howto's (tho many are dated) are a must read as well.

pnellesen 01-15-2005 10:08 AM

Quote:

Originally posted by Idle
Marvellous! Thanks for the tips, it works just fine for me. There's one small problem after the changes, though. Firefox doesn't seem to like my blog anymore, it just crashes when I try to view it (idleblog.iceware.net, if someone else wants to try). Seems to be the only page I have the problem with. Ideas, anyone?
You may need to change the permissions on your TrueType fonts (or whatever font you're using in your Blog)? I had the exact same thing happen to me, and discovered only root had any permissions at all on those fonts.

puffinman 01-16-2005 10:28 PM

Amazing
 
Wow, wow, all I can say is wow.

Worked great on Mandrake 10.1 / GNOME 2.6. Thanks for such a clear and thorough walkthrough. Seems like I was in the same boat with a lot of folks; love Linux but get headaches from the fonts. That is, I USED to get headaches.

Thanks again, Franklin. :)

Franklin 01-23-2005 09:00 AM

Missing Konsole font: a solution

This problem has plagued me off and on since I started with linux it seems 2 1/2
years ago. I often solve the problem, as do others, through some other action
(read 'by accident' ;) ) and am left with no reproduceable solution. This also
appears to be the case with many related threads I found through google which
appear to end either without resolution or "I don't know why, but when I did
"X" it fixed itself". I offer this as a definitive fix. Hope it helps others.

Problem:

For some unknown reason, trying to set the font in Konsole (KDE) to type "Linux" will
result in the following error message:

Font:

`-misc-console-medium-r-normal--16-160-72-72-c-80-iso10646-1'

not found.

Check README.linux.console for help.


Of course, README.linux.console, once I found it (not on my system by the way)
was of no use whatsoever.

After much googling I found a post that identified the missing font(s) as:

console8x16.pcf.gx and/or
console8x8.pcf.gz

Clearly this font was missing from the "misc" font directory.

Performing a locate, the fonts were found at:

/opt/kde/share/fonts

I first tried to add this location to my font paths but this did not seem to
help. I then used the KDE Font installer in the Control Panel (as root), selected the
"misc" font directory as my destination directory and /opt/kde/share/fonts as my
source directory, selected the 2 fonts and restarted X. Since the only people having
this issue will be using KDE, this is likely the simplest procedure.

Problem solved.

HTH someone. This always pissed me off.

madiyaan 01-23-2005 03:42 PM

Amazing screenshots.
 
I'm running Fedora Core 3 and Gnome 2.8 (that comes with it) and all default configs.
Your screenshots look amazing, and even better than Windows.
Here's what I did:
http://distributions.linux.com/howto...OWTO/fix.shtml
I used the recompiled RPM for Fedora Core 3 (cause I don't like to recompile; recompiling has always given me issues). I did not follow your step (B), cause I hate to mess around with the text files myself (I'm a Linux Newbie). But it's still not giving me the right results. Font's aren't crisp at all... in fact they're very very fuzzy, and I don't see any striking difference b/w these fonts and the fonts rendered by freetype that was compiled without bci. I also installed the truetype fonts, which were equally ugly.
Also, I looked around Gnome font manager (click the foot icon, preferences, fonts), and there's no option to uncheck anti-aliasing. I think my biggest problem is that AA is set to on for every font (even smaller ones, or even truetype ones). So is there a way to disable AA thru' Gnome (graphical GUI method preferred over text method)?
I'm asking this cause you have a screenshot with Gnome... which means you probably turned off AA in Gnome too. I'm pretty sure there is a way to do it, but I just can't find the option to turn it off! Also tell me which is better; Best Contrast or Best Shapes? (I'm talking about the Gnome font manager GUI)
Regards,

Franklin 01-23-2005 05:01 PM

To turn off antialiasing in Gnome, choose Desktop Prefs - Font.
Then click the details button and choose "None" for both Smoothing and Hinting.
This will automagically turn of the radio buttons on the first page of the font rendering
dialogue box.

Generally, edits made in KDE's Control Panel for font preferences will carry into Gnome -
I "think" they both edit the same /home/<user>/font.conf xml file, but don't hold me to that ;)

You may also want to cd to the /usr/lib directory and run the command:

ls -la libfreetype* to make sure the symlinks are pointing to the new libs.

Mine reads as follows:
Code:

steve@peggyo:~$ cd /usr/lib
steve@peggyo:/usr/lib$ ls -la libfreetype*
-rw-r--r--  1 root root 2431914 2005-01-22 18:35 libfreetype.a
-rwxr-xr-x  1 root root    816 2005-01-22 18:35 libfreetype.la
lrwxrwxrwx  1 root root      20 2005-01-22 18:35 libfreetype.so -> libfreetype.so.6.3.7
lrwxrwxrwx  1 root root      20 2005-01-22 18:35 libfreetype.so.6 -> libfreetype.so.6.3.7
-rwxr-xr-x  1 root root  415008 2004-06-05 17:48 libfreetype.so.6.3.5
-rwxr-xr-x  1 root root 1521734 2005-01-22 18:35 libfreetype.so.6.3.7

As you can see, there is an old lib present, but my symlinks piont to the new lib.

Quote:

I used the recompiled RPM for Fedora Core 3 (cause I don't like to recompile; recompiling has always given me issues). I did not follow your step (B), cause I hate to mess around with the text files myself (I'm a Linux Newbie).
While I understand how you feel, I would strongly suggest you get past this. It's far easier to control your system this way.

HTH

madiyaan 01-23-2005 09:41 PM

I still can't figure it out!
 
Okay, I downloaded and installed the bci-enabled rpm from this website:
http://www.tldp.org/HOWTO/Font-HOWTO/fix.html
When I run this command, I get the following output:

Code:

[madiyaan@r57h63 ~]$ rpm -q freetype
freetype-2.1.9-1.bci
[madiyaan@r57h63 ~]$

When I check my /usr/lib section, I get this:
Code:

[madiyaan@r57h63 lib]$ ls -la libfreetype*
lrwxrwxrwx  1 root root      20 Jan 23 22:05 libfreetype.so.6 -> libfreetype.so.6.3.7
-rwxr-xr-x  1 root root 1236799 Nov 10 22:09 libfreetype.so.6.3.7
[madiyaan@r57h63 lib]$

Seems to me that everything's right. Now I change my gnome options to no hinting and no smoothing and I get very very ugly fonts. As you can see in the screenshot below, I find text EXTREMELY hard to read.

http://www.prism.gatech.edu/~gtg839f...ots/bci_aa.jpg

Can you please help me by telling me what I'm missing?

Franklin 01-23-2005 10:09 PM

As I cannot speak for the whether the RPM is indeed correctly compiled, the only thing I can suggest is that you compile from source as I outlined. Looking at your screenshot, it's clear that the bytecode interpreter is either still disabled, or you are still linking to your old lib from your old RPM which likely is the same release of freetype so you won't see a version number difference.

If you are determined not to compile from source and you trust the RPM (you know for a fact that it has worked as advertised for others), then I would uninstall and hunt down every trace of freetype on the box that might have been left behind and delete them. Then reinstall the RPM before rebooting (Gnome will not boot without freetype installed).

I have used my method with Suse in the past - another RPM based distro - and had success. I have also had trouble with Debian Sid, but have not played with it enough to figure why.

Also, I have found that restarting X may not be enough. Try rebooting and/or running ldconfig as root. Other than that, you'll just have to play around with it. An earlier post indicated that it worked for fedora, so we know it's possible.

Good luck.

madiyaan 01-24-2005 07:54 PM

I think I figured it out...
 
I tinkered a bit with freetype2, but was unable to install it properly with bci enabled*. But I figured the guys at the website I quoted earlier in this thread (the site that had a link to the bci enabled) have no motive of fooling people by placing bci-disabled rpm's there.
http://distributions.linux.com/howto...OWTO/fix.shtml
This site.

So I went ahead and browsed my font preferences, went into details, and disabled smoothing, but ENABLED hinting. After all, bci is a type of hinting, I figured.
Now results are way better (by the way, this particular configuration of hinting enabled and smoothing disabled is the monochrome option in the first font config GUI).
Here's the screenshot:
http://www.prism.gatech.edu/~gtg839f...s/bci_mono.png

I think this is the limit Linux can go to. Tell me if this screenshot is up to mark, if not, I guess I'll keep on trying until I succeed. :-) If possible, can you somehow email me a link to the bci-enabled BINARY rpm file? In other words, can you build one for Fedora Core 3? I have AIM so you can transfer it to me thru' there, or email me at my address.






* You said that when I would do ./configure and make, I would get a bunch of messages. I got messages for about 50 seconds (that's a lot of screenful of messages), and many of them were errors. So I could not rebuild my source into binary.
Then I tried a different method; I downloaded .src.rpm and then a rpm -i freetype2.src.rpm. This caused a bunch of files to be copied to /usr/src/redhat/ directory tree. I went into /usr/src/redhat/SPECS and edited the file freetype2.spec. The first line in that spec file had this:
disable bci 1
I changed it to 0, and did rpmbuild -ba freetype2.spec. I got a lot of error messages (which I think are the same as the ones I got with your other method). And again it said that it cannot build the rpm. So I just gave up!

sys7em 01-27-2005 08:00 AM

Quote:

Originally posted by Idle
I tried what you suggested, including deleting the firefox directory, but nothing works. When I run it from the command line, I get this error:
"/opt/firefox/run-mozilla.sh: line 159: 11701 Segmentation fault "$prog" ${1+"$@"}"

Don't trouble yourself, I'll figure something out. Thanks. :)

This howto rox .... Thanks Franklin ...
I've follwed everything in this howto ..and now the fonts look great ... but ..When I try to start firefox .,..the following error comes out ...

sys7em@mx:~/firefox$ ./firefox
./run-mozilla.sh: line 451: 11260 Segmentation fault "$prog" ${1+"$@"}
sys7em@mx:~/firefox$

The same error as idle's ...does someone know how to fix that .... In other browser (like mozilla ..which I'm using right now) the fonts look great ...and there is no problems at all ... but firefox crashes ...

sys7em

Franklin 01-27-2005 03:11 PM

I think Idle may have solved his problem in another thread in the slackware forum. I have seen in other places where one of the later upgrades in current (glibc ? can't remember) caused a firefox problem as well. One of these was easily fixed by a reinstall of firefox. I use the firefox-installer script from the Mozilla site, but some of the people with issues are using a linuxpackages.net .tgz. I don't know what your situation is, but I have had no issues with firefox at all. Perhaps it the .tgz ?

What many people seem to not realize is that using the slack-10 packages on a current install can cause problems in some packages the farther current gets from the last stable release.

My 2 cents

Franklin 01-27-2005 07:49 PM

Making Open Office display fonts like the rest of your system.

Now that you've gone to all the trouble of making all your fonts look nice without antialiasing, you go and load OpenOffice and IT DOESN'T BEHAVE!!!

This is easy to fix. :D

Open up OpenOffice (duh)
Tools-Options-View
Uncheck the box labled "Screen Font Antialiasing" or set your desired range.

Then,

Tools-Options-Accessability
Make sure the "Use system font for user interface" option IS checked.

Done

:D

sys7em 01-28-2005 03:58 AM

Franklin ..thanks again man ...that really helped ... :)
Now mo OOo fonts look just great :) ..also I've managed to fix my firefox problem ... I had to upgrade all x11 packages to current (My distro is Slack 10) .... then sudden alll fonts went ugly again ...after that I had to do the same thing again (freetype 2 installation ....bla bla ) ...and voala ... No more ugly fonts for me ... thanks to you :)

This HOWTO is really helpful ...

See ya

Franklin 01-28-2005 05:45 AM

Quote:

I had to upgrade all x11 packages to current (My distro is Slack 10) .... then sudden alll fonts went ugly again ...after that I had to do the same thing again
Thanks for bringing that up. I had meant to make mention of that.

Depending on what Distro you use, the freetype libs will be either packaged seperately (as with Dropline-Gnome) or as part of a package (as with slackware stable or current, which packages it in the X11 packages IIRC). I you upgrade freetype, or the package that contains freetype, you will need to reinstall your enabled-freetype.

The good news is that in some (most?) cases you wont need to recompile freetype, just run make_install again from the source directory - provided you had the foresight to save it ;). Another choice is to not upgrade. This is of course much easier to do if freetype is packaged seperately as it is with Dropline.

Luckily, freetype is a rather quick compile.

jferrando 01-29-2005 08:33 PM

Config in Debian / Texting
 
I have successfully configured freetype+bytecode_interpreter it in Mandrake, but in Debian/Sarge I cannot get the bytecode interpreter working, though I see the TTF windows fonts.
It is stange, because OpenOffice displays the fonts perfect, but gnome apps cannot get these shart edges. Any idea?

jferrando 01-30-2005 01:52 PM

Solved in Debian !!!! (spend 10+ hours)
This is the good /etc/fonts/local.conf file. I somehow disabled the comment on the "freetype autohinter module" section, and got very ugly fonts!

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<include ignore_missing="yes">/var/lib/defoma/fontconfig.d/fonts.conf</include>
<!-- Uncomment below to enable bitmapped fonts -->
<!--
<dir>/usr/X11R6/lib/X11/fonts</dir>
-->
<match target="font">
<test qual="all" name="rgba">
<const>unknown</const>
</test>
<edit name="rgba" mode="assign"><const>rgb</const></edit>
</match>
<!-- Uncomment below to enable the freetype autohinter module. If you uncomment it, you will not get freetype bytecode iinterpreted fonts -->
<!--
<match target="font">
<edit name="autohint" mode="assign">
<bool>true</bool>
</edit>
</match>
-->
</fontconfig>

Franklin 01-30-2005 05:25 PM

Cool.

I have Debian Sid at work and had problems when I tried as well, but I have so little time to do anything outside of Windows (at work) that I never had a chance to figure out what was wrong. I know that depending where you download from (US or Non-US) Debian's freetype is either enabled or disabled. I wonder if my file is commented as well. I'll have to check it out tomorrow. I installed from a US site and freetype was disabled by default.

Steve

jimveta 02-02-2005 07:59 AM

First, thanks very much for your efforts and this how to! Do you have an idea of how much frustration this solves for MANY users?? :)

You know, this and the other very few sites mentioned that discuss this issue:
-> http://mysite.verizon.net/vze8992v
-> http://convexhull.com/mandrake_fonts.html
-> http://avi.alkalay.net/linux/docs/font-howto/Font.html (which is quite comprehensive IMHO; except that I personally disagree with the size at which they say AA should be enabled. They say 10pt, for me it's 14 pt)

really really should be a sticky or have a dedicated section in the Wiki :D

I say this because just about every other site/page concerned with fonts, such as the famous FDU howto, all takes the opposite approach--the anti-aliased way. The truetype bytecode interpreter was designed in the first place NOT to be used with anti-aliasing.

In other words, it is the only way so far to produce unaliased renderings from outline/scalable fonts without anti-aliasing. I say "unaliased" because the path or shape of the font onscreen is exactly like how the font--specifically the embedded bytecode program--meant it to be. Simply disabling anti-aliasing for fonts under a certain size, like most of the advice given elsewhere, always produces aliased renderings for the standard *nix configuration without all this extra work.

<RANT>If the following two pics don't make folks hate the eye straining, headache inducing, space wasting AA like I do, then the only reason I can think of is that they must be using pretty large fonts so this whole issue won't matter much, if any, to them anyways.

It's a little ironic that Apple holds the TT bytecode patent because it doesn't seem to be used with OSX (if it is, then it's wasted with anti-aliasing). In fact I've read the blog of a freetype programmer commenting on how bad anti-aliased fonts look on a low res (1024x768) Apple laptop (well, that's another downside to anti-aliasing: it looks even worse with lower resolution as the smoothing/blurring/gradient artifacts become more obvious--you can easily see for yourself at 1024x768 or less)</RANT>
(..sorry about that, had to get it off my chest.. )

KDE control center pics from http://avi.alkalay.net/linux/docs/font-howto/Font.html

anti-aliasing, the "popular" Bitstream Vera:
http://avi.alkalay.net/linux/docs/fo...to/vera8aa.png

anti-anti-aliasing, MS style:
http://avi.alkalay.net/linux/docs/font-howto/kde.png

====================================================

P.S. The other thing I should mention is that the other way to get sharp small fonts is to use bitmap fonts. Type 1 fonts for example, allow for a bitmap part and a outline part (specified in postscript). the bitmap part is meant for screen display and the outline part is meant for printing. Real Adobe fonts like their Helvetica, Times and Courier, and certain MS fonts I believe (like Gothic) have embedded bitmaps.

However if I understand correctly, by default fontconfig will use the outline part for screen display. This is not the case though in Suse (at the professional version). You can get nice sharp--though limited--fonts simply by switching to "Adobe" everything. If not but your /etc/fonts/fonts.conf or /etc/fonts/local.conf already has the necessary code to switch to bitmap for certain fonts, and is simply awaiting the "prefer_bitmap" variable, change in your $HOME/.fonts.conf or /etc/fonts/fonts.conf or /etc/fonts/local.conf :
Code:

  <match target="pattern">
        <edit name="prefer_bitmap">
                <bool>true</bool>
        </edit>
  </match>


Franklin 02-02-2005 08:46 AM

Jimvetta,

After reading your post it occurrs to me that I may need to create a REAL howto page as opposed to this forum thread linking to my screenshot page.

I really had no idea whether or not there was a large enough group of linux users who would prefer this type of font rendering to the antialiased look.

It seems that there is enough interest for me to do so.
It also seems that my method seems to work well enough for a majority of users/distros to make it more of a help than a hinderance.

Steve

Franklin 02-02-2005 08:50 AM

Quote:

Real Adobe fonts like their Helvetica, Times and Courier, and certain MS fonts I believe (like Gothic) have embedded bitmaps.
I have meant to play with this as I have PageMaker on my windows partition and thus have access to some high quality type1 fonts.

Very involved this font business - makes your head hurt at times.

jinacio 02-07-2005 05:10 AM

Quote:

Originally posted by Franklin
Jimvetta,

After reading your post it occurrs to me that I may need to create a REAL howto page as opposed to this forum thread linking to my screenshot page.

I really had no idea whether or not there was a large enough group of linux users who would prefer this type of font rendering to the antialiased look.

It seems that there is enough interest for me to do so.
It also seems that my method seems to work well enough for a majority of users/distros to make it more of a help than a hinderance.

Steve


I hope you have the time to do a nice one :)

... i'm getting very tired of the fonts in mozilla (specially the big & thick 'bold' ones :o)


Cheers,
Joao Inacio

sys7em 02-09-2005 07:39 AM

Hey Franklin,

How's it goin' with the HOWTO thing ... I hope you write a nice one ...because I'm looking for such HOWTO for a long time .... And at last I have nice fonts in my browsers ...anyway ...I would really like to see this HOWTO done ... and also if I can help about something ...contact me via e-mail or icq ....


cheers mate :)

KimVette 02-09-2005 08:33 AM

fwiw you can solve font size/DPI issues by configuring your DisplaySize correctly. Either look up the specs for your monitor or simply measure the X and Y size in mm, and put it in your XF86Config file like so:

Code:

Section "Monitor"
  Option      "CalcAlgorithm" "CheckDesktopGeometry"
  DisplaySize  410 308
  HorizSync    31-112
  Identifier  "Monitor[0]"
  ModelName    "1920X1440@75HZ"
  Option      "DPMS"
  VendorName  "--> VESA"
  VertRefresh  50-75
  UseModes    "Modes[0]"
EndSection

Not only will this make typefaces/fonts display in a reasonable scale on the screen, but WYSIWYG will really be WYSIWYG in layout and word processing programs. :)

Tuvok 02-09-2005 03:38 PM

This was quite very useful. Thanks.

Screenshot

jinacio 02-11-2005 11:17 AM

Still no luck :'(

- I've compiled and installed freetype (checked the files in /usr/lib)
- Set dpi to 96 in gnome (also DisplaySize in xorg.conf)
- Tried different fonts / font sizes (8/9 , i'm using 1024x768)
- modified fonts config.

fonts look really ugly with no aa, and they look a bit better with hintint...

am i missing something important here?

any help is apreciated.

btw: i'm using ubuntu (hoary)

Cheers,
Joao Inacio

Franklin 02-11-2005 12:36 PM

Regretfully, jinacio, I am unable to tell you what you may have done wrong or if indeed you did do anything wrong at all.

I don't use Ubuntu, but IIRC this is a Debian-based distro based on Gnome. I have tried Debian briefly and found that I had difficulty getting it to behave regarding this procedure. I did not spend enough time with it to figure out why and quickly returned to slackware. Perhaps your difficulties with Ubuntu are related to the issues I had with Debian. Someone got it to work though, so there is hope.

Distro specific issues asside, the main reasons for freetype2 recompiling NOT working are:

1. You did not uncomment the line in the config file related to the bytecode interpreter prior to compiling.

2. Your compile failed and you did not realize it and you actually did not install anything.

3. The --prefix=/usr was used when it should not have been or vice-versa and your old libs were not overwritten.

4. The simlinks are still pointing to the old libs.

5. Any number of other issues ;)

This is and will continue to be an issue in linux. Different distros put things in different places. This makes a single process working across all platforms as much finger-crossing as anything. I can only say for certain what worked for me. My best advice to you is to keep trying - you'll learn alot in the process. And, if you DO get it to work, post how you did it - that is what the linux community is all about.

I was as specific as I could be in my initial directions. There is nothing else I can really add. Re-read my directions and double check what you did. The size/resolution stuff is really window dressing. If the fonts are ugly still, you are having a problem with freetype2. That is where I would concentrate my efforts.

Another thing about Debian and possibly Debian based distros such as Ubutu -

I have heard that if you use an apt repository that is NON-US when you install, then you will get a freetype deb package installed that is allready compiled with the bytecode interpreter enabled. This is my understanding. I am sure someone will correct me if I am wrong. ;)

Good luck.

jinacio 02-11-2005 01:38 PM

Thanks

i got freetype compiled after a couple tries (heh, forgot the prefix at first :/), checked the links and they point to the new one one...

still, i will keep trying and experimenting (don't have much time with my linux box ATM :( ) and if i have any (more?) positive results i'll post here.

who knows, maybe i missed something simple...


Cheers,
Joao Inacio

Franklin 02-12-2005 02:33 PM

Being home sick (again) today and evidently being a glutton for punishment, I decided to give Ubuntu a try.

The procedure I laid out works fine with a couple of additions/changes that might be of importance.

1. The initial install does not come with g++ or gcc, so:

apt-get install g++
apt-get install gcc

2. Create a directory for the new fonts:

mkdir /usr/local/share/fonts/TTF

3. Copy truetype fonts to the new directory.

4. Run fc-cache

5. Create a path to the fonts in /etc/X11/XF86Config-4

Code:

Section "Files"
        #FontPath        "unix/:7100"                        # local font server    <------LOOK
        # if the local font server has problems, we can fall back on these
        FontPath        "/usr/lib/X11/fonts/misc"
        FontPath        "/usr/lib/X11/fonts/cyrillic"
        FontPath        "/usr/local/share/fonts/TTF"                <-------LOOK
        FontPath        "/usr/lib/X11/fonts/100dpi/:unscaled"
        FontPath        "/usr/lib/X11/fonts/75dpi/:unscaled"
        FontPath        "/usr/lib/X11/fonts/Type1"
        FontPath        "/usr/lib/X11/fonts/CID"
        FontPath        "/usr/lib/X11/fonts/Speedo"
        FontPath        "/usr/lib/X11/fonts/100dpi"
        FontPath        "/usr/lib/X11/fonts/75dpi"
       
        # paths to defoma fonts
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Note that I commented out the line that referrences the local font server. It wasn't loading correctly anyway.

6. Compile freetype-2.1.9 with the bytecode interpreter enabled

./configure --prefix=/usr
make
make install (I loaded a root console here rather than using sudo)

7. Run ldconfig (probably not needed since I rebooted after all this anyway - but good practice)

7a. Check symlinks:
Code:

test2@peggyo:~ $ cd /usr/lib
test2@peggyo:/usr/lib $ ls -la libfreetype*
-rw-r--r--    1 root    root      2465242 2005-02-12 14:05 libfreetype.a
-rwxr-xr-x    1 root    root          812 2005-02-12 14:05 libfreetype.la
lrwxrwxrwx    1 root    root          20 2005-02-12 14:05 libfreetype.so -> libfreetype.so.6.3.7
lrwxrwxrwx    1 root    root          20 2005-02-12 14:05 libfreetype.so.6 -> libfreetype.so.6.3.7
-rw-r--r--    1 root    root      430824 2004-08-12 20:48 libfreetype.so.6.3.5
-rwxr-xr-x    1 root    root      1549131 2005-02-12 14:05 libfreetype.so.6.3.7
test2@peggyo:/usr/lib $

8. Reboot

9. Desktop Preferences - Fonts
Font Rendering = Monochrome
Smoothing = None
Hinting = Full

10. Replace Sans Font with Arial, Verdana, or Tahoma as the Application and Desktop font. I used Verdana at 8 point. Of course you can do what you want here.


Thats it I think.
This should work with Debian too.

Good luck and have fun!

jinacio 02-13-2005 02:37 PM

i think i see a problem :)

don't think i disabled the local font server ("unix/:7100")...

as soon as i have a chance i'll try it out... if not i think i'll guive up for now (checked everything else at least twice...)

Anyway, thanks a lot for your help!


update:
that, and deleting a bad ~/.fonts.conf seemed to do the trick :D

all i need to do now is play arround with different font settings to make everything look great
(ff fonts still look a bit square).

Cheers,
João Inácio


BTW: how's that HOWTO comming up? ;)

newinlinux 02-25-2005 10:35 AM

Hi all,
Need your advise on how to resolve this error during ./configure

root@slackbox:/home/brian/freetype-2.1.9# ./configure --prefix=/usr
cd builds/unix; ./configure --prefix=/usr
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make: *** [builds/unix/unix-def.mk] Error 1

Anyone knows how can i solve this issue? I checked, cpp is part of gcc, i have that instaled, and I have made my own kernel(2.6.10).

I did a full installed from Slackware 10.1.

Advance thanks.

Franklin 02-25-2005 11:59 AM

Read to the bottom of this thread:

http://www.linuxquestions.org/questi...hreadid=288348

lacerto 03-01-2005 07:02 AM

Yet another happy customer here. Thanks.
L


All times are GMT -5. The time now is 03:30 PM.