Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add font installation instructions for Linux #17

Closed
miguelsousa opened this issue Sep 27, 2012 · 28 comments
Closed

Add font installation instructions for Linux #17

miguelsousa opened this issue Sep 27, 2012 · 28 comments

Comments

@miguelsousa
Copy link
Member

No description provided.

@leutloff
Copy link

In principal it is the same in Ubuntu 12.04 as in Win7:

  • Unzip the font files from the downloaded archive.
  • Select the single font or multiple fonts for installation in the file manager.
  • Right click the selection and choose "Open with Font Viewer" (I am not sure about the exact wording, but in German it is called "Mit Font Viewer öffnen").
  • The Font Viewer shows the font and provides a "Install Font" button.
  • Clicking the "Install Font" button installs the Font.

btw. I am using the Source Code Pro now happily in Qt Creator 2.5. Thanks a lot!

@mfoo
Copy link

mfoo commented Sep 28, 2012

This is not always the case. My Font Viewer application didn't have permission to write to the fonts directory, and it's a pain to mass import fonts this way!

For system wide installation, copy the fonts to /usr/share/fonts and run sudo fc-cache to rebuild the font cache, or for user local installation, make sure ~/.fonts exists, copy them into there, then rebuild the font cache.

@ppicazo
Copy link

ppicazo commented Sep 28, 2012

Providing installation instructions which encompass all flavors of *nix (and other operating systems) is a slippery slope and outside domain of this project in my opinion. The installation is no different than other open type or true type fonts, for which much documentation exists already.

Example Google search results:

I would recommend that the generic instructions provided by @mfoo be included in (or linked from) the projects documentation, but leave distribution / version specific installation details the responsibility of the user to investigate.

@crayzeewulf
Copy link

On Fedora 20, you can install these fonts using the following command:

sudo yum install adobe-source-code-pro-fonts

See this page for more details.

@foozlevazquez
Copy link

Ubuntu 14.04:

[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype
sudo git clone https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp
sudo fc-cache -f -v

@yngwin
Copy link

yngwin commented Mar 15, 2015

On Gentoo:

emerge -av source-pro

Set the cjk useflag if source-han-sans is also wanted. Set appropriate LINGUAS flags for the regional subsets of Source Han Sans.

@eksperimental
Copy link

@foozlevazquez i would add this line to the ubuntu instructions:
sudo rm -rf /usr/share/fonts/opentype/scp/.git*

@mykolaj
Copy link

mykolaj commented Mar 18, 2015

@eksperimental no need to remove git repository, because it allows to download any updates by executing 'git pull'

@denji
Copy link

denji commented May 17, 2015

#!/bin/sh
# Userland mode (~$USER/), (~/).

# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts

echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
# find "$FONT_HOME" -iname '*.ttf' -exec echo '{}' \;

(git clone \
   --branch release \
   --depth 1 \
   'https://github.com/adobe-fonts/source-code-pro.git' \
   "$FONT_HOME/adobe-fonts/source-code-pro" && \
fc-cache -f -v "$FONT_HOME/adobe-fonts/source-code-pro")

@joke2k
Copy link

joke2k commented Sep 20, 2015

Maybe we can use -b master in order to clone only the master branch instead of all repository.

git clone -b master https://github.com/adobe-fonts/source-code-pro.git ~/.fonts/adobe-fonts/source-code-pro

@miguelsousa
Copy link
Member Author

@joke2k You should clone the release branch instead, because that's where the OTFs and TTFs are located.

@rotty3000
Copy link

I used this shortened version of @denji's script:

git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git ~/.fonts/adobe-fonts/source-code-pro
fc-cache -f -v ~/.fonts/adobe-fonts/source-code-pro

HTH

@bernardosulzbach
Copy link

bernardosulzbach commented May 9, 2016

Just in case a Fedora user is reading this, in newer Fedora versions you can use

sudo dnf install adobe-source-code-pro-fonts

Painless, 1 MB download and installation.

@divansantana
Copy link

divansantana commented May 20, 2016

Arch Linux

 sudo pacman -S adobe-source-code-pro-fonts

or

 yaourt adobe-source-code-pro-fonts

@deb0ch
Copy link

deb0ch commented Jun 4, 2016

@denji @rotty3000 @foozlevazquez : On ubuntu 16.04 when I tried like you to just clone the repo, put it somewhere fc-cache will look for it (i.e. ~/.local/share/fonts, ~/.local/share/fonts/opentype, /usr/share/fonts or /usr/share/fonts/opentype) and run fc-cache -f -v, characters in that font are just displayed as squares (see screenshot).

I believe it is because I did not built the fonts from source (for which I miss the building tools like mkotf).

Seeing your instructions, you seem to have just cloned the repo, ran fc-cache -f -v and boom, it automagically worked.

Am I right ? Or what did I miss ?

screenshot from 2016-06-04 14-26-40

EDIT: I figured out the problem. Apparently you have to checkout the release branch. I was doomed because I was on master and then on new-release.

Be sure to checkout the release branch or you can simply download the release binaries instead of cloning the entire repo.

@wiserfirst
Copy link

For Ubuntu 14.04 (based @foozlevazquez's answer, just clone the release branch)

[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype
sudo git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp
sudo fc-cache -f -v

@jickding
Copy link

how to install on freebsd base xface4

@AbigailBuccaneer
Copy link

AbigailBuccaneer commented Oct 27, 2016

This package is available via nixpkgs. To install it and make it available to applications, I did the following:

nix-env -i source-code-pro
mkdir -p "$HOME/.config/fontconfig"
cat > "$HOME/.config/fontconfig/fonts.conf" <<-EOF
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
        <dir>~/.nix-profile/share/fonts</dir>
    </fontconfig>
EOF
fc-cache -f -v

@jsejcksn
Copy link

jsejcksn commented Dec 3, 2016

I read that for local usage, ~/.fonts is now deprecated and that ~/.local/share/fonts should be used instead. This seems to be confirmed by Font Viewer installing them to that directory in Unity desktop. Is what I read correct?

@fangqiao
Copy link

fangqiao commented Feb 8, 2017

I upgraded emacs to 25 then spacemacs can't find Source Code Pro anymore. It worked on emacs 24.

I use debian the jessie.

After I reinstall 24.4, the font is loaded again.

@AbigailBuccaneer
Copy link

@fangqiao
Copy link

@AbigailBuccaneer Thanks for the tip. But my problem is not about installing code pro font. I installed it correctly and emacs 24 works well. But the problem is with emacs 25.1, the latest version of emacs. It couldn't find the font.

@SimonAM
Copy link

SimonAM commented Mar 23, 2017

@fangqiao I had the same problem. This fixed it:
sudo apt-get build-dep emacs24
If it complains about URI, do this first:
sudo sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && sudo sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list

@Vdragon
Copy link

Vdragon commented Apr 15, 2017

There's another issue that I encountered while trying to install Source Han Serif: There's no simple method to extract a multipart zip archive files.

@dpacmittal
Copy link

@foozlevazquez Your method has a horrible side-effect. For details, please see the bug that I filed with KDE -
https://bugs.kde.org/show_bug.cgi?id=378227

I would recommend you to edit your comment or removing it altogether.

@mckennapsean
Copy link

By following @foozlevazquez method of just cloning the repo, any application on linux that uses fonts would take 6s to load (due to scanning for fonts).

For the package maintainers, I scrolled down and found @foozlevazquez 's approach first, hence why I got stuck while trying to install. I love these fonts, and it would be great to point people to using the release branch when cloning/downloading. One such approach was posted by @wiserfirst . Thanks!

@Bost
Copy link

Bost commented Apr 30, 2019

If you compile / build emacs from the source, you need to

sudo apt install --yes libgtk2.0-dev

and

./configure --with-x-toolkit=gtk

After years of battling and/or ignoring this issue on and off I found the solution! Hip, Hip, Hurrah!!! Many thanx to:
https://stackoverflow.com/a/18154188
https://ubuntuforums.org/showthread.php?t=1607632

@oscarfv
Copy link

oscarfv commented Jul 10, 2019

@Bost : I build Emacs from source configured with --with-x-toolkit=lucid and can use this font just fine. Since I switch fonts often, I defined this convenience command:

(defun my-font-source-code-pro (size)
  (interactive "nFont size: ")
  (set-frame-font (format "Source Code Pro\-%d" size) t t))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests