特殊:Badtitle/NS100:FontInstallHowto
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/FontInstallHowto }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/af | • {{#if: UbuntuHelp:FontInstallHowto|Afrikaans| [[::FontInstallHowto/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ar | • {{#if: UbuntuHelp:FontInstallHowto|العربية| [[::FontInstallHowto/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/az | • {{#if: UbuntuHelp:FontInstallHowto|azərbaycanca| [[::FontInstallHowto/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/bcc | • {{#if: UbuntuHelp:FontInstallHowto|جهلسری بلوچی| [[::FontInstallHowto/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/bg | • {{#if: UbuntuHelp:FontInstallHowto|български| [[::FontInstallHowto/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/br | • {{#if: UbuntuHelp:FontInstallHowto|brezhoneg| [[::FontInstallHowto/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ca | • {{#if: UbuntuHelp:FontInstallHowto|català| [[::FontInstallHowto/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/cs | • {{#if: UbuntuHelp:FontInstallHowto|čeština| [[::FontInstallHowto/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/de | • {{#if: UbuntuHelp:FontInstallHowto|Deutsch| [[::FontInstallHowto/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/el | • {{#if: UbuntuHelp:FontInstallHowto|Ελληνικά| [[::FontInstallHowto/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/es | • {{#if: UbuntuHelp:FontInstallHowto|español| [[::FontInstallHowto/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/fa | • {{#if: UbuntuHelp:FontInstallHowto|فارسی| [[::FontInstallHowto/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/fi | • {{#if: UbuntuHelp:FontInstallHowto|suomi| [[::FontInstallHowto/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/fr | • {{#if: UbuntuHelp:FontInstallHowto|français| [[::FontInstallHowto/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/gu | • {{#if: UbuntuHelp:FontInstallHowto|ગુજરાતી| [[::FontInstallHowto/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/he | • {{#if: UbuntuHelp:FontInstallHowto|עברית| [[::FontInstallHowto/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/hu | • {{#if: UbuntuHelp:FontInstallHowto|magyar| [[::FontInstallHowto/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/id | • {{#if: UbuntuHelp:FontInstallHowto|Bahasa Indonesia| [[::FontInstallHowto/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/it | • {{#if: UbuntuHelp:FontInstallHowto|italiano| [[::FontInstallHowto/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ja | • {{#if: UbuntuHelp:FontInstallHowto|日本語| [[::FontInstallHowto/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ko | • {{#if: UbuntuHelp:FontInstallHowto|한국어| [[::FontInstallHowto/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ksh | • {{#if: UbuntuHelp:FontInstallHowto|Ripoarisch| [[::FontInstallHowto/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/mr | • {{#if: UbuntuHelp:FontInstallHowto|मराठी| [[::FontInstallHowto/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ms | • {{#if: UbuntuHelp:FontInstallHowto|Bahasa Melayu| [[::FontInstallHowto/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/nl | • {{#if: UbuntuHelp:FontInstallHowto|Nederlands| [[::FontInstallHowto/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/no | • {{#if: UbuntuHelp:FontInstallHowto|norsk| [[::FontInstallHowto/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/oc | • {{#if: UbuntuHelp:FontInstallHowto|occitan| [[::FontInstallHowto/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/pl | • {{#if: UbuntuHelp:FontInstallHowto|polski| [[::FontInstallHowto/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/pt | • {{#if: UbuntuHelp:FontInstallHowto|português| [[::FontInstallHowto/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ro | • {{#if: UbuntuHelp:FontInstallHowto|română| [[::FontInstallHowto/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/ru | • {{#if: UbuntuHelp:FontInstallHowto|русский| [[::FontInstallHowto/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/si | • {{#if: UbuntuHelp:FontInstallHowto|සිංහල| [[::FontInstallHowto/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/sq | • {{#if: UbuntuHelp:FontInstallHowto|shqip| [[::FontInstallHowto/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/sr | • {{#if: UbuntuHelp:FontInstallHowto|српски / srpski| [[::FontInstallHowto/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/sv | • {{#if: UbuntuHelp:FontInstallHowto|svenska| [[::FontInstallHowto/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/th | • {{#if: UbuntuHelp:FontInstallHowto|ไทย| [[::FontInstallHowto/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/tr | • {{#if: UbuntuHelp:FontInstallHowto|Türkçe| [[::FontInstallHowto/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/vi | • {{#if: UbuntuHelp:FontInstallHowto|Tiếng Việt| [[::FontInstallHowto/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/yue | • {{#if: UbuntuHelp:FontInstallHowto|粵語| [[::FontInstallHowto/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/zh | • {{#if: UbuntuHelp:FontInstallHowto|中文| [[::FontInstallHowto/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/zh-hans | • {{#if: UbuntuHelp:FontInstallHowto|中文(简体)| [[::FontInstallHowto/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FontInstallHowto | UbuntuHelp:FontInstallHowto | {{#if: | :}}FontInstallHowto}}/zh-hant | • {{#if: UbuntuHelp:FontInstallHowto|中文(繁體)| [[::FontInstallHowto/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:FontInstallHowto|:FontInstallHowto|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :FontInstallHowto/zh | | {{#ifexist: FontInstallHowto/zh | | {{#ifeq: {{#titleparts:FontInstallHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:FontInstallHowto|1|-1|}} | zh | | }}
This howto will explain two methods for installing fonts in Ubuntu.
The first uses the Synaptic Package Manager to install fonts from the Ubuntu repositories. As new fonts get added to the archive, this method offers fonts suitable for an increasing number of users, and is very easy.
The second method is useful if you have downloaded fonts from the web, bought them, or acquired them from other sources. It is a bit more manual, but allows you to use fonts (including restricted fonts when you can't find a free/libre/open font equivalent) from a wide range of sources.
Finally, at the end of this page, there are some links for further information on fonts on GNU/Linux.
Via Synaptic
Packages available through Synaptic are mostly programs, tools and libraries, but there are a few font packages in the system.
You will need to enable the Universe and Multiverse repositories to get all the fonts available. See AddingRepositoriesHowto for instructions, and SynapticHowto if you need more information on Synaptic.
Once the repositories are set up, search for "font" in Synaptic. You should get a list of over a hundred packages. (If you get far less, then you may need to press Reload, to make sure your repository data is up to date.) Not all of these packages are fonts, some are font utilities for editing or managing fonts. Clicking on a package will show a description.
The msttcorefonts package contains the Microsoft freeware (non-Free because they are non-modifiable) web fonts. (Note: Most Microsoft fonts are included in this package; however, it does not include Tahoma or Arial Narrow. If you need these fonts, you will have to get them off a computer running Windows. Sorry.)
<!> Note: After you install a new font, you will need to make sure that programs in which you want to use the new fonts can recognize them. In most cases this is done by closing and reopening the programs; however, some programs may require you to log out and log back in.
Manually
There are various locations in GNU/Linux in which fonts can be kept. These locations are defined in /etc/fonts/fonts.conf
; standard ones include /usr/share/fonts
, /usr/local/share/fonts
, and /home/<username>/.fonts
(where <username> is your user name).
The easiest way to install a truetype font is to press alt-F2 and enter the following code (this will open nautilus in the right directory):
gksu nautilus /usr/share/fonts/truetype
Then create a new directory, name the directory whatever you like (choose a name that you remember if you ever need to backup your fonts personal fonts). Copy the fonts into that directory and finally rebuild the font information files by pressing alt-F2, mark 'run in terminal' so you can see the progress and entering the following code:
sudo fc-cache -f -v
<!> Note: After you install a new font, you will need to make sure that programs in which you want to use the new fonts can recognize them. In most cases this is done by closing and reopening the programs; however, some programs may require you to log out and log back in.
The easiest place for people to put their fonts is /home/<username>/.fonts
. If you have not already done so, create this folder:
- Open your home folder in Nautilus (GNOME) or Konqueror (KDE).
- Since dot-folders are really hidden folders, you need to choose "Show Hidden Files" from the View menu.
- Go to File -> Create Folder (GNOME), or right-click and choose Create New -> Folder (KDE).
- Name the new folder ".fonts".
Now double click on the folder to open it, and drag and drop your fonts into the folder.
On GNOME, you can also directly open the virtual folder fonts:/
(within a Nautilus window, choose Go -> Location or press Ctrl+L) and drag and drop fonts into this folder.
However, fonts that are added by either of the ways above will only be available for one user. To make them available system-wide, drag and drop them to the directory /usr/share/fonts
. (Note: If you're on Kubuntu you may have to cd
to /usr/share/fonts
and run mkfontscale
, mkfontdir
, fc-cache
after this. See the instructions below.)
As in the last method, on GNOME you can also add fonts directly to fonts:/
. However, you must open the virtual folder as root. You can do this by opening a terminal window and running
gksudo nautilus fonts:
Kubuntu 5.04 Troubleshooting
If you're a Kubuntu 5.04 (Hoary Hedgehod) user, and adding fonts manually as directed above or via System Settings -> Font Installer (not covered here) doesn't seem to do anything, then you need to follow some extra steps. Open up a terminal window and type:
cd /usr/local/share/fonts # or /usr/share/fonts, but this is less safe sudo mkdir truetype cd truetype sudo cp /path/to/your/fonts/*.ttf . sudo cp /path/to/your/fonts/*.TTF . sudo chown root:root *.ttf sudo chown root:root *.TTF sudo mkfontscale sudo mkfontdir sudo fc-cache
(mkfontscale
and mkfontdir
creates fonts.scale
and fonts.dir
files within /usr/local/share/fonts/truetype
, and fc-cache
updates fonts.cache-1
files within all font directories.) Now you want to make symlinks within /usr/share/fonts/truetype
and your home folder that point to the new font folder you made :
sudo ln -s /usr/local/share/fonts/truetype /usr/share/fonts/truetype/myfonts sudo ln -s /usr/local/share/fonts/truetype /home/<username>/.fonts
[running both of these is probably overkill, but it works, so...]
It's probably a good idea to log in, log out, and log back in again at this point.
Enabling Bitmapped Fonts
If you'd like to use a fixed font in your terminal, use this command:
sudo dpkg-reconfigure fontconfig
or, at least in Edgy,
sudo dpkg-reconfigure fontconfig-config
Don't change anything on the first and second screen, and choose to enable bitmapped fonts on third screen. Now you can select some new fixed fonts in your gnome-terminal's profile. Terminus is suitable for terminals; to install this font in command line, run apt-get install xfonts-terminus
or use Synaptic (see above).
Alternatively, you can use Inconsolata, a monospaced font from Raph Levien. It is a very good font for the terminal.
Links to fonts
Ed Trager's "Unicode Font Guide For Free/Libre Open Source Operating Systems" lists free/open fonts: http://unifont.org/fontguide/
SIL provides high-quality fonts released under the Open Font License: http://scripts.sil.org/OFL_fonts
Luc Devroye's website has a huge list of links to free fonts, and other useful information: http://cgm.cs.mcgill.ca/~luc/originalfonts.html
The TypOasis has some very good fonts: http://moorstation.org/typoasis/typoasis1.htm Manfred Klein's Fonteria is part of TypOasis, but worth special mention: http://moorstation.org/typoasis/designers/klein/ Paul Lloyd Fonts is as well: http://moorstation.org/typoasis/designers/lloyd/
The Linux Font Howto has some commercial links and general advice: http://pegasus.rutgers.edu/~elflord/font_howto/Font-HOWTO/html/Font-HOWTO/x722.html
Links to font documentation
The Linux Font Howto explains different font files, font styles and how they work in Linux: http://pegasus.rutgers.edu/~elflord/font_howto/Font-HOWTO/html/Font-HOWTO/t1.html
The XFree86 documentation has some instructions on installing bitmapped and scalable fonts: http://www.xfree86.org/current/fonts2.html