@@ -59,6 +59,11 @@ stages:
5959 maxParallel : 4
6060 pool :
6161 vmImage : ' $(vmImage)'
62+ variables :
63+ - name : WQY_TGZ
64+ value : wqy-zenhei-0.9.45.tar.gz
65+ - name : WQY_URL
66+ value : https://sourceforge.net/projects/wqy/files/wqy-zenhei/0.9.45%20%28Fighting-state%20RC1%29/wqy-zenhei-0.9.45.tar.gz/download
6267 steps :
6368 - task : UsePythonVersion@0
6469 inputs :
@@ -73,6 +78,20 @@ stages:
7378 prerelease : true
7479 condition : and(succeeded(), eq(variables['python.version'], 'Pre'))
7580
81+ - task : Cache@2
82+ displayName : Cache the wqy-zenhei font on Windows
83+ condition : eq(variables['Agent.OS'], 'Windows_NT')
84+ inputs :
85+ key : wqy-zenhei-0.9.45
86+ path : $(Agent.TempDirectory)/$(WQY_TGZ)
87+
88+ - task : Cache@2
89+ condition : eq(variables['Agent.OS'], 'Darwin')
90+ displayName : Cache the wqy-zenhei font on Darwin
91+ inputs :
92+ key : wqy-zenhei-0.9.45
93+ path : $(Agent.HomeDirectory)/Downloads/$(WQY_TGZ)
94+
7695 - bash : |
7796 set -e
7897 case "$(python -c 'import sys; print(sys.platform)')" in
@@ -100,10 +119,22 @@ stages:
100119 ttf-wqy-zenhei
101120 ;;
102121 darwin)
122+ set -x
103123 brew install --cask xquartz
104124 brew install pkg-config ffmpeg imagemagick mplayer ccache
125+ [ -e $HOME/Downloads/$(WQY_TGZ) ] || curl -L -o $HOME/Downloads/$(WQY_TGZ) $(WQY_URL)
126+ tar xzf $HOME/Downloads/$(WQY_TGZ) wqy-zenhei/wqy-zenhei.ttc
127+ mkdir -p $HOME/Library/Fonts
128+ mv wqy-zenhei/wqy-zenhei.ttc $HOME/Library/Fonts
129+ ls -l $HOME/Library/Fonts
105130 ;;
106131 win32)
132+ set -x
133+ [ -e $AGENT_TEMPDIRECTORY/$(WQY_TGZ) ] || curl -L -o $AGENT_TEMPDIRECTORY/$(WQY_TGZ) $(WQY_URL)
134+ tar -C $AGENT_TEMPDIRECTORY -xf $(WQY_TGZ) wqy-zenhei/wqy-zenhei.ttc
135+ mv $AGENT_TEMPDIRECTORY/wqy-zenhei/wqy-zenhei.ttc $WINDIR/Fonts
136+ ls -l $WINDIR/Fonts
137+ reg add "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" /v "WenQuanYi Zen Hei (TrueType)" /t REG_SZ /d wqy-zenhei.ttc /f
107138 ;;
108139 *)
109140 exit 1
0 commit comments