Optimizing Your Desktop for DTP § Document Index § Useful Links
Updated 12:07:2003
Notes on Running Scribus under Red Hat 8.0/9
As the documenter for Scribus, we have received a few questions from users who have had some minor issues with Scribus 0.8+ running with Red Hat 8.0/9. Thus, I have put together some hints and comments to ensure Scribus runs as well as possible with RH 8.0/9. This is a bit long, but hopefully, will help end-users have a sense of not only how, but why things are as they exist currently. Users of Mandrake 9.0 and 9.1 may find this sometimes relevant as they have some commonality with Red Hat.
Overall, Scribus runs great with the RH 8.0/9. I have been a long time Red Hat/ KDE user since Scribus 0.3.7 or so. While Red Hat is a Gnome oriented distro and their KDE packages have occasionally been less than optimal, I appreciate the following:
- Well tested and configured kernels and other internals. Testing other distros, I have found many times a Red Hat package would work, where it would crash or have problems on other distros. Moreover, for my clients who run Linux servers, it is an outstanding package. Very reliable, excellent QA, superior docs and excellent support for security issues.
- A principled stance regarding Open Source applications and making not only the source, but down-loadable ISO's available. Redhat has caught a lot criticism about not including package A or B or not adding closed source drivers, but they have honored their stated principals and you have to respect that.
- They have contributed a lot to the open source community: cygwin, rpm, code and lots of developer time to libc, gcc and binutils to name a few.
- They pay kernel hacker Alan Cox's salary.
That said, their release of 8.0 generated a lot of discussion and controversy, as it is their own first attempt at a "user-friendly" Linux Desktop. Overall, I think they have succeeded and RH 9 builds upon on 8.0. I would quibble with some of their choices, but I can see a sincere, serious effort to move forward. Minor grumbles in order of aggravation: a buggy version of RPM (largely fixed in 9, no kpackage - the best rpm manager of all, removal of many KDE features in favor of Redhat Python based config tools which in some cases are woefully inferior, but third party solutions do exist.
Where it concerns Scribus, most of the problems relate to a completely revised set of libraries and configuration for fonts in XFree86, which has always been a weakness for Linux - probably one of the toughest to solve. More below.
The good stuff in RH 8.0/9 which is great for Scribus:
- GCC-3.2 This is a revised C++ GNU compiler. This is responsible for sometimes 20-40% improvement in Scribus performance, especially with handling large image files. The improved code also has made Scribus even more stable. A lot of work has been contributed by Paul Johnson to clean up Scribus code to make it more conformant to GCC 3.2 and 3.3, as well.
- Ghostscript 7.05 and the latest CUPS 1.17 with GIMP print drivers right out of the box. Thus, there is a Level 3 postscript interpreter and CMYK printing support standard. This combination also generates much better PDF's. This is a big improvement from Ghostscript 6.x and the older Lprng spooler in RH 7.x.
- The other new goody in RH 8.0 is the new scheduler which makes the desktop applications run much snappier.
- The KDE printer setup with CUPS is actually easier than Windows 2000 for setting up a postscript printer. Exactly, ninety seconds after opening the Kprinter control panel, I had a test print spooling out of the printer. CUPS is the default in RH 9 - finally.
Recommendations:
- Make sure the correct kernel and corresponding libc is installed for Athlon CPU's. I have seen in 7.3 and RH 8.0 where a i686 kernel is sometimes installed initially instead of the Athlon kernel. I think this is the default, but you can, after installation, install the Athlon kernel and libc.
- Set the corresponding
CXXFLAGS=-march=""
correctly, when compiling Scribus. Examples -march= could be: athlon, athlon-xp, PIII or PIV. You set this by doing the following before running the configure script:export CXXFLAGS="-march=athlon"
Look inman gcc
for the details. There are several different options just for AMD chips. More than most applications, Scribus, by its nature takes advantage of the new compiler advances, especially in handling floating point math.- Scribus with freetpe2 handles Unicode or UTF-8 locales, which is the default in 8.0/9. You need to ensure freetype2-devel is installed before compiling Scribus.
- There is a small bug with some fonts not displaying the actual font faces properly. This usually occurs with fonts from the default ghostscript font package included with RH 8 and 9. They will print properly, they just do not show all the variations in the menus. I have found two fixes which may or may not work. One is to use the Kfontinstaller with 3.1.2 to recreate the .afm files as root. The other is to go to the Type 1 directories and manually recreate the fonts.dir and fonts.scale files as root
mkfontdir
. Note Kfontinstaller is disabled in standard KDE packages from Red Hat, but are enabled in the kde-redhat sourceforge project or from the KDE 3.1.2 packages from the fedora project.- KDE-Redhat on Sourceforge is a repackaging and updating of KDE 3.1.2. for both RH 7.3, 8.0, 9, which is more faithful to the original KDE sources, than the heavily patched RH versions. For those who plan to use Scribus more than casually, I recommend these if you do not want to compile Qt and KDE from source. These packages are also available from the fedora project
I can say, after letting my machine compile KDE 3.1.2 and QT 3.1.2 from scratch for 14+ hours, this is a *much* less painful way to get KDE 3.1.2 on RH 8.0. I installed the whole set including the development libraries and mosfet's Liquid Theme for KDE 3.1.2. I am *very* pleased with the quality and the very clean installation.Font Handling in Red Hat 8.0/9
The new fontconfig or what Xft2 means for end users - a brief explanation.
Starting in Redhat 8.0 is a completely new method of handling fonts, now standard in Xfree86 4.3; Keith Packard's fontconfig libraries, aka Xft2. They are a set of extensions to Xfree86 to enable a vastly simpler way of handling installation, user selection and much needed simplification to handling Unicode fonts for Japanese, Chinese, Korean and right to left languages. Lastly, fontconfig also works with the freetype libraries to render them with the best screen quality possible - via anti-aliasing, auto-hinting and other tricks, This is a major work and improvement for Xfree86. Everyone in the open source community should be very thankful for this work.
The difficulty is the programming interface is somewhat different from the Xft1 setup. For developers this may require a substantial amount recoding to take advantage of Xft2. For an application like Scribus, this is doubly difficult, as Scribus, has lots of code to really, really, really discover what fonts are installed, as well as know their true postscript names. Even True Type fonts have a postscript name embedded. Unlike other programs that just want a serifed font like Times, Scribus needs to distinguish between Times and Times New Roman, as well as know the weight variations like bold, italic, demi and roman faces.
To add to the difficulty, by its design, Xft2 uses a parsing method which can produce substitutions when a application requests a font. The new system works well, but for designers, they need 100% certainty they get the exact fonts they selected. Lastly, the defaults Red Hat has used to draw the fonts on screen is defaulted to make the currently available fonts in Xfree86 look good when anti-aliased, sometimes to the detriment of end-user added fonts. Among the major applications or libraries which fully support Xft2 is Gnome 2.x+, special builds of Mozilla and the Red Hat packaging of KDE. Others like Open Office will require substantial recoding to support Xft2.
How it is supposed to work:
The mechanism is quite simple. Create a directory at the root of your home directory called .fonts. Drop your favorite (typically) True Type fonts and magically fontconfig will pick up in a short while that you have added new fonts and make them available to applications. This is configured by a file in /etc/fonts/ fonts.conf. This file which is written in XML, is well commented and shows the substitution pattern defaults.Until, more end-user docs are written I would resist the temptation to tweak.
The Luxi Fonts
Redhat has chosen (wisely) to use the Luxi fonts as default with anti-aliasing enabled. The Luxi fonts were contributed to Xfree by Bigelow and Holmes - and they are an example of what Xfree86 lacks - a wide selection of well designed fonts with good Unicode coverage of not just Western European glyphs or characters. Most of the other fonts which are in Xfree86 have come from various sources over the years. For example, some of the fonts included Redhat are not the most optimal screen fonts, but typically are excellent printer fonts. Utopia is in my experience the most reliable in creating PDF's and for high end postscript. I is also a very readable text font when printed. Some good news: You can download the new Bitstream Vera Fonts This an excellent font family of sans and sans-serif fonts generously donated to Gnome by Bitstream. In my opinion, the Vera Serif is one of the most readable serifed fonts for a screen. Period.
Hints and Options?
So, after all that under the hood stuff, what do I need to do make sure: a. Scribus can find my newly fonts b. go from here or why the fonts (sometimes) do not look good in Scribus?
- Install freetype2-devel and compile the latest version of Scribus . This greatly improves the way fonts are displayed in Scribus at all levels of magnifcation and supports Unicode fonts.
- I want anti-aliased fonts in Scribus. Install freetype2-devel as above, then follow Choice One, but add the web fonts, per the instructions below.
- I want Scribus to find my newly installed fonts from source X. Use the same methods, per the methods below.
- I do not like anti-aliased fonts, they give me a headache. Install freetype2-devel as above, then follow Choice Two.
Choice One: Do nothing. Keep the default Xft2 setup as is. This does improve the overall look of Scribus and fonts display well at 100% on the canvas. The downside is text redraws are *much* slower and viewing a text at any other resolution than 100% is not going to look attractive. The biggest challenge is problems with font substutions, caused by conflicts in the font discovery mechanism Scribus uses and the substitutions made by Xft2. This is not a "bug", per-se, but will be sorted out in time, as we learn the nuances of Xft2 and as Xft2 gets refined. On the other hand, I do not see any stability issues or crashes with Xft2 in either KDE or Scribus - nor with the other DTP apps I use regularly.
Choice Two: Set KDE and QT applications back to the Xft1 style configuration.
This requires a bit of tweaking a la RH 7.3, so Xfree86 is setup in order that fonts are not anti-aliased and are the first available fonts in Xfree86 search path. Disclaimer: As a personal preference, I do not like anti-aliasing screen fonts for three reasons and have not since they were available with Adobe Type Manager on Windows 3.0: 1) There is a substantial performance hit. 2) I find them difficult to read after a time - and as you can guess I spend a lot of time in front of a computer. 3) Good screen fonts (ideally) should not need to be anti-aliased to look good. A good start is to download the MS web fonts,as they are known. This is a group of well designed and tested fonts,which have special hinting and sometimes embedded bitmaps, so they display well at all sizes. Moreover, when they are embedded in PDF's, you have a reasonably good chance they will display well on other platforms, as they are almost always on a Win32 workstation and a good number of Macs. One of the issues with PDF's created in *nix applications like Latex is when they are opened on Win32 or a Mac, typically Adobe Acrobat Reader will do some sort of aliasing with the Multi-Master fonts and the text renders poorly. That is one reason is why Scribus created PDF's look good anywhere - when you embed the fonts. This prevents Acro Reader from making - sometimes - poor substitutions.
True Type and Type 1 Font Installation Tips:
- Get the web fonts from http://corefonts.sourceforge.net/ BUT put the fonts in /usr/share/fonts/default/TTF. I like to keep my fonts paths as simple as possible.
- Follow the advice from http://www.graemepyle.com/linuxfonts.html
- Important make sure the font names are in lower case.
- After the fonts are installed, make sure you have the Xfree86-utils package. This contains ttmkfondir, Then as root, create a fonts.scale file, cd into the directory by the command:
ttmkfdir -o fonts.scale
for a directory of True Type fonts or for Type 1 fonts create the fonts.scale file using:mkfontscale
Then: as root:
fc-cache --force --verbose
This will create new a fonts.dir and update the font cache. This replaces the mkfontdir command in Xfree 4.2- Disable anti-aliasing in KDE/QT from the console:
$ qtconfig
and disable anti-aliasing in the fonts tab. This will disable this for both Scribus and KDE.- Edit (as root) /etc/X11/fs/config so that /usr/share/fonts/default/TTF is the first directory as per below:
# where to look for fonts # catalogue = /usr/share/fonts/default/TTF, /usr/share/fonts/default/Type1, /usr/lib/openoffice/share/fonts/truetype, /usr/X11R6/lib/X11/fonts/misc:unscaled, /usr/X11R6/lib/X11/fonts/75dpi:unscaled, /usr/X11R6/lib/X11/fonts/100dpi:unscaled, /usr/X11R6/lib/X11/fonts/misc, /usr/X11R6/lib/X11/fonts/TTF, /usr/X11R6/lib/X11/fonts/Type1, /usr/X11R6/lib/X11/fonts/Speedo, /usr/X11R6/lib/X11/fonts/cyrillic,
- Open
\usr\bin\startkde
in kedit (as root) or your favorite text editor. startkde is not a program, but a long script which launches KDE. Scroll down to about line 160, where you see the lines and comment out with the # sign about KDE adding fonts and resetting the font paths, as well as the font path Ghostscript uses for loading fonts. With the new fontconfig system, this is unnecessary, as QT 3.0.5 in RH 8.0 supports fontconfig. There are a few programs which not only load their own font paths, but reset the font path every time they load. KDE, Star Office, Open Office and Abiword come to mind.- Reboot (simple) or as root:
/sbin/service xfs reload
and restart KDE.You now will have good sharp screen fonts enabled (which also print well) and KDE will see them without having to KDE mess with the font path. By setting good defaults for the font path, the old style Xft1 system, for which Scribus has been optimized will always have a selection of good, readable screen fonts. They are in my experience, the best displaying fonts in Scribus. Plus, you avoid unintended font substitutions from Xft2, which can cause problems for Scribus.
Taking these steps has: 1) Speedier screen redraws 2) Avoided font path "merry-go-round" 3) Ensured that my preferred fonts are always available to all applications. 4) Improved the rendering of text within Scribus.
Lastly, avoid shareware or free fonts on the web. Some, but not all of these are not well engineered internally. Freeware fonts often have problems printing or displaying at all sizes. It is really difficult to create reliable high quality fonts. Reportedly, the designer who was commissioned by MS to design Verdana took almost one year for one font..
Relevant pages for more info on fonts and Scribus: Optimizing Linux for DTP and Linux DTP Links and the fontconfig home page: http://fontconfig.org
References: The draft version of Xfree86 4.3 documentation at http://www.pps.jussieu.fr/~jch/software/fonts-doc/fonts.html
Added 22:01:2003
Second Revision 12:07:2003
Optimizing Your Desktop for DTP § Document Index § Useful Links