Skip to content

Latest commit

 

History

History
398 lines (299 loc) · 10 KB

fonts.md

File metadata and controls

398 lines (299 loc) · 10 KB

Fonts

Description

This guide seeks to add more fonts and use better fonts for our desktop.

Important

This guide assumes that you are using KDE Plasma as your desktop environment.

Directory


Installation

Description

This details where we could get the fonts we need and how to install them.

References

Steps

  1. Clone the fonts repo:

    git clone https://github.com/irfanhakim-as/fonts.git
  2. Enter the repository:

    cd fonts
  3. Run the installer script to install the fonts:

    ./install.sh

Configuration

Description

This details several configuration options for our desktop to use better looking fonts we have installed.

Steps

  1. Create the fontconfig directory if it's not available already:

    mkdir -p ~/.config/fontconfig
  2. Create a backup of the original fonts config, fonts.conf (if any):

    cp ~/.config/fontconfig/fonts.conf ~/.config/fontconfig/fonts.conf.bak
  3. Create a new fonts.conf file:

    nano ~/.config/fontconfig/fonts.conf

    Add the following content to the new fonts.conf file:

    <?xml version='1.0'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
    <fontconfig>
     <alias>
      <family>sans-serif</family>
      <prefer>
       <family>SF Pro Text</family>
       <family>Apple Color Emoji</family>
       <family>Noto Color Emoji</family>
       <family>Noto Emoji</family>
      </prefer>
     </alias>
     <alias>
      <family>serif</family>
      <prefer>
       <family>New York</family>
       <family>Apple Color Emoji</family>
       <family>Noto Color Emoji</family>
       <family>Noto Emoji</family>
      </prefer>
     </alias>
     <alias>
      <family>monospace</family>
      <prefer>
       <family>SF Mono Powerline</family>
       <family>Apple Color Emoji</family>
       <family>Noto Color Emoji</family>
       <family>Noto Emoji</family>
      </prefer>
     </alias>
     <match target="font">
      <edit mode="assign" name="embeddedbitmap">
       <bool>false</bool>
      </edit>
     </match>
     <dir>~/.fonts</dir>
    </fontconfig>
    
  4. Edit the fonts used in the System Settings app under Appearance > Fonts:

    • General: SF Pro Text 12pt
    • Fixed width: SF Mono Powerline 12pt
    • Small: SF Compact 10pt
    • Toolbar: SF Pro Display 12pt
    • Menu: SF Pro Display 12pt
    • Window title: SF Pro Display 12pt

    You may adjust the font choices and sizes to your liking.

  5. Restart your system for the changes to take effect.


Emoji Support

Important

This guide is redundant and NOT needed if you have completed the Installation and Configuration sections.

Description

This details several configuration options for our desktop to use better looking fonts we have installed.

Steps

  1. Install an emoji font package using yay.

    • Install the ttf-twemoji package for the Twitter emoji.

    • Alternatively, install the ttf-apple-emoji package for the Apple emoji.

  2. Create the fontconfig directory if it's not available already:

    mkdir -p ~/.config/fontconfig
  3. Update or create a new fonts.conf file in the fontconfig directory:

    [!IMPORTANT]
    Backup the existing fonts.conf file as a new file i.e. fonts.conf.bak if any.

    nano ~/.config/fontconfig/fonts.conf

    Sample fonts.conf configuration for Twitter emoji:

    <?xml version='1.0'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
    <fontconfig>
        <alias>
            <family>sans-serif</family>
            <prefer>
                <family>Noto Sans</family>
                <family>Twemoji</family>
                <family>Noto Color Emoji</family>
                <family>Noto Emoji</family>
            </prefer>
        </alias>
        <alias>
            <family>serif</family>
            <prefer>
                <family>Noto Serif</family>
                <family>Twemoji</family>
                <family>Noto Color Emoji</family>
                <family>Noto Emoji</family>
            </prefer>
        </alias>
        <alias>
            <family>monospace</family>
            <prefer>
                <family>Noto Mono</family>
                <family>Twemoji</family>
                <family>Noto Color Emoji</family>
                <family>Noto Emoji</family>
            </prefer>
        </alias>
    </fontconfig>
    

    Alternatively, this is a sample fonts.conf configuration for Apple emoji instead:

    <?xml version='1.0'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
    <fontconfig>
        <alias>
            <family>sans-serif</family>
            <prefer>
                <family>Noto Sans</family>
                <family>Apple Color Emoji</family>
                <family>Noto Color Emoji</family>
                <family>Noto Emoji</family>
            </prefer>
        </alias>
        <alias>
            <family>serif</family>
            <prefer>
                <family>Noto Serif</family>
                <family>Apple Color Emoji</family>
                <family>Noto Color Emoji</family>
                <family>Noto Emoji</family>
            </prefer>
        </alias>
        <alias>
            <family>monospace</family>
            <prefer>
                <family>Noto Mono</family>
                <family>Apple Color Emoji</family>
                <family>Noto Color Emoji</family>
                <family>Noto Emoji</family>
            </prefer>
        </alias>
    </fontconfig>
    
  4. Refresh the font cache:

    fc-cache -f -v
    
  5. Log out and log back into the desktop.


Microsoft Fonts Support

Important

This guide is redundant and NOT needed if you have completed the Installation and Configuration sections.

Description

This details how to install and set up Microsoft Windows fonts on Linux.

Steps

  1. Install the ttf-ms-win10-auto package using yay to get Windows 10 fonts.

  2. Fix anti-aliasing issue with the Calibri font (looks pixelated by default).

    Create or update the fonts.conf file in the fontconfig directory:

    [!IMPORTANT]
    Backup the existing fonts.conf file as a new file i.e. fonts.conf.bak if any.

    nano ~/.config/fontconfig/fonts.conf

    Add the following match block to the end of the fonts.conf file just before the closing of the fontconfig tag:

    <match target="font">
        <edit name="embeddedbitmap" mode="assign">
            <bool>false</bool>
        </edit>
    </match>
    
  3. Log out and log back into the desktop.


Apple Fonts Support

Important

This guide is redundant and NOT needed if you have completed the Installation and Configuration sections.

Description

This details how to install and set up Apple macOS fonts on Linux.

References

Steps

  1. Install the apple-fonts package using yay to get Apple fonts.

  2. Set our fonts.conf config to use Apple fonts.

    Create or update the fonts.conf file in the fontconfig directory:

    [!IMPORTANT]
    Backup the existing fonts.conf file as a new file i.e. fonts.conf.bak if any.

    nano ~/.config/fontconfig/fonts.conf

    Replace the first preferred fonts of each family block in our config to SF Pro Text, New York, and SF Mono:

    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>SF Pro Text</family>
            <family>Apple Color Emoji</family>
            <family>Noto Color Emoji</family>
            <family>Noto Emoji</family>
        </prefer>
    </alias>
    <alias>
        <family>serif</family>
        <prefer>
            <family>New York</family>
            <family>Apple Color Emoji</family>
            <family>Noto Color Emoji</family>
            <family>Noto Emoji</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>SF Mono</family>
            <family>Apple Color Emoji</family>
            <family>Noto Color Emoji</family>
            <family>Noto Emoji</family>
        </prefer>
    </alias>
    
  3. Log out and log back into the desktop.


Improve Fonts Legibility

Caution

This might break certain fonts including Apple fonts/emoji recommended by this wiki, more testing is needed!

Note

This guide assumes that you are using KDE Plasma as your desktop environment.

Description

This improves how fonts and texts are rendered to make them clearer and more legible. Note that this might break Apple fonts/emoji.

Steps

  1. Launch the System Settings application.

  2. Click the Appearance category.

  3. Click Fonts.

  4. Configure the following settings as such:

    ✅ Enable Anti-Aliasing
    Sub-pixel rendering: RGB
    Hinting: Full
    
  5. Click the Apply button.