0

I am trying to install the Cantarell font Software from GNU. I am running a Macbook Air M1 with Monterey 12.5.

They provide instructions:

python3 -m venv venv
. venv/bin/activate  # Unixoids...
venv/Scripts/activate  # ...or on Windows cmd.exe or PowerShell

pip3 install meson ninja # Unless already present on system. pip3 install -r requirements.txt

meson build ninja -C build install

I tried to replicate:

pedro@Pedros-MacBook-Air ~ % python3 -m venv venv                   
pedro@Pedros-MacBook-Air ~ % . venv/bin/activate               
(venv) pedro@Pedros-MacBook-Air ~ % pip3 install meson ninja
Requirement already satisfied: meson in ./venv/lib/python3.8/site-packages (0.63.0)
Requirement already satisfied: ninja in ./venv/lib/python3.8/site-packages (1.10.2.3)
(venv) pedro@Pedros-MacBook-Air ~ % pip3 install -r requirements.txt
(venv) pedro@Pedros-MacBook-Air ~ % meson build

ERROR: Neither directory contains a build file meson.build.

(venv) pedro@Pedros-MacBook-Air ~ % ninja -C build install ninja: Entering directory `build' ninja: error: loading 'build.ninja': No such file or directory (venv) pedro@Pedros-MacBook-Air ~ %

It is not working. Are there better instructions for using this font face on macOS?

;;;; UPDATE

@Riley4067440653 is trying to help and gave great suggestions.

Things were going well until meson build:

(venv) Pedros-MacBook-Air:cantarell-fonts-master pedro$ meson build
The Meson build system
Version: 0.63.0
Source dir: /Users/pedro/Downloads/cantarell-fonts-master
Build dir: /Users/pedro/Downloads/cantarell-fonts-master/build
Build type: native build
Project name: cantarell-fonts
Project version: 0.303
Host machine cpu family: aarch64
Host machine cpu: arm64
Program python3 found: YES (/Users/pedro/Downloads/cantarell-fonts-master/venv/bin/python3)
Program psautohint found: YES (/Users/pedro/Downloads/cantarell-fonts-master/venv/bin/psautohint)
Program msgfmt found: NO

appstream/meson.build:3:0: ERROR: Program 'msgfmt' not found or not executable

A full log can be found at /Users/pedro/Downloads/cantarell-fonts-master/build/meson-logs/meson-log.txt

Also, I cannot find the recommended path.There is no usr/local/share, only user/local/bin:

(venv) Pedros-MacBook-Air:local pedro$ pwd
/usr/local
(venv) Pedros-MacBook-Air:local pedro$ ls -1
bin

Not only on the virtual env created but also on the "real env" created, there is not the recommended path of usr/local/share, only user/local/bin:

Pedros-MacBook-Air:local pedro$ pwd
/usr/local
Pedros-MacBook-Air:local pedro$ ls -1
bin

1 Answers1

1

I've tried following the repo's instruction and similarly wasn't able to install the fonts at first. I eventually got it to work with a workaround. My machine is an M1 Mac running macOS 12.5.

My answer assumes that you only want the .otf font files to install the font on your machine, and don't want to install the project for development purposes.

a. EDIT it seems that msgfmt is a utility which isn't installed by default on macOS, nor is it installed automatically when one goes through the steps provided by the project maintainers. To install the utility first install homebrew, and then run brew install gettext.

  1. Download the project. The repo you linked seems to be an out-of-date mirror, the latest version can be found on the GNOME GitLab, as of writing the latest version is v0.303. Click the download button (icon with an arrow pointing downward, top right of the page) and download the zipped repository. Unzip the repo in Finder (double-click it).

  2. Use Finder to open the unzipped cantarell folder.

    • Open the file meson_options.txt with TextEdit.app or an editor of your choice; edit line 10 to say option('buildstatics', type : 'boolean', value : true, and edit line 13 to say option('buildvf', type : 'boolean', value : false, (so, swap line 10 to true and line 13 to false), save the edited file. [^1]

    • Open the file requirements.txt; edit line 19 to say only cffsubr, and edit line 48 to say only skia-pathops (so, remove the ==VERSION from both), save the edited file. [^2]

  3. Open Terminal and change directory to the unzipped repo folder. Most likely you will use the command cd ~/Downloads/cantarell-fonts-v0.303. You can find a short tutorial on changing directories here. Your terminal prompt should now show that you're in the cantarell folder you unzipped before. In the same terminal window run the following commands:

    python3 -m venv venv
    

    . venv/bin/activate

    pip3 install --upgrade pip setuptools wheel

    pip3 install meson ninja --no-cache-dir

    pip3 install -r requirements.txt --no-cache-dir

    meson build

    ninja -C build install

  4. The build and install should have succeeded. Open Finder, and use the menu bar to click 'Go -> Go to folder...' or use the keyboard shortcut ⌘ command + shift + G, then paste in the directory where the fonts have been installed, which should be /usr/local/share/fonts/cantarell, press the return key to navigate there. In this folder you'll see five Cantarell-*.otf files, select all and double-click, or double-click each of them and press the 'Install Font' button in the Font Book window that opens.

  5. The Cantarell font and all five of its weights are now available to use system-wide.

[^1] Building the variable font produced a font file with missing glyphs for me.

[^2] On my machine the pip install failed because of these specific versions of the dependencies, removing the version constraint worked for me.

  • Thank you very much for trying to help. Things were going well. But, unfortunately, it did not work out. First problem was after: meson buildwhich returned: (venv) Pedros-MacBook-Air:cantarell-fonts-master pedro$ meson build The Meson build system Version: 0.63.0 Source dir: /Users/pedro/Downloads/cantarell-fonts-master Build dir: /Users/pedro/Downloads/cantarell-fonts-master/build Build type: native build Project name: cantarell-fonts Project version: 0.303 Host machine cpu family: aarch64 Host machine cpu: arm64 – Pedro Delfino Aug 03 '22 at 11:04
  • 1
    @PedroDelfino where did you run into problems? – Riley4067440653 Aug 03 '22 at 11:06
  • Also: `Program python3 found: YES Program psautohint found: YES Program msgfmt found: NO

    appstream/meson.build:3:0: ERROR: Program 'msgfmt' not found or not executable `

    – Pedro Delfino Aug 03 '22 at 11:09
  • There is not much space on comments. Thus, I am pasting it multiple times. – Pedro Delfino Aug 03 '22 at 11:09
  • Please, see my updated question. – Pedro Delfino Aug 03 '22 at 11:21
  • 1
    msgfmt is a utility which doesn't seem to be installed when one goes through the steps provided by the project maintainers, it happened to be installed on my machine already which might be why it succeeded for me. To install the utility first install homebrew, and then run brew install gettext. This might take you a step further. – Riley4067440653 Aug 03 '22 at 11:26
  • Thanks. It was an evolution with Program msgfmt found: YES (/opt/homebrew/bin/msgfmt). But, now, this permission problem is happening: PermissionError: [Errno 13] Permission denied: '/usr/local/share' FAILED: meson-internal__install – Pedro Delfino Aug 03 '22 at 11:38
  • 1
    Does /usr/local/share exist? Run mkdir -p /usr/local/share to create it if it does not exist. Check if you have sufficient permissions to work in the directory, see this question for more info. – Riley4067440653 Aug 03 '22 at 13:00
  • Wtf. I went to do what you said, bud now it exists! Maybe I need to refresh this macOS terminal after executing some commands? – Pedro Delfino Aug 03 '22 at 13:53
  • 1
    The installation seems to be fine. I will re-start the mac and see if Emacs will successfully use it. – Pedro Delfino Aug 03 '22 at 14:11