From c2b4b66ed12ca089ac18a04568f610a17481187b Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Thu, 7 Nov 2024 12:40:13 -0800 Subject: [PATCH] hotfix/IO-2969-Fonts-For-Production Signed-off-by: Dave Richer --- .../hooks/postdeploy/00-install-fonts.sh | 13 ---------- .platform/hooks/predeploy/00-install-fonts.sh | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) delete mode 100644 .platform/hooks/postdeploy/00-install-fonts.sh create mode 100644 .platform/hooks/predeploy/00-install-fonts.sh diff --git a/.platform/hooks/postdeploy/00-install-fonts.sh b/.platform/hooks/postdeploy/00-install-fonts.sh deleted file mode 100644 index f9b766ef5..000000000 --- a/.platform/hooks/postdeploy/00-install-fonts.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Install fonts using dnf -dnf install -y fontconfig freetype google-noto-sans-fonts dejavu-sans-fonts liberation-fonts - -# Download and install Montserrat font -cd /tmp -curl -O https://fonts.google.com/download?family=Montserrat -unzip Montserrat.zip -d /usr/share/fonts/montserrat -fc-cache -fv # Rebuild font cache to include Montserrat - -# Ensure permissions are correct -chmod -R 755 /usr/share/fonts/montserrat diff --git a/.platform/hooks/predeploy/00-install-fonts.sh b/.platform/hooks/predeploy/00-install-fonts.sh new file mode 100644 index 000000000..af9d08b0b --- /dev/null +++ b/.platform/hooks/predeploy/00-install-fonts.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Install required packages +dnf install -y fontconfig freetype + +# Move to the /tmp directory for temporary download and extraction +cd /tmp + +# Download the Montserrat font zip file +wget https://images.imex.online/fonts/montserrat.zip -O montserrat.zip + +# Unzip the downloaded font file +unzip montserrat.zip -d montserrat + +# Move the font files to the system fonts directory +mv montserrat/*.ttf /usr/share/fonts + +# Rebuild the font cache +fc-cache -fv + +# Clean up +rm -rf /tmp/montserrat /tmp/montserrat.zip + +echo "Montserrat fonts installed and cached successfully."