FreeBSD add font method

  

In the FreeBSD system operation, due to personal needs, the system comes with enough fonts, to add some fonts, what should I do if I encounter this problem? The following small series teaches you how to install fonts for the FreeBSD system. Let's learn together.

So, we need to manually add font, can be used in two ways:

1, add a Times Roman, Helvetica, Palatino and other Type1 fonts

URW fonts The collection (x11-fonts/urwfonts) includes high quality standard type1 fonts. So install URW:

1.1 Install URW

# cd /usr/ports/x11-fonts/urwfonts

# make install clean

1.2 Configuring URW

You need to add the following configuration to the X server's configuration file (/etc/X11/xorg.conf):

FontPath “/usr/local/lib/X11/fonts /URW/”

It can also be executed in the current session by command. The following content needs to be executed on the X desktop.

% xset fp+ /usr/local/lib/X11/fonts/URW

% xset fp rehash

2, install Microsoft Yahei, Song and other Chinese fonts TrueType® Fonts

Xorg has built-in support for TrueType® fonts

2.1 Configuration Files

Add the following line to the /etc/X11/xorg.conf file "Module" section

Load “freetype”

2.2 Creating a directory for TrueType® fonts

For example, /usr/local/lib/X11/fonts/TrueType, then copy all TrueType® fonts to this directory. Remember that you cannot extract TrueType® fonts directly from your Macintosh® computer; you must be able to use X11 in UNIX®/MS-DOS®/Windows® format.

2.3 Use ttmkfdir to create the fonts.dir file so that the X font engine knows that you have installed these new files.

2.3.1 ttmkfdir needs to be installed, can be installed directly with pkg_add -r ttmkfdir.

2.3.2

# cd /usr/local/lib/X11/fonts/TrueType

# ttmkfdir -o fonts.dir

2.4 Add the TrueType® font directory to the font path

You need to add the following configuration to the X server's configuration file (/etc/X11/xorg.conf):

FontPath “/usr/Local/lib/X11/fonts/TrueType”

If you want to enable it now, please enter: (The following commands need to be executed in the X desktop's Terminal)

% xset fp+ /usr/local /lib/X11/fonts/TrueType

% xset fp rehash

That's it. Now Netscape®, Gimp, StarOffice™ and all other X applications should recognize the installed TrueType® fonts. Some small fonts (such as high-resolution text on a Web page) and some large fonts (under StarOffice™) now look good.

3, install Wenquan 驿 Chinese font:

# whereis wqy

wqy: /usr/ports/x11-fonts/wqy

# cd /usr/ports/x11-fonts/wqy

# make install clean

15 minutes or so ok

Let the X system load the font when it starts.

Edit /etc/X11/xorg.conf

Add a line in Section “Files”FontPath “/usr/local/lib/X11/fonts/wqy”

Section “Files”

ModulePath “/usr/local/lib/xorg/modules”

FontPath “/usr/local/lib/X11/fonts /misc/”

FontPath “/usr/local/lib/X11/fonts/TTF/”

FontPath “/usr/local/lib/X11/fonts/OTF&rdquo ;

FontPath “/usr/local/lib/X11/fonts/Type1/”

FontPath “/usr/local/lib/X11/fonts/100dpi/”< Br>

FontPath “/usr/local/lib/X11/fonts/75dpi/”

FontPath “/usr/local/lib/X11/fonts/wqy”

EndSection

The above is the introduction of FreeBSD fonts. This article details the installation methods of various fonts to meet your basic needs. Other fonts are added in a similar way.

Copyright © Windows knowledge All Rights Reserved