Suggestion : ujust install microsoft fonts

A ujust command to install msttcorefonts in the user /local/share/fonts folder would be appreciated.

Installing them is, for now, a convoluted process, unless I missed something. I needed to install Fedora in a container and, because cabextract wants to install them systemwide, dig for the temporary folder and copy it manually using the command line.

I need them for the usual reasons (some .docx documents will have a weird page layout if you do not have them installed).

A friend of mine asked me to help her to switch to Linux (and it will be Bluefin), because she will not be able to upgrade to Win11 (tpm), and it would make deployment so much easier. She’s a professional translator, so it’s not optional for her.

Thank you for considering this.

4 Likes

A ujust command would be great! I tried a slightly different way (on Aurora non-dx): I downloaded the .exe-Files with the MS-Fonts from github (you can find them also at sourceforge). Next I installed PeaZip from Flathub and created a .fonts-folder in my home-folder. Now I used Pea-Zip to open the .exe-files one by one and extract the .ttf-File to my .fonts-folder (rightclick “extract to”… but I had to press CTRL+h to see the hidden .fonts-Folder in the file-tree). After extracting all the .exe-files all the fonts are now available in LibreOffice etc.
This is only a per-user-base-installation but I hope this helps :slight_smile:

Honestly, that seems even more time consuming, but it is good to know there is another way to do it.

For now, I just saved them on a USB key so I can skip the process when I need to install Bluefin, but seeing how stable the system is, that should not happen often.

I discovered you can install cabextract in Brew, so that may also be a way to skip the need to install another distro in a box, but I did not test it.

here’s a bash script:

#!/bin/bash

# Ensure cabextract is installed
if ! command -v cabextract &> /dev/null
then
    echo "cabextract could not be found, installing..."
    brew install -y cabextract
fi

# Create the fonts directory if it doesn't exist
mkdir -p ~/.local/share/fonts

# Navigate to the fonts directory
cd ~/.local/share/fonts

# Array of Microsoft font executables
font_exes=(
    "andale32.exe"
    "arial32.exe"
    "arialb32.exe"
    "comic32.exe"
    "courie32.exe"
    "georgi32.exe"
    "impact32.exe"
    "times32.exe"
    "trebuc32.exe"
    "verdan32.exe"
    "webdin32.exe"
)

# Function to download and extract a font
download_and_extract() {
    exe=$1
    url="https://sourceforge.net/projects/corefonts/files/the%20fonts/final/${exe}/download"
    echo "Downloading $exe from $url"
    curl -sL "$url" -o "$exe"
    if [ $? -ne 0 ]; then
        echo "Failed to download $exe"
        return
    fi
    cabextract -q -F '*.ttf' "$exe"
    if [ $? -ne 0 ]; then
        echo "Failed to extract $exe"
        return
    fi
    rm "$exe"
}

# Download and extract each font concurrently
for exe in "${font_exes[@]}"
do
    download_and_extract "$exe" &
done

# Wait for all background jobs to finish
wait

# Update the font cache
fc-cache -fv

echo "Microsoft fonts have been installed in ~/.local/share/fonts"
3 Likes

Thank you!

I hope this will be included in ujust.

Just an idea for the end of the script if it was to be included:

if cabextract was already installed on the system, do nothing,
else, unistall it

so the script cleans after itself.

I have built a stash of fonts over the years. When I install a distro, one of the first things I do is I create a folder, .fonts, in my home directory and paste my stash of fonts in there. I have all the fonts listed above that I got from Ubuntu, Manjaro’s vista fonts that includes calibri, and a direct download that’s already in bluefin, opendyslexic. Works every time.