Fonts: Difference between revisions

From Alpine Linux
(use path & cmd template)
(Add Changing GRUB font and font size)
 
(6 intermediate revisions by 2 users not shown)
Line 27: Line 27:
These selections cover special '''Asiatic languages like Japanese, etc.''':
These selections cover special '''Asiatic languages like Japanese, etc.''':


{{cmd|# apk add font-terminus font-noto font-noto-thai font-noto-tibetan font-ipa font-sony-misc font-daewoo-misc font-jis-misc}}
{{cmd|# apk add font-terminus font-noto font-noto-thai font-noto-tibetan font-ipa font-sony-misc font-jis-misc}}


<br>
<br>
Line 39: Line 39:
These selection will cover, in general '''Arabic, Thai, Ethiopic, Hebrew, Romanian, Persian, Korean Hangul, Greek, Persian, Russian/Slavic Cyrillic, Macedonian/Serbian, Armenian, Georgian, Lao, Devanagari, Urdu (Hindustani as in Northern India and Pakistan), Cherokee, Thaana languages support''' for desktop setups:
These selection will cover, in general '''Arabic, Thai, Ethiopic, Hebrew, Romanian, Persian, Korean Hangul, Greek, Persian, Russian/Slavic Cyrillic, Macedonian/Serbian, Armenian, Georgian, Lao, Devanagari, Urdu (Hindustani as in Northern India and Pakistan), Cherokee, Thaana languages support''' for desktop setups:


{{cmd|<nowiki># apk add font-terminus font-bitstream-* font-noto font-noto-extra font-arabic-misc  
{{cmd|<nowiki># apk add font-terminus font-noto font-noto-extra font-arabic-misc  
# apk add font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic
# apk add font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic
# apk add font-noto-arabic font-noto-armenian font-noto-cherokee font-noto-devanagari font-noto-ethiopic font-noto-georgian
# apk add font-noto-arabic font-noto-armenian font-noto-cherokee font-noto-devanagari font-noto-ethiopic font-noto-georgian
Line 77: Line 77:
== List of fonts in Alpine Linux ==
== List of fonts in Alpine Linux ==


* [https://en.wikipedia.org/wiki/Utopia_(typeface) Utopia] - font-adobe-utopia-*
* [https://en.wikipedia.org/wiki/Utopia_(typeface) Utopia] - {{pkg|font-adobe-utopia-*}}
* [https://en.wikipedia.org/wiki/Noto_fonts Noto] - font-noto-* -- These fonts can cover different glyphs for your language.  If you go to https://fonts.google.com/noto , you can try to search for your language to see if it is supported.  If Alpine doesn't have it, you can download it from Google into your {{path|~/.font}} .  As hinted in the introduction, noto comes from '''no to'''fu or gradual elimination of these substitute characters off the web.
* [https://en.wikipedia.org/wiki/Noto_fonts Noto] - {{pkg|font-noto-*}} -- These fonts can cover different glyphs for your language.  If you go to https://fonts.google.com/noto , you can try to search for your language to see if it is supported.  If Alpine doesn't have it, you can download it from Google into your {{path|~/.font}} .  As hinted in the introduction, noto comes from '''no to'''fu or gradual elimination of these substitute characters off the web.
font-noto
* [https://terminus-font.sourceforge.net/ Terminus] - {{pkg|font-terminus}} -- Monospace font
font-noto-adlam
* [https://mirrors.ibiblio.org/CTAN/systems/win32/bakoma/fonts/fonts.html BaKoMa] {{pkg|font-bakoma-*}} -- Fonts for TeX typesetting system (for academics in the math and sciences and book writers) and TeX (WYSIWYG) editors
font-noto-adlamunjoined
* [https://en.wikipedia.org/wiki/Bitstream_Vera Bitstream Vera] {{pkg|font-bitstream-*}}
font-noto-arabic
* [https://en.wikipedia.org/wiki/Bitstream_Vera Bera (Bitstream Vera Type 1)] - {{pkg|font-bitstream-type1}} -- Use for LaTeX
font-noto-armenian
* [https://fontawesome.com/ Font Awesome] - {{pkg|font-awesome}} -- It was used in Twitter Bootstrap. It is a font representing things and brands as Icons.
font-noto-avestan
* [https://www.gnu.org/software/freefont/ GNU FreeFont] - {{pkg|font-freefont}} -- See link for support for different writing systems/languages
font-noto-bamum
* [https://savannah.gnu.org/projects/unifont/ GNU Unifont] - {{pkg|font-unifont}} -- It contains glyphs of every codepoint
font-noto-bengali
* {{pkg|font-misc-cyrillic}} -- Cyrillic fonts (Russian/Slavic Style)
font-noto-buhid
* {{pkg|font-screen-cyrillic}} -- X.org public domain Cyrillic fonts for screen use
font-noto-carian
* {{pkg|font-misc-ethiopic}} -- Ethiopic fonts used in Ethiopia and Eritrea
font-noto-chakma
* {{pkg|font-misc-misc}} -- Bitmap fonts in PCF format (shows glyphs of many types and installed by default by xorg-server package)
font-noto-cherokee
* [https://www.rockbox.org/mail/archive/rockbox-dev-archive-2005-12/0029.shtml ClearlyU fonts] - {{pkg|font-mutt-misc}} -- Thai, Ethiopic, Hebrew, Romanian, Persian, Korean Hangul, Greek, Persian, Russian/Slavic Cyrillic, Macedonian/Serbian, Armenian, Georgian, Lao, Devanagari, Urdu (Hindustani as in Northern India and Pakistan), Cherokee, Thaana. See link to changelog for full list of languages supported.
font-noto-cypriot
* [https://en.wikipedia.org/wiki/Overpass_(typeface) Overpass] - {{pkg|font-overpass}}
font-noto-deseret
* [https://en.wikipedia.org/wiki/Luxi_fonts Luxi fonts] - {{pkg|font-bh-*}} -- designed by Kris Holmes and Charles Bigelow which bh is refers to the last name
font-noto-devanagari (Hindi / Sanskrit)
* [https://directory.fsf.org/wiki/IPAfont IPA Font] - {{pkg|font-ipa}} -- A Japanese font
font-noto-emoji
* [https://en.wikipedia.org/wiki/Croscore_fonts Chrome OS core fonts] - {{pkg|font-croscore}}
  font-noto-ethiopic
* [http://vollkorn-typeface.com/ Vollkorn] - {{pkg|font-vollkorn}} - A serif font with glyphs for Cyrillic (Russian/Slavic), Greek, Polish, Dutch, Bulgarian, Serbian, and small capitals
font-noto-extra
* [https://en.wikipedia.org/wiki/Open_Sans Open Sans] - {{pkg|font-opensans}}
font-noto-georgian
* [https://en.wikipedia.org/wiki/Cantarell_(typeface) Cantarell] - {{pkg|font-cantarell}} -- Designed for reading and the default GNOME font
font-noto-glagolitic
* [https://en.wikipedia.org/wiki/DejaVu_fonts DejaVu] - {{pkg|font-dejavu}} -- A modified Bitstream Vera with more styles and unicode coverage
font-noto-gothic
* [https://en.wikipedia.org/wiki/Linux_Libertine Linux Libertine] - {{pkg|font-linux-libertine}} -- A free alternative to Times New Roman
font-noto-gujarati
* [https://en.wikipedia.org/wiki/Liberation_fonts Liberation] {{pkg|font-liberation}} -- A free alternative to Helvetica and Arial
font-noto-gurmukhi
* [https://en.wikipedia.org/wiki/Inconsolata Inconsolata] - {{pkg|font-inconsolata}} -- A monospace font designed for terminals and reading source code
font-noto-hebrew
* [https://madmalik.github.io/mononoki/ mononoki] - {{pkg|font-mononoki}} -- A font for programming and code review
font-noto-kannada
* [https://en.wikipedia.org/wiki/Droid_fonts Droid] - {{pkg|font-droid}} / {{pkg|font-droid-nonlatin}} -- Designed for small screens and was used in older Android
font-noto-kayahli
* {{pkg|font-schumacher-misc}} -- Fixed width fonts by Dale Schumacher
font-noto-khmer
* {{pkg|font-sony-misc}} -- Japanese Kana fonts by Sony Electronics
font-noto-lao
* {{pkg|font-cursor-misc}} -- A standard cursor font
font-noto-lisu
* {{pkg|font-sun-misc}} -- Cursor and glyph fonts by Sun Microsystems
font-noto-malayalam
* {{pkg|font-winitzki-cyrillic}} -- A Cyrillic (Russian) font by Serge Winitzki designed for proofreading mixed Russian-English text
font-noto-mandaic
* {{pkg|font-isas-misc}} -- Chinese Song Ti style fonts (thinner horizontal lines compared to vertical)
font-noto-myanmar
* {{pkg|font-jis-misc}} -- A Japanese International Standard font
font-noto-nko
* [https://en.wikipedia.org/wiki/Courier_(typeface)#IBM_Courier IBM Courier] {{pkg|font-ibm-type1}}
font-noto-olchiki
* {{pkg|font-dec-misc}} -- A Digital Equipment Corporation cursor and session fonts
font-noto-oldturkic
* {{pkg|font-cronyx-cyrillic}} -- A Russian font for X11 by Cronyx
font-noto-oriya
* {{pkg|font-arabic-misc}} -- A bitmap and proportional Arabic font in newspaper style [https://unicode.org/mail-arch/unicode-ml/Archives-Old/UML010/0237.html ]
font-noto-osage
font-noto-osmanya
font-noto-shavian
font-noto-sinhala
font-noto-tamil
font-noto-telugu
font-noto-thaana
font-noto-thai
font-noto-tibetan
font-noto-tifinagh
  font-noto-vai
* [https://terminus-font.sourceforge.net/ Terminus] - font-terminus -- Monospace font
* [https://mirrors.ibiblio.org/CTAN/systems/win32/bakoma/fonts/fonts.html BaKoMa] font-bakoma-* -- Fonts for TeX typesetting system (for academics in the math and sciences and book writers) and TeX (WYSIWYG) editors
* [https://en.wikipedia.org/wiki/Bitstream_Speedo_Fonts Bitstream Speedo] - font-bitstream-speedo
* [https://en.wikipedia.org/wiki/Bitstream_Vera Bitstream Vera] font-bitstream-*
* [https://en.wikipedia.org/wiki/Bitstream_Vera Bera (Bitstream Vera Type 1)] - font-bitstream-type1 -- Use for LaTeX
* [https://fontawesome.com/ Font Awesome] - font-awesome -- It was used in Twitter Bootstrap.  It is a font representing things and brands as Icons.
* [https://www.gnu.org/software/freefont/ GNU FreeFont] - font-freefont -- See link for support for different writing systems/languages
* [https://savannah.gnu.org/projects/unifont/ GNU Unifont] - unifont -- It contains glyphs of every codepoint
* font-misc-cyrillic -- Cyrillic fonts (Russian/Slavic Style)
* font-screen-cyrillic -- X.org public domain Cyrillic fonts for screen use
* font-misc-ethiopic -- Ethiopic fonts used in Ethiopia and Eritrea
* font-misc-meltho -- For the Syriac language
* font-misc-misc -- Bitmap fonts in PCF format (shows glyphs of many types and installed by default by xorg-server package)
* [https://www.rockbox.org/mail/archive/rockbox-dev-archive-2005-12/0029.shtml ClearlyU fonts] - font-mutt-misc -- Thai, Ethiopic, Hebrew, Romanian, Persian, Korean Hangul, Greek, Persian, Russian/Slavic Cyrillic, Macedonian/Serbian, Armenian, Georgian, Lao, Devanagari, Urdu (Hindustani as in Northern India and Pakistan), Cherokee, Thaana.  See link to changelog for full list of languages supported.
* [https://github.com/lucy/tewi-font tewi font] font-tewi - A tiny bitmap font that contains braille glyphs
* [https://en.wikipedia.org/wiki/Overpass_(typeface) Overpass] - font-overpass
* [https://en.wikipedia.org/wiki/Luxi_fonts Luxi fonts] - font-bh-* -- designed by Kris Holmes and Charles Bigelow which bh is refers to the last name
* [https://en.wikipedia.org/wiki/Lucida#Lucida_Typewriter_Serif Lucida Typewriter] - font-bh-lucidatypewriter-*
* [https://directory.fsf.org/wiki/IPAfont IPA Font] - font-ipa -- A Japanese font
* [https://en.wikipedia.org/wiki/Croscore_fonts Chrome OS core fonts] - font-croscore
* [http://vollkorn-typeface.com/ Vollkorn] - font-vollkorn - A serif font with glyphs for Cyrillic (Russian/Slavic), Greek, Polish, Dutch, Bulgarian, Serbian, and small capitals
* [https://en.wikipedia.org/wiki/Open_Sans Open Sans] - font-opensans
* [https://en.wikipedia.org/wiki/Cantarell_(typeface) Cantarell] - font-cantarell -- Designed for reading and the default GNOME font
* [https://en.wikipedia.org/wiki/DejaVu_fonts DejaVu] - font-dejavu -- A modified Bitstream Vera with more styles and unicode coverage
* [https://en.wikipedia.org/wiki/Linux_Libertine Linux Libertine] - font-linux-libertine -- A free alternative to Times New Roman
* [https://en.wikipedia.org/wiki/Liberation_fonts Liberation] font-liberation -- A free alternative to Helvetica and Arial
* [https://en.wikipedia.org/wiki/Inconsolata Inconsolata] - font-inconsolata -- A monospace font designed for terminals and reading source code
* [https://madmalik.github.io/mononoki/ mononoki] - font-mononoki -- A font for programming and code review
* [https://en.wikipedia.org/wiki/Droid_fonts Droid] - font-droid / font-droid-nonlatin -- Designed for small screens and was used in older Android
* font-schumacher-misc -- Fixed width fonts by Dale Schumacher
* font-sony-misc -- Japanese Kana fonts by Sony Electronics
* font-daewoo-misc -- JIS (Japanese Industrial Standards) Kanji and Korean Hangul fonts by Daewoo Electronics
* font-cursor-misc -- A standard cursor font
* font-sun-misc -- Cursor and glyph fonts by Sun Microsystems
* font-winitzki-cyrillic -- A Cyrillic (Russian) font by Serge Winitzki designed for proofreading mixed Russian-English text
* font-isas-misc -- Chinese Song Ti style fonts (thinner horizontal lines compared to vertical)
* font-jis-misc -- A Japanese International Standard font
* [https://en.wikipedia.org/wiki/Courier_(typeface)#IBM_Courier IBM Courier] font-ibm-type1
* font-dec-misc -- A Digital Equipment Corporation cursor and session fonts
* font-cronyx-cyrillic -- A Russian font for X11 by Cronyx
* font-arabic-misc -- A bitmap and proportional Arabic font in newspaper style [https://unicode.org/mail-arch/unicode-ml/Archives-Old/UML010/0237.html ]


==Non-free fonts==
==Non-free fonts==
Line 187: Line 135:
The default font may be too small on high-resolution monitors, e.g. 4K ones. To change the default font, e.g. to the 32px ISO Latin-1 Terminus font:
The default font may be too small on high-resolution monitors, e.g. 4K ones. To change the default font, e.g. to the 32px ISO Latin-1 Terminus font:


# {{cmd|# apk add terminus-font}}
# {{cmd|# apk add {{pkg|font-terminus}}}}
# try out fonts in a virtual console using <code># setfont /usr/share/consolefonts/ter-132n.psf.gz</code>
# try out fonts in a virtual console using <code># setfont /usr/share/consolefonts/ter-132n.psf.gz</code>
# edit {{path|/etc/conf.d/consolefont}}, set it to the font you choose, e.g. <code>consolefont="ter-132n.psf.gz"</code>
# edit {{path|/etc/conf.d/consolefont}}, set it to the font you choose, e.g. <code>consolefont="ter-132n.psf.gz"</code>
# enable this using <code># rc-update add consolefont boot</code>
# enable this using <code># rc-update add consolefont boot</code>
== Changing GRUB font and font size ==
The font in the GRUB boot screen might also be too small on high-resolution monitors. In order to change the default font and font size, you first need install ''grub-mkfont'':
{{cmd|# apk add {{pkg|grub-mkfont}}}}
Then you can choose one of the fonts in {{path|/usr/share/fonts}}, e.g. {{path|/usr/share/fonts/inconsolata/Inconsolata-Regular.otf}}. Then you can create a grub font with the desired size:
{{cmd|# grub-mkfont -s32 /usr/share/fonts/inconsolata/Inconsolata-Regular.otf -o /boot/grub/fonts/inconsolata-32.pf2}}
Here we are using size 32 but you can adjust it.
After creating the font you need to edit {{path|/etc/default/grub}} and add the configuration with the path for your selected font, e.g. {{path| /boot/grub/fonts/inconsolata-32.pf2}}:
<code>GRUB_FONT=/boot/grub/fonts/inconsolata-32.pf2</code>
Finally you can run
{{cmd|# update-grub}}
and then you can reboot your system.


== See Also ==
== See Also ==

Latest revision as of 23:45, 28 February 2024

Fonts on Alpine Linux covers a wide range of various languages. If you can't see your language, you need to install the font that has glyphs (little picture) created for it. The square box called a substitute character or "tofu" that acts as a placeholder for missing a glyph usually with a two byte sequence. Tofu is a prepared food that is a traditional part of East Asian and Southeast Asian meals. It is often served in a white rectangular appearance.


Note: The system font directory is located at /usr/share/fonts which is reserved for the Alpine package creators and the package system. The user font location is located in ~/.fonts which is the preferred install font location especially from unknown sources. Fonts have been used as a source of security exploits (See CVEs) so to reduce the spread of attack install fonts inside ~/.fonts. The trusted system fonts that Alpine Linux packages typically are from well known sources like corporations like Google, Adobe, open organizations like Xorg or well known font designers or projects licensed as either SIL, GPL, etc.


Installation

Default internal fb fonts (tty console) or xorg fonts (desktops) are suitable for a default installation. font-misc-misc is installed with Xorg, so fonts for most languages (Japanese, Korean, Latin, Cyrillic) are already covered. Exceptions are Arabic, Persian, Thai, Tamil, etc. according to the Wikipedia Page on languages for article translation.


These selections will cover most languages and are a good fit for most setups:

# apk add font-terminus font-inconsolata font-dejavu font-noto font-noto-cjk font-awesome font-noto-extra


These selections add special support for cyrillic languages like Russian and Serbian, etc.:

# apk add font-vollkorn font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic


These selections cover special Asiatic languages like Japanese, etc.:

# apk add font-terminus font-noto font-noto-thai font-noto-tibetan font-ipa font-sony-misc font-jis-misc


The following will add some partially supported Chinese fonts:

# apk add font-isas-misc


These selection will cover, in general Arabic, Thai, Ethiopic, Hebrew, Romanian, Persian, Korean Hangul, Greek, Persian, Russian/Slavic Cyrillic, Macedonian/Serbian, Armenian, Georgian, Lao, Devanagari, Urdu (Hindustani as in Northern India and Pakistan), Cherokee, Thaana languages support for desktop setups:

# apk add font-terminus font-noto font-noto-extra font-arabic-misc # apk add font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic # apk add font-noto-arabic font-noto-armenian font-noto-cherokee font-noto-devanagari font-noto-ethiopic font-noto-georgian # apk add font-noto-hebrew font-noto-lao font-noto-malayalam font-noto-tamil font-noto-thaana font-noto-thai


Configuration

fc-cache -fv can be used to display the font locations and to update the cache.


Some applications do not specify a specific font to use but rather say sans-serif [sans means without as in without tiny lines], serif, monospace [as in proportional square font]. This is where Fontconfig comes into place by substituting the general font type with a specific font that you like. For package developers, /etc/fonts/conf.avail contains a fontconfig configuration file. This will be symlinked into /etc/fonts/conf.d. See /etc/fonts/conf.d/README for details about the meaning behind the priority numbers.

For regular users, you want to create/edit your personal ~/.fonts.conf. This is in XML and describes which preferred font to use for these general types. See this for details.


Per-user Configuration is made in ~/.fonts.conf but it's hard to configure. An easier method is to use the ~/.Xresources file.

The following will set up for all users, a minimal resource usage for fonts. No antialiasing. No hint, etc:

# cat > /home/*/.Xresources << EOF Xft.antialias: 0 Xft.rgba: rgb Xft.autohint: 0 Xft.hinting: 1 Xft.hintstyle: hintslight EOF


List of fonts in Alpine Linux

Non-free fonts

 Arial
 Arial Black
 Andalé Mono
 Courier New
 Comic Sans MS
 Georgia
 Impact
 Times New Roman
 Trebuchet MS
 Verdana
 Webdings

Changing the console font

The default font may be too small on high-resolution monitors, e.g. 4K ones. To change the default font, e.g. to the 32px ISO Latin-1 Terminus font:

  1. # apk add font-terminus

  2. try out fonts in a virtual console using # setfont /usr/share/consolefonts/ter-132n.psf.gz
  3. edit /etc/conf.d/consolefont, set it to the font you choose, e.g. consolefont="ter-132n.psf.gz"
  4. enable this using # rc-update add consolefont boot

Changing GRUB font and font size

The font in the GRUB boot screen might also be too small on high-resolution monitors. In order to change the default font and font size, you first need install grub-mkfont:

# apk add grub-mkfont

Then you can choose one of the fonts in /usr/share/fonts, e.g. /usr/share/fonts/inconsolata/Inconsolata-Regular.otf. Then you can create a grub font with the desired size:

# grub-mkfont -s32 /usr/share/fonts/inconsolata/Inconsolata-Regular.otf -o /boot/grub/fonts/inconsolata-32.pf2

Here we are using size 32 but you can adjust it.

After creating the font you need to edit /etc/default/grub and add the configuration with the path for your selected font, e.g. /boot/grub/fonts/inconsolata-32.pf2:

GRUB_FONT=/boot/grub/fonts/inconsolata-32.pf2

Finally you can run

# update-grub

and then you can reboot your system.

See Also