Category filter
Script to Install Font in macOS devices
Within an organization, you might require special fonts to be distributed for specific users. You might be using these in the documents for customers or while creating presentations. Regardless of the circumstance, getting these fonts installed manually is quite time-consuming, considering the process involves visiting different sites that host the fonts, downloading them, and double-clicking on the downloaded files on each device to install the font. IT admins can utilize the script given below to remotely install the required font on macOS devices using Hexnode’s
Execute Custom Script action.
You can use the below script to install fonts to Font Book in devices by running a simple command.
Scripting Language – Bash
File extension – .sh
Install fonts to Font Book
Use the below command to make the font available to the logged in user. You can copy either of the font types, True Type Fonts (TTF) or Open Type Fonts (OTF), using this command.
1 2 |
#!/bin/bash cp –R /users/username/Foldername/fontname.ttf ~/Library/Fonts/ |
For example, a logged in user ‘User1’ with the font ‘CROCHETPATTERN.ttf’ in the Downloads folder, can use the following command to install it in Font Book.
Ex: cp –R /users/user1/Downloads/CROCHETPATTERN.ttf ~/Library/Fonts/
Alternatively, to make the font available for all existing and newly created users on the system, the font needs to be copied to the system’s font folder.
1 2 |
#!/bin/bash cp –R /users/username/Foldername/fontname.ttf /Library/Fonts/ |
What happens at the device end?
The font added using the script will be installed on the Mac device, added to the Font Book, and can later be used in text editors. The font can be seen in the All Fonts section of the Font Book.