Guest User

Untitled

a guest
Jan 9th, 2022
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. # Maintainer: Andrew Crerar <crerar@archlinux.org>
  2. # Contributor: Mohammadreza Abdollahzadeh <morealaz at gmail dot com>
  3. # Contributor: FadeMind <fademind@gmail.com>
  4. # Contributor: Vlad M. <vlad@archlinux.net>
  5. # Contributor: Sebastian Stammler <stammler.s@gmail.com>
  6. # Contributor: Sarkasper <echo a2FzcGVyLm1lbnRlbkBnbXguY29tCg== | base64 -d>
  7. # Contributor: Daniel Micay <danielmicay@gmail.com>
  8. # Contributor: Michalis Georgiou <mechmg93@gmail.comr>
  9. # Contributor: Alexander De Sousa <archaur.xandy21@spamgourmet.com>
  10. # Contributor: Jef Oliver <jef at eljef dot me>
  11.  
  12. pkgname=ttf-google-fonts-git
  13. pkgver=r3199.ecafde9e1
  14. pkgrel=1
  15. epoch=1
  16. pkgdesc="TrueType fonts from the Google Fonts project (git version)"
  17. arch=('any')
  18. url="https://github.com/google/fonts"
  19. license=('custom:SIL Open Font License' 'custom:Ubuntu Font License v1.0')
  20.  
  21. depends=('adobe-source-code-pro-fonts'
  22. 'adobe-source-sans-fonts'
  23. 'adobe-source-serif-fonts'
  24. 'cantarell-fonts'
  25. 'noto-fonts'
  26. 'noto-fonts-extra'
  27. 'ttf-anonymous-pro'
  28. 'ttf-caladea'
  29. 'ttf-croscore'
  30. 'ttf-fira-sans'
  31. 'ttf-fira-mono'
  32. 'ttf-inconsolata'
  33. 'ttf-lato'
  34. 'ttf-merriweather'
  35. 'ttf-merriweather-sans'
  36. 'ttf-opensans'
  37. 'ttf-oswald'
  38. 'ttf-quintessential'
  39. 'ttf-roboto'
  40. 'ttf-roboto-mono'
  41. 'ttf-signika'
  42. 'ttf-ubuntu-font-family')
  43. makedepends=('git' 'fontconfig')
  44. conflicts=('jsmath-fonts'
  45. 'lohit-fonts'
  46. 'ttf-andika'
  47. 'ttf-arabeyes-fonts'
  48. 'ttf-cardo'
  49. 'ttf-comfortaa'
  50. 'ttf-google-fonts-typewolf'
  51. 'ttf-lora-cyrillic'
  52. 'ttf-lekton'
  53. 'ttf-medievalsharp'
  54. 'ttf-nova'
  55. 'ttf-oxygen'
  56. 'ttf-oxygen-git'
  57. 'ttf-pt-fonts'
  58. 'ttf-source-code-pro-ibx'
  59. 'ttf-source-sans-pro-ibx'
  60. 'ttf-vollkorn-ibx')
  61. provides=('jsmath-fonts'
  62. 'lohit-fonts'
  63. 'ttf-andika'
  64. 'ttf-cardo'
  65. 'ttf-comfortaa'
  66. 'ttf-lora-cyrillic'
  67. 'ttf-lekton'
  68. 'ttf-medievalsharp'
  69. 'ttf-nova'
  70. 'ttf-oxygen'
  71. 'ttf-oxygen-git'
  72. 'ttf-pt-fonts'
  73. 'ttf-source-code-pro-ibx'
  74. 'ttf-source-sans-pro-ibx'
  75. 'ttf-vollkorn-ibx')
  76. source=(git+"${url}".git)
  77. sha512sums=('SKIP')
  78.  
  79. pkgver() {
  80. cd fonts
  81.  
  82. printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  83. }
  84.  
  85. prepare() {
  86. cd fonts
  87.  
  88. # NOTE: Adobe Blank is not meant to be installed.
  89. # See: https://github.com/google/fonts/issues/2106#issuecomment-520067314
  90. rm --recursive "${srcdir}/fonts/ofl/adobeblank"
  91. }
  92.  
  93. package() {
  94. # NOTE: These are the font families that already exist in the [extra] and [community] repos.
  95. declare -A omitted_font_families=([anonymous-pro]=1
  96. [arimo]=1
  97. [caladea]=1
  98. [cantarell]=1
  99. [cousine]=1
  100. [fira-mono]=1 [fira-sans]=1
  101. [inconsolata]=1
  102. [lato]=1
  103. [merriweather]=1 [merriweather-sans]=1
  104. [noto-sans]=1 [noto-sans-tamil]=1 [noto-serif]=1
  105. [open-sans]=1 [oswald]=1
  106. [ubuntu]=1 [ubuntu-mono]=1
  107. [tinos]=1
  108. [roboto]=1 [roboto-condensed]=1 [roboto-mono]=1
  109. [source-code-pro]=1
  110. [source-sans-3]=1 [source-sans-pro]=1
  111. [source-serif-4]=1 [source-serif-pro]=1
  112. [quintessential]=1)
  113.  
  114.  
  115. while IFS= read -rd '' file; do
  116. font_family=$(fc-query -f '%{family[0]|downcase|translate( ,-)}\n' "$file" | sed -n '1p')
  117.  
  118. # NOTE: Skip the rest of the loop if we're not supposed to be touching this family
  119. ((omitted_font_families["$font_family"])) && continue
  120.  
  121. pkg_font_path="$pkgdir"/usr/share/fonts/"$font_family"
  122. install -Dm644 "$file" -t "$pkg_font_path" # TODO: Check and make sure $font_family is being created
  123.  
  124. # NOTE: If the font's license already exists, we don't need to copy the license again.
  125. src_license_path="${file%/*}"/OFL.txt
  126. pkg_font_license="$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE."$font_family"
  127. if [[ -f "$src_license_path" && ! -f "$pkg_font_license" ]]; then
  128. install -Dm644 "$src_license_path" "$pkg_font_license"
  129. fi
  130. done < <(find "$srcdir" -type f -iname \*.ttf -print0)
  131.  
  132. # NOTE: Since the zcool xiaowei chinese font has special characters. We need to change
  133. # the folder name to prevent errors during package compression.
  134. mv "$pkgdir"/usr/share/fonts/站酷小薇体 "$pkgdir"/usr/share/fonts/zcool-xiaowei-regular
  135. mv "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE.站酷小薇体 "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE.zcool-xiaowei-regular
  136. }
  137.  
Add Comment
Please, Sign In to add comment