add lato bundle
authorGuillaume Castagnino <casta@xwing.info>
Sun, 19 May 2019 20:02:07 +0000 (22:02 +0200)
committerGuillaume Castagnino <casta@xwing.info>
Sun, 19 May 2019 20:02:07 +0000 (22:02 +0200)
21 files changed:
dist-font/cm-data/99-font.sh.addon [new file with mode: 0755]
dist-font/cm-data/lato/.uuid [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Black.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-BlackItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Bold.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-BoldItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Hairline.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-HairlineItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Heavy.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-HeavyItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Italic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Light.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-LightItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Medium.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-MediumItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Regular.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Semibold.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-SemiboldItalic.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-Thin.ttf [new file with mode: 0644]
dist-font/cm-data/lato/Lato-ThinItalic.ttf [new file with mode: 0644]
dist-font/cm.sh [new file with mode: 0755]

diff --git a/dist-font/cm-data/99-font.sh.addon b/dist-font/cm-data/99-font.sh.addon
new file mode 100755 (executable)
index 0000000..ccbe35e
--- /dev/null
@@ -0,0 +1,65 @@
+#!/sbin/sh
+#
+# ADDOND_VERSION=2
+#
+# /system/addon.d/99-font.sh
+#
+
+# we partially use the script at install, if so, $SYSTEM is allready defined
+if [ -z $SYSTEM ]; then
+  . /tmp/backuptool.functions
+else
+  S=$SYSTEM
+fi
+if [ -z $backuptool_ab ]; then
+  SYS=$S
+  TMP="/tmp"
+else
+  SYS="/postinstall/$S"
+  TMP="/postinstall/tmp"
+fi
+
+# path is needed when running from recovery (at install)
+export PATH="${PATH}:$S/bin:$S/xbin"
+
+list_files() {
+cat <<EOF
+fonts/Lato-*.ttf
+EOF
+}
+
+case "$1" in
+  backup)
+    list_files | while read FILE DUMMY; do
+      backup_file $S/"$FILE"
+    done
+  ;;
+  restore)
+    list_files | while read FILE REPLACEMENT; do
+      R=""
+      [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
+      [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
+    done
+  ;;
+  pre-backup)
+    # Stub
+  ;;
+  post-backup)
+    # Stub
+  ;;
+  pre-restore)
+    # Stub
+  ;;
+  post-restore)
+    # update fonts.xml
+    cp "$SYS/etc/fonts.xml" "$SYS/etc/fonts.xml.bak"
+    sed -i -e "s/Roboto-/Lato-/g" \
+        "$SYS/etc/fonts.xml"
+    # Fix ownership/permissions
+    for i in $(list_files); do
+      chown root:root "$SYS/$i"
+      chmod 644 "$SYS/$i"
+      chmod 755 "$(dirname "$SYS/$i")"
+    done
+  ;;
+esac
diff --git a/dist-font/cm-data/lato/.uuid b/dist-font/cm-data/lato/.uuid
new file mode 100644 (file)
index 0000000..da266b0
--- /dev/null
@@ -0,0 +1 @@
+931c6b2b-b25c-497d-b94c-b45e97736c4a
\ No newline at end of file
diff --git a/dist-font/cm-data/lato/Lato-Black.ttf b/dist-font/cm-data/lato/Lato-Black.ttf
new file mode 100644 (file)
index 0000000..e2aeb6c
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Black.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-BlackItalic.ttf b/dist-font/cm-data/lato/Lato-BlackItalic.ttf
new file mode 100644 (file)
index 0000000..8167388
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-BlackItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Bold.ttf b/dist-font/cm-data/lato/Lato-Bold.ttf
new file mode 100644 (file)
index 0000000..ef5ae3b
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Bold.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-BoldItalic.ttf b/dist-font/cm-data/lato/Lato-BoldItalic.ttf
new file mode 100644 (file)
index 0000000..664cd02
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-BoldItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Hairline.ttf b/dist-font/cm-data/lato/Lato-Hairline.ttf
new file mode 100644 (file)
index 0000000..4c5a8fd
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Hairline.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-HairlineItalic.ttf b/dist-font/cm-data/lato/Lato-HairlineItalic.ttf
new file mode 100644 (file)
index 0000000..af5ac3d
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-HairlineItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Heavy.ttf b/dist-font/cm-data/lato/Lato-Heavy.ttf
new file mode 100644 (file)
index 0000000..fc70ab7
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Heavy.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-HeavyItalic.ttf b/dist-font/cm-data/lato/Lato-HeavyItalic.ttf
new file mode 100644 (file)
index 0000000..823188c
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-HeavyItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Italic.ttf b/dist-font/cm-data/lato/Lato-Italic.ttf
new file mode 100644 (file)
index 0000000..b23256f
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Italic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Light.ttf b/dist-font/cm-data/lato/Lato-Light.ttf
new file mode 100644 (file)
index 0000000..0809b8e
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Light.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-LightItalic.ttf b/dist-font/cm-data/lato/Lato-LightItalic.ttf
new file mode 100644 (file)
index 0000000..2d03739
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-LightItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Medium.ttf b/dist-font/cm-data/lato/Lato-Medium.ttf
new file mode 100644 (file)
index 0000000..2c612da
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Medium.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-MediumItalic.ttf b/dist-font/cm-data/lato/Lato-MediumItalic.ttf
new file mode 100644 (file)
index 0000000..63ecd02
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-MediumItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Regular.ttf b/dist-font/cm-data/lato/Lato-Regular.ttf
new file mode 100644 (file)
index 0000000..adbfc46
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Regular.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Semibold.ttf b/dist-font/cm-data/lato/Lato-Semibold.ttf
new file mode 100644 (file)
index 0000000..60ac82d
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Semibold.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-SemiboldItalic.ttf b/dist-font/cm-data/lato/Lato-SemiboldItalic.ttf
new file mode 100644 (file)
index 0000000..cc23390
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-SemiboldItalic.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-Thin.ttf b/dist-font/cm-data/lato/Lato-Thin.ttf
new file mode 100644 (file)
index 0000000..0f84dc1
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-Thin.ttf differ
diff --git a/dist-font/cm-data/lato/Lato-ThinItalic.ttf b/dist-font/cm-data/lato/Lato-ThinItalic.ttf
new file mode 100644 (file)
index 0000000..7fbca2f
Binary files /dev/null and b/dist-font/cm-data/lato/Lato-ThinItalic.ttf differ
diff --git a/dist-font/cm.sh b/dist-font/cm.sh
new file mode 100755 (executable)
index 0000000..5c02066
--- /dev/null
@@ -0,0 +1,28 @@
+#!/sbin/sh
+
+set -e
+
+# $SYSTEM set by the caller
+
+cd "$(dirname $0)"
+
+export PATH="${PATH}:${SYSTEM}/bin:${SYSTEM}/xbin"
+
+# install iptables script
+echo "Installing font"
+cp cm-data/lato/Lato*.ttf ${SYSTEM}/fonts/
+chown root:root ${SYSTEM}/fonts/Lato*.ttf
+chmod 750 ${SYSTEM}/fonts/Lato*.ttf
+
+# install restore script
+echo "Installing restore script"
+cp cm-data/99-font.sh.addon ${SYSTEM}/addon.d/99-font.sh
+chown root:root ${SYSTEM}/addon.d/99-font.sh
+chmod 755 ${SYSTEM}/addon.d/99-font.sh
+
+# call restore script post to remove bloat
+export SYSTEM
+${SYSTEM}/addon.d/99-font.sh post-restore
+
+echo "Done"
+