manifestoe, I had some X problems (that I don't know if it was related with the font
path file or not; can't say because I had other misconfigurations) and had to do a
clean up on the X configs.
While examining the issue I found out the way fonts add themselves to the X core system.
They link their directories to /etc/X11/fontpath.d
I did this to the ms fonts (after disabling 09-msttcore-fontpath.conf) and it works
properly. So I suggest that you use this method in your script: instead of creating that
fontpath file, simply ln -s /usr/share/fonts/msttcore to /etc/X11/fontpath.d/
See in my system:
$ ll /etc/X11/fontpath.d/
total 0
lrwxrwxrwx. 1 root root 36 Jun 1 09:52 default-ghostscript ->
/usr/share/fonts/default/ghostscript
lrwxrwxrwx. 1 root root 30 Jun 1 09:51 fonts-default ->
/usr/share/fonts/default/Type1
lrwxrwxrwx 1 root root 26 Oct 9 17:04 msttcore -> /usr/share/fonts/msttcore/
lrwxrwxrwx. 1 root root 25 May 25 12:37 terminus:unscaled -> /usr/share/fonts/terminus
lrwxrwxrwx 1 root root 27 Oct 5 09:16 xorg-x11-fonts-100dpi:unscaled:pri=30 ->
/usr/share/X11/fonts/100dpi
lrwxrwxrwx. 1 root root 26 Sep 21 08:27 xorg-x11-fonts-75dpi:unscaled:pri=20 ->
/usr/share/X11/fonts/75dpi
lrwxrwxrwx. 1 root root 25 Jun 28 18:38 xorg-x11-fonts-misc:unscaled:pri=10 ->
/usr/share/X11/fonts/misc