How to install and remove FONTS in Linux; UTF-8

January 14, 2012

updated 2018-09-15

Just like Windoze, Fedora (and Ubuntu) throws in a 100 fonts you don’t want and will never use.

All, system-wide, fonts in Fedora, Linux, are in /usr/share/fonts/
for example
/usr/share/fonts/google*
/usr/share/fonts/kacst/
/usr/share/fonts/smc/
/usr/share/fonts/stix/

How to remove many extra Linux fonts

fedora 27-28 :
The biggest block of unwanted fonts is “Noto Sans …” It is a GOOGLE collection of fonts for many languages. However, by default they are currently used by fedora.

 

fedora 28, 27, 26, 25, …

the fonts that are used by fedora 28-27-2x are (google) noto-han-*
go to System Settings >> Fonts >> and change all the “noto”s to
something simple and generic – that you won’t want/need to delete.

the fonts that are used by fedora 24 are . . .
abattis-cantarell, (default?), and dejavu
I am not sure about fonts/default/*

Fonts can be uninstalled like software: go to System -> Administration -> Add/Remove Software -> Fonts (click on the Fonts category)
I removed many (all the) kacst and lohit and other un-needed foreign language fonts this way.

For what is left, just move them out and then run the fc-cache command (see ‘man fc-cache’)

for example, create a ~/fonts-fedora folder (plus)

mkdir /home/[you]/fonts-fedora

then, log in as root (su -) and move out just some of the un-needed, unused fonts:

cd /usr/share/fonts/
mv google* /home/[you]/fonts-fedora/
mv jomo*   /home/[you]/fonts-fedora/
mv juliet* /home/[you]/fonts-fedora/
mv khme*   /home/[you]/fonts-fedora/
mv liber*  /home/[you]/fonts-fedora/
mv lohit*  /home/[you]/fonts-fedora/
mv naver*  /home/[you]/fonts-fedora/
mv opens*  /home/[you]/fonts-fedora/
mv pak*    /home/[you]/fonts-fedora/
mv para*   /home/[you]/fonts-fedora/
mv sil-*   /home/[you]/fonts-fedora/
mv smc     /home/[you]/fonts-fedora/
mv thai-*  /home/[you]/fonts-fedora/
mv wqy-*   /home/[you]/fonts-fedora/
mv vlgo*   /home/[you]/fonts-fedora/

fc-cache -v (v=verbose)

note: liberation fonts are supposed to be substitutes for Windoze courier new, arial, and times-new-roman, but, web site designers know nothing of this and, especially, if you still have windows on one of your computer anyway, just copy those few from windows and use them. You paid for them.
Example: Arial, Courier New, Georgia, Tahoma, Times New Roman, and Verdana

         fonts-web-windoze/

    bytes --- date --- font-name  
   352224 Aug 10  2004 arialbd.ttf
   226748 Aug 10  2004 arialbi.ttf
   207808 Aug 10  2004 ariali.ttf
   138468 May 28  1998 arialNarrowB.ttf
   141328 May 28  1998 arialNarrowI.ttf
   134188 May 28  1998 arialNarrow.ttf
   367112 Aug 10  2004 arial.ttf
   312920 Aug 10  2004 courNewbd.ttf
   236148 Aug 10  2004 courNewbi.ttf
   245032 Aug 10  2004 courNewi.ttf
   303296 Aug 10  2004 courNew.ttf
   145940 Jun 10  2009 georgiab.ttf
   162380 Jun 10  2009 georgiai.ttf
   157080 Jun 10  2009 georgia.ttf
   164332 Jun 10  2009 georgiaz.ttf
   355436 Aug 10  2004 tahomabd.ttf
   383140 Aug 10  2004 tahoma.ttf
   398372 Aug 10  2004 timesbd.ttf
   239692 Aug 10  2004 timesbi.ttf
   248368 Aug 10  2004 timesi.ttf
   409280 Aug 10  2004 times.ttf
   137616 Aug 10  2004 verdanab.ttf
   155076 Aug 10  2004 verdanai.ttf
   171792 Aug 10  2004 verdana.ttf
   154800 Aug 10  2004 verdanaz.ttf
 

To activate these and any personal fonts you have, they should be copied into your /home/[you]/.fonts folder. Create it if it does not yet exist.

in the end, you might have something like these 2 folders

/home/greg/.fonts/web-windoze/
/home/greg/.fonts/greg-personal/

To add fonts system-wide, create a folder for them under /usr/share/fonts/
copy them into the folder. It is a good idea to create a new subdirectory, such as local/ or [your-name], etc., to help distinguish between yours and default installed fonts.
To add fonts for yourself, copy the new fonts into a folder under the .fonts/ folder
in the user’s home directory.

Use the fc-cache command to update the font information cache, as in the following
example: fc-cache -v ( -v for verbose just to see it work)
The command loads into memory, fonts from both /usr/share/fonts/ and /home/[you]/.fonts/

Note:
if a font file name ends with a .gz extension, it is compressed and cannot be used until uncompressed.

example: keep your personal favorite fonts in folders in /home/[you]/fonts-favorites/
then at /usr/share/fonts/

on your desktop, open your “computer” icon (with your file browser, Nautilus) and mount your windows partition, copy out a minimal set of C:/windows/fonts/* that every web site expects,
like Arial, Courier New, Georgia, Tahoma, Times New Roman, and Verdana

mkdir web-windoze

cp -p /home/greg/fonts-windoze/gks-windoze/* web-windoze/

very good!:
best common fonts: http://www.theinternetdigest.net/archive/websafefonts.html
Courier is not scalable. Therefore the scalable “Courier New” is preferred

http://www.angelfire.com/al4/rcollins/style/fonts.html web site concerns mentioned

Verdana: Possibly the most readable of the sans-serif fonts commissioned by Microsoft for on-screen use. However, Verdana shouldn’t be used side-by-side with same-sized serif fonts, because Verdana will appear one or two sizes larger.
Verdana: An exceptionally clear font for both print and screen. It has an unusually large x-height and broad body, which combine with the built-in hinting to make it the clearest of the Web-safe font set for small text.
Helvetica: [Arial on Mac & Linux] One of the most popular fonts with Mac users and designers is Helvetica, which is also common on Linux.

Georgia: is a serif font designed by Matthew Carter for both Web and print use. It remains exceptionally clear right down to 9 points, and is a good replacement for Times New Roman.


I have read some users do not like the default font rendering and go to …
System -> Preferences -> Appearance -> Fonts (tab)


 

UTF-8 Fonts

Until fonts include enough UTF-8 characters to handle accents on characters and more, and Microsloth Windoze gives up and goes to UTF-8, we will all still encounter files off the internet and etc. using the incompetent, woefully inadequate, 8th bit, for accented characters and we will have to use the linux conversion command iconv to convert them to UTF-8
example, convert an ISO-8859-15 file:
iconv -f ISO885915 -t UTF8 readme.txt > readme2.txt


find . -type f -exec file --mime {} \; | grep "charset=utf-16"

ASCII, ISO-8859-x, non-ISO 8-bit extended-ASCII character sets (such as those used on Macintosh and IBM PC systems), UTF-8-encoded Unicode, UTF-16-encoded Unicode, and EBCDIC character sets can be distinguished by the different ranges and sequences of bytes that constitute printable text in each set. If a file passes any of these tests, its character set is reported.

you can use enca if you have it

enca -L none * 2>/dev/null | grep -i "Universal character"

A script that to find UTF-16 files, and subsequently convert them to UTF-8.

#!/bin/sh
find ./ -type f |
while read file; do
if [ "`head -c 2 -- "$file"`" == $'\xff\xfe' ]
then
echo "Problems with: $file"
# If you want to convert to UTF-8 uncomment these lines.
#cat "$file" | iconv -f UTF-16 -t UTF-8 > "$file.tmp"
#mv -f "$file.tmp" "$file"
fi
done

Comments are closed.

We try to post all comments within 1 business day