Source

pkgbuilds / ttf-latex-tlwg / ttf-latex-tlwg.install

update_font_cache() {
  echo -n "Updating font cache... "
  fc-cache -fs > /dev/null
  mkfontscale usr/share/fonts/TTF
  mkfontdir usr/share/fonts/TTF
  echo "done."
}

enable_tex_font_maps() {
  echo -n "Updating TeX filename database..."
  mktexlsr
  echo "done."

  echo -n "Updating TeX font map..."
  updmap-sys --quiet --enable Map=nectec.map
  updmap-sys --quiet --enable Map=nf.map
  updmap-sys --quiet --enable Map=tlwg.map
  echo "done."
}

disable_tex_font_maps() {
  echo -n "Updating TeX filename database..."
  mktexlsr
  echo "done."

  echo -n "Updating TeX font map..."
  # disable Thai font maps
  updmap-sys --quiet --syncwithtrees
  echo "done."
}

post_install() {
  update_font_cache $1
  enable_tex_font_maps $1
}

post_upgrade() {
  post_install $1
}

post_remove() {
  update_font_cache $1
  disable_tex_font_maps $1
}