From 5c4732ada504eea5ef766570e835c349e6d8db9e Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Wed, 11 Sep 2019 10:32:38 +0200 Subject: [PATCH] initial commit --- README.md | 9 ++++++++ ios-fonts.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 README.md create mode 100755 ios-fonts.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..528ef80 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Sync the MacOS fonts with your iPhone + +## Usage + +```sh +./ios-fonts.sh +``` + +And send the resulting `ios-fonts.mobileconfig` file by email to your iPhone. diff --git a/ios-fonts.sh b/ios-fonts.sh new file mode 100755 index 0000000..94f4560 --- /dev/null +++ b/ios-fonts.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +function add_font() { + echo "Adding $1 to the mobileconfig..." + + cat >> ios-fonts.mobileconfig < +Name +$i +PayloadIdentifier +$(uuidgen) +PayloadType +com.apple.font +PayloadUUID +$(uuidgen) +PayloadVersion +1 +Font + +$(openssl base64 -in "$1") + + +EOF +} + +cat > ios-fonts.mobileconfig < + + + +PayloadDisplayName +iOS Custom Fonts - $(date) +PayloadIdentifier +fr.itix.ios-fonts.$(uuidgen) +PayloadRemovalDisallowed + +PayloadType +Configuration +PayloadUUID +$(uuidgen) +PayloadVersion +1 +PayloadContent + +EOF + +if [ $# -gt 0 ]; then + for i; do + add_font "$i" + done +else + for i in ~/Library/Fonts/*.?tf; do + add_font "$i" + done +fi + +cat >> ios-fonts.mobileconfig < + + +EOF + +