Last active
December 13, 2020 05:03
-
-
Save lesstif/644b29b9fa830ec157a476707ffc4e4d to your computer and use it in GitHub Desktop.
JAVA_HOME 의 fonts/fallback 디렉터리에 나눔 폰트 설치. Confluence 의 편집 macro 에서 한글 깨짐 방지
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/sh | |
if [ "$#" -lt 1 ]; then | |
echo -e "$# is Illegal number of parameters.\n" | |
echo -e "Usage: $0 confluence-installed-dir\n" | |
echo "Example: $0 /var/atlassian/atlassian-confluence-6.7.0" | |
exit 1 | |
fi | |
CONF_DIR=$1 | |
if [ ! -f "${CONF_DIR}/bin/setenv.sh" ]; then | |
echo "${CONF_DIR}/bin/setenv.sh does not exist.!"; | |
exit 1; | |
fi | |
SETENV_SH=${CONF_DIR}/bin/setenv.sh | |
if [ -z ${JAVA_HOME+x} ]; then | |
echo "JAVA_HOME env is unset."; | |
echo "exiting..."; | |
exit 1; | |
else· | |
echo "JAVA_HOME is set to '$JAVA_HOME'"; | |
fi | |
## create fallback font dir | |
FONT_DIR=${JAVA_HOME}/jre/lib/fonts/fallback | |
mkdir -p ${FONT_DIR} | |
## download nanum font | |
curl -o nanumfont.zip http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip | |
## extract to font dir | |
unzip nanumfont.zip -d ${FONT_DIR} | |
ln -s ${FONT_DIR} /usr/share/fonts/nanum | |
fc-cache -f -v | |
## append JVM paramter | |
echo "### See https://jira.atlassian.com/browse/CONFSERVER-36557 " >> ${SETENV_SH} | |
echo "CATALINA_OPTS=\"-Dconfluence.document.conversion.fontpath=/usr/share/fonts/nanum \${CATALINA_OPTS}\"" >> ${SETENV_SH} | |
echo "CATALINA_OPTS=\"-Dconfluence.document.conversion.words.defaultfontname=NanumGothic \${CATALINA_OPTS}\"" >> ${SETENV_SH} | |
echo "CATALINA_OPTS=\"-Dconfluence.document.conversion.slides.defaultfontname.regular=NanumGothic \${CATALINA_OPTS}\"" >> ${SETENV_SH} | |
echo "CATALINA_OPTS=\"-Dconfluence.document.conversion.slides.defaultfontname.asian=NanumGothic \${CATALINA_OPTS}\"" >> ${SETENV_SH} | |
echo "CATALINA_OPTS=\"-Dconfluence.document.conversion.slides.defaultfontname.symbol=NanumGothic \${CATALINA_OPTS}\"" >> ${SETENV_SH} | |
echo -e "\n\n\n" >> ${SETENV_SH} | |
echo "export CATALINA_OPTS" >> ${SETENV_SH} | |
##· | |
echo "You need to restart Confluence!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment