1. Trang chủ
  2. » Công Nghệ Thông Tin

Professional Information Technology-Programming Book part 130 pot

6 72 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 6
Dung lượng 32,71 KB

Nội dung

The first thing you're going to need are more fonts, and as a general rule, the more proprietary they are, the better they will look. Specifically, you want fonts from Microsoft and Adobe, and they're in the following directories:  /usr/ports/x11/msttcorefonts  /usr/ports/print/ghostscript It might be helpful to install these font packages as well, though they aren't necessary to achieve optimal font rendering quality:  /usr/ports/x11/freefonts  /usr/ports/x11/artwiz-aleczapka If you have any additional fonts that you transferred from another operating system (font files are generally interchangeable between OSes), transfer them to the /usr/X11R6/lib/X11/fonts/misc directory (or create your own directory in /usr/X11R6/lib/X11/fonts for those files if you wish, but make sure you add it to the configuration file below). Now you need to make sure that X.org is configured to use these new fonts. Edit the /etc/X11/xorg.conf from a root terminal, and then add the following lines to the "Section Files" section: FontPath "/usr/local/lib/X11/fonts/freefont/" FontPath "/usr/local/lib/X11/fonts/artwiz-aleczapka/" FontPath "/usr/local/lib/X11/fonts/mscorefonts/" FontPath "/usr/local/lib/X11/fonts/ghostscript/" Save the file, but don't restart the X server just yet; there are a few more things that have to be done to fully enable antialiasing. Now you have to tell Xft about those same font directories, so edit the /etc/X11/fs/config file and find the line that starts with catalogue =. Note that this file may be read-only by default. If it is, run this command prior to editing the file: chmod +w /etc/X11/fs/config Once inside the file, you should see some font directories there similar to (but not the same as) the ones listed above. Add your new font directories to the catalogue line, separated by commas. You should end up with something similar to this (new entries are shown in bold): catalogue = /usr/X11R6/lib/X11/fonts/misc/,/usr/local/lib/X11/fonts/freefont/, /usr/local/lib/X11/fonts/artwiz-aleczapka/,/usr/local/lib/X11/fonts/mscorefonts/, /usr/local/lib/X11/fonts/ghostscript/,/usr/X11R6/lib/X11/fonts/TTF/,/usr/X11R6/lib /X1 1/fonts/Type1/,/usr/X11R6/lib/X11/fonts/CID/,/usr/X11R6/lib/X11/fonts/75dpi/, /usr/X11R6/lib/X11/fonts/100dpi/ Next, use your preferred text editor to create the /etc/fonts/local.conf file and put this into it: <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "/etc/fonts/fonts.dtd"> <fontconfig> <dir>/usr/local/lib/X11/fonts/freefont/</dir> <dir>/usr/local/lib/X11/fonts/artwiz-aleczapka/</dir> <dir>/usr/local/lib/X11/fonts/mscorefonts/</dir> <dir>/usr/local/lib/X11/fonts/ghostscript/</dir> </fontconfig> The above configuration will register the new font directories with the fontconfig program. The "real" configuration file is /etc/fonts/fonts.conf, but it has an include statement for local.conf, so your changes will be properly recognized. In general it's a good idea to follow this practice (modifying local configuration files rather than the master ones) for as many system configuration files as you can with OpenBSD because the master files tend to be overwritten when you upgrade OpenBSD or certain subsystems. Finally, you need to initialize all of your new font directories with fontconfig. To do so, first switch to each new directory: cd /usr/local/lib/X11/fonts/freefont Then run these commands: mkfontscale && mkfontdir Repeat the above for each font directory you installed: /usr/local/lib/X11/fonts/artwiz-aleczapka /usr/local/lib/X11/fonts/mscorefonts /usr/local/lib/X11/fonts/ghostscript Do you use any programs that require the Qt graphics toolkit (KDE depends on Qt)? If soor if you're not surerun this command from a terminal: qtconfig If nothing happens when you run that, then you don't have Qt installed and don't need to worry about changing settings. If the qtconfig window comes up, look over its settings and change them to your preferences. Of particular interest should be the Fonts and Appearances tabs. Make sure you select a default font that is antialiased (I suggest Times New Roman at a size of 12pt). In the GUI Style drop- down box in the Appearances tab, select either Platinum or Windows for smoother edges in your window elements. Go to the File menu and select Exit when you're done. Do you use any programs that require the GTK+ graphics toolkit? If soor if you're not sureedit your user's ~/.profile configuration file and add this line to it: export GDK_USE_XFT=1 Now it's time to kill the X server and then log out (type exit and press Enter to log out, or if you've started from XDM, GDM, or KDM, press Ctrl-Alt-Backspace to restart the X server). When you log back in again, you should have much more attractive fonts than before. 6.5.1. Troubleshooting If you've followed the directions and your fonts still look jagged, run this command from a terminal: /usr/X11R6/bin/xdpyinfo If you don't see the word RENDER in the list of extensions, your video card driver doesn't support the technology necessary to render antialiased fonts. This should be a relatively rare situation. If you see a little improvement in some applications but no change in others, you're likely experiencing configuration problems with GNOME, KDE, or the individual programs that you're using. The Opera Web browser, for instance, has its own font settings. GNOME and KDE both have font antialiasing settings for GTK- and Qt- based programs, respectively. Firefox also has its own antialiasing settings that you can adjust through the about:config page. Fine-tuning these programs is an issue specific to each of them individually, not to OpenBSD or its implementation of X.org. Linux and FreeBSD binaries may need some special attention when it comes to fonts because they actually have their own X11 directories in /emul. This is generally a problem only for people upgrading from OpenBSD 3.9, who may have more than one version of their emulation environment. Chapter 7. Server Installation and Service Configuration OpenBSD comes with some services available through the base system, and many others available through Ports or packages. Special notes concerning each kind of server are detailed below. Remember that this guide is only here to familiarize you with these services as they apply to OpenBSD; actually configuring, running, and managing the services is well beyond the scope of this Short Cut. It goes without saying that security is the primary focus of outward-facing servers. Even on OpenBSD, you will want to remove (or simply not install) unnecessary components, disable unused services, and disconnect unused devices. 7.1. The inetd Internet Super-Server All Internet and local network services on OpenBSD can be started manually from the command line, or you can add a line to /etc/rc.local to start them at boot time. Some already have default entries in rc.conf, and others can have their own configuration lines in rc.conf.local. There is nothing inherently wrong with starting each daemon individually and letting it do its own thing quietly in the background. There could be a performance advantage to using the inetd Internet super-server, however. This program acts as a sort of router, monitoring incoming network requests and directing them to the proper services. Be careful that you don't try to use more than one method to start services at boot time, or else you could run into strange problems. inetd is itself started through /etc/rc.conf, and it's configured through /etc/inetd.conf. Each inetd entry must be listed as a service in /etc/services and use a protocol listed in /etc/protocols. If your server is not doing well under heavy network loads, you may want to experiment with using inetd to start and manage some or all of your services. For the most part, the rest of this guide will cover only the rc.conf and rc.local methods of starting services, as they are the easiest and probably most oft-used methods to start the servers outlined below. That doesn't mean that you should totally ignore inetd, though. At the very least, you may want to look through /etc/inetd.conf to make sure that it isn't running any unnecessary services. If you're configuring OpenBSD as some kind of specialized network server, inetd is almost certainly running services that you can and should disable. 7.2. Apache Apache 1.3.29 is installed by default as part of the OpenBSD 4.0 base system and includes many extra patches to enhance its performance and security. Apache 2 cannot be included with OpenBSD because of some unacceptable terms in version 2 of the Apache software license. Because of this limitation, the OpenBSD Project has concentrated on doing more with Apache 1.3, to the point that it is almost a different web server in its own right. However, some people may have a specific need for Apache 2 because of the requirements of other software. Those people can download the Apache 2 source code from the Apache web site and compile it on OpenBSD without any extra concern. The OpenBSD-modified Apache 1.3 comes with the following modules installed by default:  mod_cern_meta  mod_info  mod_rewrite  mod_auth_anon  mod_define . If the qtconfig window comes up, look over its settings and change them to your preferences. Of particular interest should be the Fonts and Appearances tabs. Make sure you select a default font. to experiment with using inetd to start and manage some or all of your services. For the most part, the rest of this guide will cover only the rc.conf and rc.local methods of starting services,. services that you can and should disable. 7.2. Apache Apache 1.3.29 is installed by default as part of the OpenBSD 4.0 base system and includes many extra patches to enhance its performance

Ngày đăng: 07/07/2014, 03:20