Difference between revisions of "Fonts"
m (→Serif: updated AUR package names) |
m (→Install fonts from official repositories) |
||
(38 intermediate revisions by 23 users not shown) | |||
Line 21: | Line 21: | ||
{{Article summary wiki|Java Runtime Environment Fonts}}: Fonts specific to Sun's Java machine | {{Article summary wiki|Java Runtime Environment Fonts}}: Fonts specific to Sun's Java machine | ||
{{Article summary wiki|MS Fonts}}: Adding Microsoft fonts and mimicking Windows' font settings | {{Article summary wiki|MS Fonts}}: Adding Microsoft fonts and mimicking Windows' font settings | ||
− | |||
{{Article summary end}} | {{Article summary end}} | ||
Line 65: | Line 64: | ||
xset fp rehash | xset fp rehash | ||
}} | }} | ||
+ | In case the first command causes the following error | ||
+ | {{bc| | ||
+ | $ xset +fp /usr/share/fonts/local/ | ||
+ | xset: bad font path element (#0), possible causes are: | ||
+ | Directory does not exist or has wrong permissions | ||
+ | Directory missing fonts.dir | ||
+ | Incorrect font server address or syntax | ||
+ | }} | ||
+ | you'll have to run | ||
+ | {{bc| | ||
+ | cd /usr/share/fonts/local;mkfontdir | ||
+ | }} | ||
+ | as root to fix it. | ||
=== Creating a package === | === Creating a package === | ||
Line 105: | Line 117: | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
+ | |||
+ | For a more convenient package creation from ttf-fonts you can also use {{AUR|makefontpkg}} from the [[AUR]]. | ||
=== Manual installation === | === Manual installation === | ||
Line 112: | Line 126: | ||
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. To install fonts for only a single user, use {{ic|~/.fonts/}} instead. | To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. To install fonts for only a single user, use {{ic|~/.fonts/}} instead. | ||
− | + | For Xserver to load fonts directly (as opposed to the use of a ''font server'') the directory for your newly added font must be added with a FontPath entry. This entry is located in the ''Files'' section [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Fonts with X.Org]] for more detail. | |
Then update the fontconfig font cache: | Then update the fontconfig font cache: | ||
Line 118: | Line 132: | ||
$ fc-cache -vf | $ fc-cache -vf | ||
− | ==== Older applications | + | === Manual installation: advanced method === |
+ | |||
+ | Manual installation and maintenance of your font resources may be especially useful if your collection is more specialized, e.g. if you use commercial fonts, | ||
+ | if you use fonts in different formats, if you often install and remove font files, or if you just feel you need more control and better access than offered by | ||
+ | the package manager. There are numerous benefits to such an approach: | ||
+ | |||
+ | * You can avoid installation of multiple copies of the same family in different versions and formats (one of the most common reasons for rendering issues). | ||
+ | * You can use multiple and non-standard physical sources of font files (e.g. an additional hard drive, a separate partition). | ||
+ | * You can avoid relying on huge and cryptic local font sources which possibly contain 5 families you need and 55 you don't need (TeX Live & {{ic|09-texlive-fonts.conf}}, random font collections from the AUR, etc). | ||
+ | * You can avoid rendering issues because your fontconfig settings were tuned to a different format but the one installed in your system. | ||
+ | * You can quickly verify which families in which format(s) are present in the system and available for applications by visually inspecting the content of the main font directory (as a result, you don't need sophisticated and heavy-on-resources font management applications: {{Pkg|gtk2fontsel}} and basic CLI tools like {{ic|fc-query}} from {{Pkg|fontconfig}} package will do the job even better and faster). | ||
+ | * When you install or upgrade a single font, the same version will be available for all applications, including LaTeX related software. | ||
+ | * If necessary, you can quickly enable / disable a particular family because you know where exactly it can be found (useful for debugging). | ||
+ | * You don't need to worry about redundant {{ic|/etc/fonts/conf.avail/nn-foo.conf}} fontconfig files, potentially conflicting with your rendering settings (especially when you are using a [[Font_Configuration#Patched_packages|customized font configuration and patched libraries]]). | ||
+ | * In the long run, you save time needed to resolve issues and eliminate conflicts caused by careless use of the package manager. | ||
+ | |||
+ | In practical terms, there are at least a few ways to achieve this, which, if necessary, can be adopted by any package manager. The one described below has | ||
+ | proven to be very efficient and secure even with large font collections. | ||
+ | |||
+ | * We are going to separate font source locations (e.g. {{ic|/usr/share/fonts.avail}}: this is where our fonts will be stored) from a directory containing symbolic links to the families in use ({{ic|/usr/share/fonts}}). | ||
+ | |||
+ | * Each family is going to be located in a separate, clearly named subdirectory. The naming convention should be consistent and unambiguous, for instance: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | <ttf|otf|t1>-<optional_global_group_or_foundry_name>-<font_family_name> | ||
+ | </nowiki>}} | ||
+ | |||
+ | This way the content of the source directory will look like this: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | $ ls /usr/share/fonts.avail | ||
+ | |||
+ | /usr/share/fonts.avail/otf-heuristica | ||
+ | /usr/share/fonts.avail/ttf-liberation | ||
+ | /usr/share/fonts.avail/ttf-ms-arial | ||
+ | ... | ||
+ | </nowiki>}} | ||
+ | |||
+ | * We are not going to touch TeX Live font directories to avoid issues with LaTeX software. Instead, since we can use multiple locations, we will create symlinks in {{ic|/usr/share/fonts}}, giving applications access to particular families: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | # cd /usr/share/fonts | ||
+ | # ln -s ../fonts.avail/otf-heuristica . | ||
+ | # ln -s /opt/texlive/texmf-dist/fonts/truetype/public/opensans ttf-texlive-open.sans | ||
+ | </nowiki>}} | ||
+ | |||
+ | The result: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | $ ls /usr/share/fonts | ||
+ | |||
+ | ttf-liberation -> ..fonts.avail/ttf-liberation | ||
+ | ttf-ms-arial -> ..fonts.avail/ttf-ms-arial | ||
+ | otf-heuristica -> ..fonts.avail/otf-heuristica | ||
+ | otf-texlive-tex.gyre -> /opt/texlive/texmf-dist/fonts/opentype/public/tex-gyre | ||
+ | ttf-texlive-open.sans -> /opt/texlive/texmf-dist/fonts/truetype/public/opensans | ||
+ | ... | ||
+ | </nowiki>}} | ||
+ | |||
+ | Finally, you may want to run the usual: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | # fc-cache && mkfontscale && mkfontdir | ||
+ | </nowiki>}} | ||
+ | |||
+ | A similar approach can be found in [[TeX_Live|TeX Live]] Wiki article, but it's way simpler and describes a per-user scenario rather than a global implementation. | ||
+ | |||
+ | === Older applications === | ||
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory: | With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory: | ||
Line 184: | Line 265: | ||
==Console fonts== | ==Console fonts== | ||
− | The console | + | The [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font and ASCII character set by default, but both can be easily changed. |
− | A console font is limited to either 256 or 512 characters. | + | A console font is limited to either 256 or 512 characters. Available fonts are saved in {{ic|/usr/share/kbd/consolefonts/}} directory. |
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}. | Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}. | ||
Line 192: | Line 273: | ||
=== Previewing and testing === | === Previewing and testing === | ||
− | An organized library of images for previewing is available | + | {{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/consolefonts/consolefonts.html Linux console fonts screenshots].}} |
− | + | The available glyphs or letters in the font can also be viewed as a table with using ''showconsolefont'': | |
− | + | $ showconsolefont | |
− | + | The ''setfont'' utility may be used to temporarily change the font, so that the user can consider its use as the default. Just pass the name of the font (they are located in {{ic|/usr/share/kbd/consolefonts/}}): | |
− | + | $ setfont Lat2-Terminus16 | |
− | + | Optionally, you can specify character set to be used using the {{ic|-m}} option: | |
− | |||
− | + | $ setfont Lat2-Terminus16 -m 8859-2 | |
− | $ setfont | ||
− | + | If the newly changed font is not suitable, a return to the default font with the following command (even if the console display is totally unreadable, this command will still work - just type the command "blindly"): | |
− | |||
$ setfont | $ setfont | ||
+ | |||
+ | {{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}} | ||
=== Changing the default font === | === Changing the default font === | ||
− | + | The {{ic|FONT}} and {{ic|FONT_MAP}} variables in {{ic|/etc/vconsole.conf}} are used to change the default font. | |
− | |||
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}: | For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}: | ||
+ | |||
FONT=lat2-16 | FONT=lat2-16 | ||
− | |||
− | |||
− | |||
− | |||
− | + | It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[wikipedia:ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859|Wikipedia table]]. You can use a Terminus font which is recommended if you work a lot in console without X server. ter-216b for example is latin-2 part, size 16, bold. ter-216n is the same but normal weight. Terminus fonts have sizes up to 32. | |
− | |||
− | + | Now, set the proper font mapping, for lat2-16 it will be: | |
− | |||
− | + | FONT_MAP=8859-2 | |
− | |||
− | |||
− | |||
− | |||
− | + | To use the specified font in early userspace, use the {{ic|keymap}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information. | |
− | If | + | If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel Mode Setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied. |
− | |||
− | To | ||
==Font packages== | ==Font packages== | ||
Line 252: | Line 320: | ||
===International users=== | ===International users=== | ||
+ | Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph: | ||
+ | {{hc|$ fc-list :lang=ar | cut -d: -f1|2= | ||
+ | <nowiki> | ||
+ | /usr/share/fonts/TTF/FreeMono.ttf | ||
+ | /usr/share/fonts/TTF/DejaVuSansCondensed.ttf | ||
+ | /usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf | ||
+ | /usr/share/fonts/TTF/DejaVuSansMono.ttf | ||
+ | /usr/share/fonts/TTF/FreeSerif.ttf | ||
+ | </nowiki> | ||
+ | }} | ||
+ | |||
+ | To properly render fonts for multilingual websites like Wikipedia or this Arch Linux wiki, install these packages: {{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, {{Pkg|ttf-baekmuk}} | ||
− | ====Arabic==== | + | ====Arabic & Urdu==== |
*{{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah ''(AUR)'' | *{{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah ''(AUR)'' | ||
*{{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press ''(AUR)'' | *{{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press ''(AUR)'' | ||
Line 276: | Line 356: | ||
=====Japanese===== | =====Japanese===== | ||
− | *{{ | + | *{{Pkg|otf-ipafont}} - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja. |
*{{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux ''(AUR)'' | *{{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux ''(AUR)'' | ||
*{{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace). ''(AUR)'' | *{{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace). ''(AUR)'' | ||
− | *{{AUR|ttf-ipa-mona}}, {{AUR|ttf-monapo}} - Japanese fonts to show [ | + | *{{AUR|ttf-ipa-mona}}, {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly. ''(AUR)'' |
*{{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments. | *{{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments. | ||
Line 290: | Line 370: | ||
====Cyrillic==== | ====Cyrillic==== | ||
− | ''Also see [[# | + | ''Also see [[#Monospaced]], [[#Sans-serif]] and [[#Serif]]'' |
*{{AUR|font-arhangai}} - Mongolian Cyrillic (''AUR'') | *{{AUR|font-arhangai}} - Mongolian Cyrillic (''AUR'') | ||
*{{AUR|ttf-pingwi-typography}} - PingWi Typography (PWT) fonts (''AUR'') | *{{AUR|ttf-pingwi-typography}} - PingWi Typography (PWT) fonts (''AUR'') | ||
Line 306: | Line 386: | ||
*{{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont) | *{{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont) | ||
:(This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document) | :(This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document) | ||
− | * {{ | + | * {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more) ''(AUR)'' |
====Khmer==== | ====Khmer==== | ||
*{{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language | *{{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language | ||
− | *[http://code.google.com/webfonts/family?family=Hanuman&subset=khmer Hanuman] ({{AUR|ttf-google- | + | *[http://code.google.com/webfonts/family?family=Hanuman&subset=khmer Hanuman] ({{AUR|ttf-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}}) |
====Sinhala==== | ====Sinhala==== | ||
Line 336: | Line 416: | ||
===Monospaced=== | ===Monospaced=== | ||
Here are some suggestions. Every user has their own favorite, so experiment to find yours. | Here are some suggestions. Every user has their own favorite, so experiment to find yours. | ||
− | If you | + | If you are in a hurry, you read Dan Benjamin's blog post: [http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts'']. |
− | Here | + | Here is a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/. |
====TrueType==== | ====TrueType==== | ||
+ | * Agave ({{AUR|ttf-agave}}) | ||
* [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}}) | * [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}}) | ||
* Anka/Coder ({{AUR|ttf-anka-coder}}) | * Anka/Coder ({{AUR|ttf-anka-coder}}) | ||
− | * Anonymous Pro ({{AUR|ttf-anonymous-pro}}, included in {{AUR|ttf-google- | + | * [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{AUR|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-hg}} and {{AUR|ttf-google-fonts-git}}) |
* [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}}) | * [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}}) | ||
* [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}}) - Windows programming font | * [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}}) - Windows programming font | ||
* [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}}) | * [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}}) | ||
− | * Cousine ({{AUR|ttf-google- | + | * Cousine ({{AUR|ttf-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Courier New (metric-compatible) |
* [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode | * [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode | ||
− | * [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google- | + | * [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-hg}} and {{AUR|ttf-google-fonts-git}}) |
* Envy Code R ({{AUR|ttf-envy-code-r}}) | * Envy Code R ({{AUR|ttf-envy-code-r}}) | ||
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode | * [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode | ||
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}) - Excellent programming font | * [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}) - Excellent programming font | ||
* [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications | * [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications | ||
− | |||
* [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Alternative to Courier New (metric-compatible) | * [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Alternative to Courier New (metric-compatible) | ||
* [[Wikipedia:Lucida Console|Lucida Console]] ({{AUR|ttf-ms-fonts}}) | * [[Wikipedia:Lucida Console|Lucida Console]] ({{AUR|ttf-ms-fonts}}) | ||
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{Pkg|jre}}) | * [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{Pkg|jre}}) | ||
− | * [[Wikipedia:Monaco (typeface)|Monaco]] ({{ | + | * [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - Popular programming font on OSX/Textmate |
* Monofur ({{AUR|ttf-monofur}}) | * Monofur ({{AUR|ttf-monofur}}) | ||
Line 364: | Line 444: | ||
*Default 8x16 | *Default 8x16 | ||
*Dina ({{Pkg|dina-font}}) | *Dina ({{Pkg|dina-font}}) | ||
− | *[http://font.gohu. | + | *[http://font.gohu.org/ Gohu] ({{AUR|gohufont}}) |
*Lime ({{Pkg|artwiz-fonts}}) | *Lime ({{Pkg|artwiz-fonts}}) | ||
*[[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}}) | *[[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}}) | ||
Line 378: | Line 458: | ||
*[[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}}) | ||
*[[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}}) | ||
− | *Arimo ({{AUR|ttf-google- | + | *Arimo ({{AUR|ttf-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Arial (metric-compatible) |
*[[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}}) | *[[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}}) | ||
*[[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}}) | *[[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}}) | ||
Line 384: | Line 464: | ||
*[[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}}) | *[[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}}) | ||
*[[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode | *[[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode | ||
− | *[[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google- | + | *[[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-hg}} and {{AUR|ttf-google-fonts-git}}) |
*[[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode | *[[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode | ||
*[[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}}) | ||
Line 391: | Line 471: | ||
*[[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}}) | ||
*[[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}}) | ||
− | *[[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google- | + | *[[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic |
*[[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}}) | *[[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}}) | ||
*[[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}}) | ||
Line 407: | Line 487: | ||
*[[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode | *[[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode | ||
*[[Wikipedia:Doulos SIL|Doulos]] ({{AUR|doulos-sil}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic | *[[Wikipedia:Doulos SIL|Doulos]] ({{AUR|doulos-sil}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic | ||
− | *[[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google- | + | *[[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-hg}} and {{AUR|ttf-google-fonts-git}}) |
*[[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode | *[[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode | ||
*[[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet | *[[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet | ||
Line 414: | Line 494: | ||
*[[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew | *[[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew | ||
*[[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}}) | *[[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}}) | ||
− | *Tinos ({{AUR|ttf-google- | + | *Tinos ({{AUR|ttf-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible) |
===Unsorted=== | ===Unsorted=== | ||
<!--This section should be absorbed into the Monospace/Serif/Sans-Serif structure--> | <!--This section should be absorbed into the Monospace/Serif/Sans-Serif structure--> | ||
− | *{{AUR|ttf-google- | + | *{{AUR|ttf-google-fonts-git}} and {{AUR|ttf-google-fonts-hg}} — a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added. {{AUR|ttf-google-fonts-hg}} pulls down the entire Mercurial repository from the upstream Web Fonts project. {{AUR|ttf-google-fonts-git}} pulls from a much smaller and leaner unofficial repository hosted on GitHub. ''(AUR)'' |
*{{Pkg|ttf-mph-2b-damase}} — Covers full plane 1 and several scripts | *{{Pkg|ttf-mph-2b-damase}} — Covers full plane 1 and several scripts | ||
− | *{{ | + | *{{Pkg|ttf-symbola}} — Provides emoji and many many other symbols |
*{{AUR|ttf-sil-fonts}} — Gentium, Charis, Doulos, Andika and Abyssinica from SIL ''(AUR)'' | *{{AUR|ttf-sil-fonts}} — Gentium, Charis, Doulos, Andika and Abyssinica from SIL ''(AUR)'' | ||
*{{Pkg|font-bh-ttf}} — X.Org Luxi fonts | *{{Pkg|font-bh-ttf}} — X.Org Luxi fonts | ||
*{{Pkg|ttf-cheapskate}} — Font collection from ''dustismo.com'' | *{{Pkg|ttf-cheapskate}} — Font collection from ''dustismo.com'' | ||
− | *{{ | + | *{{AUR|ttf-isabella}} — Calligraphic font based on the ''Isabella Breviary'' of 1497 |
*{{Pkg|ttf-junicode}} — Junius font containing almost complete medieval latin script glyphs | *{{Pkg|ttf-junicode}} — Junius font containing almost complete medieval latin script glyphs | ||
*arkpandorafonts {{AUR|ttf-arkpandora}} — Alternative to Arial and Times New Roman fonts ''(AUR)'' | *arkpandorafonts {{AUR|ttf-arkpandora}} — Alternative to Arial and Times New Roman fonts ''(AUR)'' | ||
Line 430: | Line 510: | ||
== Fallback font order with X11 == | == Fallback font order with X11 == | ||
− | Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one | + | Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it. |
Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}. | Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}. | ||
Line 456: | Line 536: | ||
In this case {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias. | In this case {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias. | ||
+ | |||
+ | == Hints == | ||
+ | === Install fonts from official repositories === | ||
+ | Maybe you want to install all fonts available in ''official repositories''. | ||
+ | ;All fonts: | ||
+ | # pacman -S $(pacman -Ssq font) | ||
+ | ;All ''TrueType'' fonts: | ||
+ | # pacman -S $(pacman -Ssq ttf) | ||
+ | |||
+ | === Application-specific font cache === | ||
+ | |||
+ | Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|$HOME/.matplotlib/fontList.cache}} so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html]. | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | * [[Font Configuration]] |
Revision as of 10:01, 12 October 2013
zh-CN:Fonts zh-TW:Fonts From Wikipedia:
- A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats.
Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary heading Template:Article summary wiki: Font setup and beautification Template:Article summary wiki: Fonts specific to Sun's Java machine Template:Article summary wiki: Adding Microsoft fonts and mimicking Windows' font settings Template:Article summary end
Contents
Font formats
Most computer fonts used today are in either bitmap or outline data formats.
- Bitmap fonts
- Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.
- Outline or vector fonts
- Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.
Common extensions
-
bdf
andbdf.gz
– bitmap fonts, bitmap distribution format and gzip compressedbdf
-
pcf
andpcf.gz
– bitmaps, portable compiled font and gzip compressedpcf
-
psf
,psfu
,psf.gz
andpsfu.gz
– bitmaps, PC screen font, PC screen font Unicode and the gzipped versions (not compatible with X.Org) -
pfa
andpfb
– outline fonts, PostScript font ASCII and PostScript font binary. PostScript fonts carry built-in printer instructions. -
ttf
– outline, TrueType font. Originally designed as a replacement for the PostScript fonts. -
otf
– outline, OpenType font. TrueType with PostScript typographic instructions.
For most purposes, the technical differences between TrueType and OpenType can be ignored, some fonts with a ttf
extension are actually OpenType fonts.
Other formats
The typesetting application, TeX, and its companion font software, Metafont, render characters using their own methods. Some of the file extensions used for fonts by these two programs are *pk
, *gf
, mf
and vf
.
FontForge, a font editing application, can store fonts in its native text-based format, sfd
, spline font database.
The SVG format also has its own font description method.
Installation
There are various methods for installing fonts.
Pacman
Fonts and font collections in the enabled repositories can be installed using pacman. Available fonts may be found by using:
$ pacman -Ss font
Or to search for ttf
fonts only:
$ pacman -Ss ttf
Some fonts like terminus-font are installed in /usr/share/fonts/local
, which is not added to the font path by default. By adding the following lines to ~/.xinitrc
, the fonts can be used in X11:
xset +fp /usr/share/fonts/local xset fp rehash
In case the first command causes the following error
$ xset +fp /usr/share/fonts/local/ xset: bad font path element (#0), possible causes are: Directory does not exist or has wrong permissions Directory missing fonts.dir Incorrect font server address or syntax
you'll have to run
cd /usr/share/fonts/local;mkfontdir
as root to fix it.
Creating a package
You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the AUR. Here is an example of how to create a basic package. To learn more about building packages, read PKGBUILD.
pkgname=ttf-fontname pkgver=1.0 pkgrel=1 depends=('fontconfig' 'xorg-font-utils') pkgdesc="custom fonts" arch=('any') source=(http://someurl.org/$pkgname.tar.bz2) install=$pkgname.install package() { install -d "$pkgdir/usr/share/fonts/TTF" cp -dpr --no-preserve=ownership "$srcdir/$pkgname/"*.ttf "$pkgdir/usr/share/fonts/TTF/" }
This PKGBUILD assumes the fonts are TrueType. An install file (ttf-fontname.install
) will also need to be created to update the font cache:
post_install() { echo -n "Updating font cache... " fc-cache -fs >/dev/null mkfontscale /usr/share/fonts/TTF /usr/share/fonts/Type1 mkfontdir /usr/share/fonts/TTF /usr/share/fonts/Type1 echo "done" } post_upgrade() { post_install } post_remove() { post_install }
For a more convenient package creation from ttf-fonts you can also use makefontpkgAUR from the AUR.
Manual installation
The recommended way of adding fonts that are not in the repositories to your system is described in #Creating a package. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.
To install fonts system-wide (available for all users), move the folder to the /usr/share/fonts/
directory. To install fonts for only a single user, use ~/.fonts/
instead.
For Xserver to load fonts directly (as opposed to the use of a font server) the directory for your newly added font must be added with a FontPath entry. This entry is located in the Files section of your Xorg configuration file (e.g. /etc/X11/xorg.conf
or /etc/xorg.conf
). See #Fonts with X.Org for more detail.
Then update the fontconfig font cache:
$ fc-cache -vf
Manual installation: advanced method
Manual installation and maintenance of your font resources may be especially useful if your collection is more specialized, e.g. if you use commercial fonts, if you use fonts in different formats, if you often install and remove font files, or if you just feel you need more control and better access than offered by the package manager. There are numerous benefits to such an approach:
- You can avoid installation of multiple copies of the same family in different versions and formats (one of the most common reasons for rendering issues).
- You can use multiple and non-standard physical sources of font files (e.g. an additional hard drive, a separate partition).
- You can avoid relying on huge and cryptic local font sources which possibly contain 5 families you need and 55 you don't need (TeX Live &
09-texlive-fonts.conf
, random font collections from the AUR, etc). - You can avoid rendering issues because your fontconfig settings were tuned to a different format but the one installed in your system.
- You can quickly verify which families in which format(s) are present in the system and available for applications by visually inspecting the content of the main font directory (as a result, you don't need sophisticated and heavy-on-resources font management applications: gtk2fontsel and basic CLI tools like
fc-query
from fontconfig package will do the job even better and faster). - When you install or upgrade a single font, the same version will be available for all applications, including LaTeX related software.
- If necessary, you can quickly enable / disable a particular family because you know where exactly it can be found (useful for debugging).
- You don't need to worry about redundant
/etc/fonts/conf.avail/nn-foo.conf
fontconfig files, potentially conflicting with your rendering settings (especially when you are using a customized font configuration and patched libraries). - In the long run, you save time needed to resolve issues and eliminate conflicts caused by careless use of the package manager.
In practical terms, there are at least a few ways to achieve this, which, if necessary, can be adopted by any package manager. The one described below has proven to be very efficient and secure even with large font collections.
- We are going to separate font source locations (e.g.
/usr/share/fonts.avail
: this is where our fonts will be stored) from a directory containing symbolic links to the families in use (/usr/share/fonts
).
- Each family is going to be located in a separate, clearly named subdirectory. The naming convention should be consistent and unambiguous, for instance:
<ttf|otf|t1>-<optional_global_group_or_foundry_name>-<font_family_name>
This way the content of the source directory will look like this:
$ ls /usr/share/fonts.avail /usr/share/fonts.avail/otf-heuristica /usr/share/fonts.avail/ttf-liberation /usr/share/fonts.avail/ttf-ms-arial ...
- We are not going to touch TeX Live font directories to avoid issues with LaTeX software. Instead, since we can use multiple locations, we will create symlinks in
/usr/share/fonts
, giving applications access to particular families:
# cd /usr/share/fonts # ln -s ../fonts.avail/otf-heuristica . # ln -s /opt/texlive/texmf-dist/fonts/truetype/public/opensans ttf-texlive-open.sans
The result:
$ ls /usr/share/fonts ttf-liberation -> ..fonts.avail/ttf-liberation ttf-ms-arial -> ..fonts.avail/ttf-ms-arial otf-heuristica -> ..fonts.avail/otf-heuristica otf-texlive-tex.gyre -> /opt/texlive/texmf-dist/fonts/opentype/public/tex-gyre ttf-texlive-open.sans -> /opt/texlive/texmf-dist/fonts/truetype/public/opensans ...
Finally, you may want to run the usual:
# fc-cache && mkfontscale && mkfontdir
A similar approach can be found in TeX Live Wiki article, but it's way simpler and describes a per-user scenario rather than a global implementation.
Older applications
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and xfontsel
) the index will need to be created in the font directory:
$ mkfontscale $ mkfontdir
Or to include more than one folder with one command:
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash
At times the X server may fail to load the fonts directory and you will need to rescan all the fonts.dir
files:
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories # xset fp rehash # Forces a new rescan
To check that the font(s) is included:
$ xlsfonts | grep fontname
Pango Warnings
When Pango is in use on your system it will read from fontconfig to sort out where to source fonts.
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common' (process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the ttf-liberation fonts to illustrate the solution and runs as root to enable them system-wide.
# pacman -S ttf-liberation -- output abbreviated, assumes installation succeeded -- # fc-cache -vfs /usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs /usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs /usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs /usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs /var/cache/fontconfig: cleaning cache directory fc-cache: succeeded
You can test for a default font being set like so:
# fc-match LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
Fonts with X.Org
In order for Xorg to find and use your newly installed fonts, you must add the font paths to /etc/X11/xorg.conf
(another X.Org configuration file may work too).
Here is an example of the section that must be added to /etc/X11/xorg.conf
. Add or remove paths based on your particular font requirements.
# Let X.Org know about the custom font directories Section "Files" FontPath "/usr/share/fonts/100dpi" FontPath "/usr/share/fonts/75dpi" FontPath "/usr/share/fonts/cantarell" FontPath "/usr/share/fonts/cyrillic" FontPath "/usr/share/fonts/encodings" FontPath "/usr/share/fonts/local" FontPath "/usr/share/fonts/misc" FontPath "/usr/share/fonts/truetype" FontPath "/usr/share/fonts/TTF" FontPath "/usr/share/fonts/util" EndSection
Console fonts
The virtual console uses the kernel built-in font and ASCII character set by default, but both can be easily changed.
A console font is limited to either 256 or 512 characters. Available fonts are saved in /usr/share/kbd/consolefonts/
directory.
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of /usr/share/kbd/keymaps/
.
Previewing and testing
The available glyphs or letters in the font can also be viewed as a table with using showconsolefont:
$ showconsolefont
The setfont utility may be used to temporarily change the font, so that the user can consider its use as the default. Just pass the name of the font (they are located in /usr/share/kbd/consolefonts/
):
$ setfont Lat2-Terminus16
Optionally, you can specify character set to be used using the -m
option:
$ setfont Lat2-Terminus16 -m 8859-2
If the newly changed font is not suitable, a return to the default font with the following command (even if the console display is totally unreadable, this command will still work - just type the command "blindly"):
$ setfont
Changing the default font
The FONT
and FONT_MAP
variables in /etc/vconsole.conf
are used to change the default font.
For displaying characters such as Č, ž, đ, š or Ł, ę, ą, ś using the font lat2-16.psfu.gz
:
FONT=lat2-16
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. lat2-08
). For the regions determined by 8859 specification, look at the Wikipedia table. You can use a Terminus font which is recommended if you work a lot in console without X server. ter-216b for example is latin-2 part, size 16, bold. ter-216n is the same but normal weight. Terminus fonts have sizes up to 32.
Now, set the proper font mapping, for lat2-16 it will be:
FONT_MAP=8859-2
To use the specified font in early userspace, use the keymap
hook in /etc/mkinitcpio.conf
. See Mkinitcpio#HOOKS for more information.
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example Kernel Mode Setting#Early KMS start, [1] or other ways to setup your framebuffer before /etc/vconsole.conf
is applied.
Font packages
This is a selective list that includes many font packages from the AUR along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or Wikipedia pages for detail.
Github user Ternstor has created a python script that generates PNG images of all fonts in extra, community and the AUR so you can preview all the fonts below.
Braille
- ttf-ubraille - Font containing Unicode symbols for braille
International users
Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command fc-list :lang="two letter language code"
. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:
$ fc-list :lang=ar | cut -d: -f1
/usr/share/fonts/TTF/FreeMono.ttf /usr/share/fonts/TTF/DejaVuSansCondensed.ttf /usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf /usr/share/fonts/TTF/DejaVuSansMono.ttf /usr/share/fonts/TTF/FreeSerif.ttf
To properly render fonts for multilingual websites like Wikipedia or this Arch Linux wiki, install these packages: ttf-freefont, ttf-arphic-uming, ttf-baekmuk
Arabic & Urdu
- ttf-qurancomplex-fontsAUR - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah (AUR)
- ttf-amiriAUR - A classical Arabic typeface in Naskh style poineered by Amiria Press (AUR)
- ttf-sil-lateefAUR - Unicode Arabic font from SIL (AUR)
- ttf-sil-scheherazadeAUR - Unicode Arabic font from SIL (AUR)
- ttf-arabeyes-fontsAUR - Collection of free Arabic fonts (AUR)
Birman
- ttf-myanmar3AUR - Font for Myanmar/Burmese script (AUR)
Chinese, Japanese, Korean, Vietnamese
(Mainly) Chinese
- ttf-twAUR - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan (AUR).
- wqy-microhei - A Sans-Serif style high quality CJKV outline font.
- wqy-zenhei - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).
- ttf-arphic-ukai - Kaiti (brush stroke) Unicode font (enabling anti-aliasing is suggested)
- ttf-arphic-uming - Mingti (printed) Unicode font
- opendesktop-fonts - New Sung font, previously is ttf-fireflysung package
- wqy-bitmapfont - Bitmapped Song Ti (serif) Chinese font
- ttf-hannom - Chinese and Vietnamese TrueType font
Japanese
- otf-ipafont - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.
- ttf-vlgothicAUR - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux (AUR)
- ttf-mplusAUR - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace). (AUR)
- ttf-ipa-monaAUR, ttf-monapoAUR - Japanese fonts to show 2channel Shift JIS art properly. (AUR)
- ttf-sazanami - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.
Korean
- ttf-baekmuk - Collection of Korean TrueType fonts
- ttf-aleeAUR - Set of free Hangul TrueType fonts (AUR)
- ttf-unfonts-coreAUR - Un fonts (default Baekmuk fonts may be unsatisfactory) (AUR)
- ttf-nanumAUR - Nanum series TrueType fonts (AUR)
- ttf-nanumgothic_codingAUR - Nanum series fixed width TrueType fonts (AUR)
Cyrillic
Also see #Monospaced, #Sans-serif and #Serif
- font-arhangaiAUR - Mongolian Cyrillic (AUR)
- ttf-pingwi-typographyAUR - PingWi Typography (PWT) fonts (AUR)
Greek
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:
- otf-gfsAUR - Selection of OpenType fonts from the Greek Font Society (AUR)
- ttf-mgopenAUR - Professional TrueType fonts from Magenta (AUR)
Hebrew
- culmusAUR - Nice collection of free Hebrew fonts (AUR)
Indic
- ttf-freebanglafont - Font for Bangla
- ttf-indic-otf - Indic OpenType Fonts collection (containing ttf-freebanglafont)
- (This one contains a "look of disapproval" that might be more to your liking than the bdf-unifont one mentioned elsewhere in this document)
- lohit-fontsAUR - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more) (AUR)
Khmer
- ttf-khmer - Font covering glyphs for Khmer language
- Hanuman (ttf-google-fonts-hgAUR or ttf-google-fonts-gitAUR)
Sinhala
- ttf-lklugAUR - Sinhala Unicode font (AUR)
Tamil
- ttf-tamilAUR - Tamil Unicode fonts (AUR)
Tibetan
- ttf-tibetan-machine - Tibetan Machine TTFont
Math
- font-mathematica - Mathematica fonts by Wolfram Research, Inc.
- ttf-mathtypeAUR - MathType fonts (AUR)
- ttf-computer-modern-fontsAUR - (AUR)
Microsoft fonts
See MS Fonts.
Apple Mac OS X fonts
- ttf-mac-fontsAUR - Mac OS X TrueType fonts
- ttf-macAUR - Mac OS X TrueType fonts (This package does not come with the ttf fonts (only the otf fonts), they have to be provided on their own.
Monospaced
Here are some suggestions. Every user has their own favorite, so experiment to find yours. If you are in a hurry, you read Dan Benjamin's blog post: Top 10 Programming Fonts.
Here is a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/.
TrueType
- Agave (ttf-agaveAUR)
- Andalé Mono (ttf-ms-fontsAUR)
- Anka/Coder (ttf-anka-coderAUR)
- Anonymous Pro (ttf-anonymous-proAUR, included in ttf-google-fonts-hgAUR and ttf-google-fonts-gitAUR)
- Bitstream Vera Mono (ttf-bitstream-vera)
- Consolas (ttf-vista-fontsAUR) - Windows programming font
- Courier New (ttf-ms-fontsAUR)
- Cousine (ttf-google-fonts-hgAUR or ttf-google-fonts-gitAUR) - Chrome/Chromium OS replacement for Courier New (metric-compatible)
- DejaVu Sans Mono (ttf-dejavu) - Unicode
- Droid Sans Mono (ttf-droid, included in ttf-google-fonts-hgAUR and ttf-google-fonts-gitAUR)
- Envy Code R (ttf-envy-code-rAUR)
- FreeMono (ttf-freefont) - Unicode
- Inconsolata (ttf-inconsolata) - Excellent programming font
- Inconsolata-g (ttf-inconsolata-gAUR) - adds some programmer-friendly modifications
- Liberation Mono (ttf-liberation) - Alternative to Courier New (metric-compatible)
- Lucida Console (ttf-ms-fontsAUR)
- Lucida Typewriter (included in package jre)
- Monaco (ttf-monacoAUR) - Popular programming font on OSX/Textmate
- Monofur (ttf-monofurAUR)
Bitmap
- Default 8x16
- Dina (dina-font)
- Gohu (gohufontAUR)
- Lime (artwiz-fonts)
- ProFont (profont)
- Proggy Programming Fonts (proggyfontsAUR)
- Proggy opti cyrillic (proggyopticyr-fontAUR)
- Tamsyn (tamsyn-font)
- Terminus (terminus-font)
- Unifont (glyphs like (look of disapproval)) (bdf-unifont)
Sans-serif
- Andika (ttf-andikaAUR, included in ttf-sil-fontsAUR)
- Arial (ttf-ms-fontsAUR)
- Arial Black (ttf-ms-fontsAUR)
- Arimo (ttf-google-fonts-hgAUR or ttf-google-fonts-gitAUR) - Chrome/Chromium OS replacement for Arial (metric-compatible)
- Calibri (ttf-vista-fontsAUR)
- Candara (ttf-vista-fontsAUR)
- Constantia (ttf-vista-fontsAUR)
- Corbel (ttf-vista-fontsAUR)
- DejaVu Sans (ttf-dejavu) - Unicode
- Droid Sans (ttf-droid, included in ttf-google-fonts-hgAUR and ttf-google-fonts-gitAUR)
- FreeSans (ttf-freefont) - Unicode
- Impact (ttf-ms-fontsAUR)
- Liberation Sans (ttf-liberation, improved/reworked Cyrillic: ttf-liberastikaAUR) - Alternative to Arial (metric-compatible)
- Linux Biolinum (ttf-linux-libertine)
- Lucida Sans (ttf-ms-fontsAUR)
- Microsoft Sans Serif (ttf-ms-fontsAUR)
- PT Sans (ttf-google-fonts-hgAUR or ttf-google-fonts-gitAUR) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic
- Tahoma (ttf-tahomaAUR)
- Trebuchet (ttf-ms-fontsAUR)
- Ubuntu-Title (ttf-ubuntu-titleAUR)
- Ubuntu Font Family (ttf-ubuntu-font-family)
- Verdana (ttf-ms-fontsAUR)
Script
- Comic Sans (ttf-ms-fontsAUR)
Serif
- Cambria (ttf-vista-fontsAUR)
- Charis (ttf-charisAUR, included in ttf-sil-fontsAUR) - Unicode: Latin, Cyrillic
- DejaVu Serif (ttf-dejavu) - Unicode
- Doulos (doulos-silAUR, included in ttf-sil-fontsAUR) - Unicode: Latin, Cyrillic
- Droid Serif (ttf-droid, included in ttf-google-fonts-hgAUR and ttf-google-fonts-gitAUR)
- FreeSerif (ttf-freefont) - Unicode
- Gentium (ttf-gentium, included in ttf-sil-fontsAUR) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet
- Georgia (ttf-ms-fontsAUR)
- Liberation Serif (ttf-liberation) - Alternative to Times New Roman (metric-compatible)
- Linux Libertine (ttf-linux-libertine) - Unicode: Latin, Greek, Cyrillic, Hebrew
- Times New Roman (ttf-ms-fontsAUR)
- Tinos (ttf-google-fonts-hgAUR or ttf-google-fonts-gitAUR) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)
Unsorted
- ttf-google-fonts-gitAUR and ttf-google-fonts-hgAUR — a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added. ttf-google-fonts-hgAUR pulls down the entire Mercurial repository from the upstream Web Fonts project. ttf-google-fonts-gitAUR pulls from a much smaller and leaner unofficial repository hosted on GitHub. (AUR)
- ttf-mph-2b-damase — Covers full plane 1 and several scripts
- ttf-symbola — Provides emoji and many many other symbols
- ttf-sil-fontsAUR — Gentium, Charis, Doulos, Andika and Abyssinica from SIL (AUR)
- font-bh-ttf — X.Org Luxi fonts
- ttf-cheapskate — Font collection from dustismo.com
- ttf-isabellaAUR — Calligraphic font based on the Isabella Breviary of 1497
- ttf-junicode — Junius font containing almost complete medieval latin script glyphs
- arkpandorafonts ttf-arkpandoraAUR — Alternative to Arial and Times New Roman fonts (AUR)
- xorg-fonts-type1 — IBM Courier and Adobe Utopia sets of PostScript fonts
Fallback font order with X11
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.
Fontconfig lets every user configure the order they want via $XDG_CONFIG_HOME/fontconfig/fonts.conf
.
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <alias> <family>serif</family> <prefer> <family>Your favorite Latin Serif font name</family> <family>Your Chinese font name</family> </prefer> </alias> </fontconfig>
You can add a section for Sans-serif and monospaced as well. For more informations, have a look at the fontconfig manual.
Font alias
In Linux there are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: serif
for a font of the serif type (e.g. DejaVu Serif); sans-serif
for a font of the sans-serif type (e.g. DejaVu Sans); and monospace
for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools such as those found in KDE and other desktop environments.
To reverse an alias and find which font it is representing, run:
$ fc-match monospace DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
In this case DejaVuSansMono.ttf
is the font represented by the monospace alias.
Hints
Install fonts from official repositories
Maybe you want to install all fonts available in official repositories.
- All fonts
# pacman -S $(pacman -Ssq font)
- All TrueType fonts
# pacman -S $(pacman -Ssq ttf)
Application-specific font cache
Matplotlib (python-matplotlib or python2-matplotlib) uses its own font cache, so after updating fonts, be sure to remove $HOME/.matplotlib/fontList.cache
so it will regenerate its cache and find the new fonts [2].