Last active
July 23, 2024 07:56
-
-
Save maxwelleite/ee5a1a4222dd43c8b4af5c99ed72b3fc to your computer and use it in GitHub Desktop.
Script to install the latest Wine Tahoma fonts on Ubuntu distros
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Maxwel Leite | |
# Website: http://needforbits.wordpress.com/ | |
# Description: Script to install the latest Wine Tahoma Regular and Wine Tahoma Bold fonts on Ubuntu distros from the Wine Project. | |
# The Wine project includes the free and open-source fonts Wine Tahoma Regular and Wine Tahoma Bold released under LGPL | |
# designed to have identical metrics to the Microsoft Tahoma font. This was done because Tahoma is available by default | |
# on Windows, and many applications expect the font to be available. | |
# Dependencies: wget | |
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic | |
# Latest Update: 20/11/2020 | |
output_dir="/usr/share/fonts/truetype/msttcorefonts/" | |
tmp_dir="/tmp/ttf-wine-tahoma-installer" | |
if [[ $EUID -ne 0 ]]; then | |
echo -e "You must be a root user!\nTry: sudo ./ttf-wine-tahoma-installer.sh" 2>&1 | |
exit 1 | |
fi | |
if ! which wget >/dev/null; then | |
echo "Error: wget is required to download the file" | |
echo "Run the following command to install it:" | |
echo "sudo apt-get install wget" | |
exit 1 | |
fi | |
file1="$tmp_dir/tahoma.ttf" | |
file2="$tmp_dir/tahomabd.ttf" | |
mkdir -p "$tmp_dir" | |
cd "$tmp_dir" | |
err=0 | |
echo -e "\n:: Downloading Tahoma Regular from Wine Project...\n" | |
wget -O "$file1" https://source.winehq.org/git/wine.git/blob/HEAD:/fonts/tahoma.ttf | |
if [ $? -ne 0 ]; then | |
rm -f "$file1" | |
echo -e "\nError: Download Tahoma Regular failed!?\n" | |
err=1 | |
else | |
echo -e "Done!\n" | |
fi | |
echo -e "\n:: Downloading Tahoma Bold from Wine Project...\n" | |
wget -O "$file2" https://source.winehq.org/git/wine.git/blob/HEAD:/fonts/tahomabd.ttf | |
if [ $? -ne 0 ]; then | |
rm -f "$file2" | |
echo -e "\nError: Download Tahoma Bold failed!?\n" | |
err=1 | |
else | |
echo -e "Done!\n" | |
fi | |
if [ $err -ne 1 ]; then | |
echo -n ":: Installing... " | |
mkdir -p "$output_dir" | |
cp -f "$tmp_dir"/*.ttf "$output_dir" &> /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Error: Can't copy files to output directory." | |
err=1 | |
else | |
echo "Done!" | |
fi | |
fi | |
if [ $err -ne 1 ]; then | |
echo -n ":: Clean the font cache... " | |
fc-cache -f "$output_dir" &> /dev/null | |
echo "Done!" | |
fi | |
echo -n ":: Cleanup... " | |
cd - &> /dev/null | |
rm -rf "$tmp_dir" &> /dev/null | |
echo "Done!" | |
if [ $err -ne 1 ]; then | |
echo -e "\nCongratulations! Installation of ttf-wine-tahoma-installer is successful!!\n" | |
else | |
echo -e "\nSome error occurred! Please try again!!\n" | |
fi |
Maybe use winehq master branch?
Fixed links. Thank you for the updated links!
Seems this doesnt work anymore and probably will not work any time soon...
WineHQ GitWeb Permanently Offline
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see that arch linux links to this:
https://aur.archlinux.org/packages/ttf-tahoma/