Add post_install to copy fonts to ~/Library/Fonts/

Fonts now appear in Font Book automatically after brew install.
The post_install hook copies TTF and OTF files to ~/Library/Fonts/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Troutman 2026-03-07 21:30:48 -06:00
parent 4273745a9e
commit 7cfc7f51d2
No known key found for this signature in database
134 changed files with 2010 additions and 670 deletions

View file

@ -116,14 +116,24 @@ class Font{class_name} < Formula
end
end
def post_install
user_fonts = Pathname.new(File.expand_path("~/Library/Fonts"))
user_fonts.mkpath
Dir.glob(share/"fonts/truetype/*.ttf").each do |f|
cp f, user_fonts
end
Dir.glob(share/"fonts/opentype/*.otf").each do |f|
cp f, user_fonts
end
end
def caveats
<<~EOS
Fonts have been installed to:
#{{share}}/fonts/truetype
#{{share}}/fonts/opentype
#{{share}}/fonts/webfonts
Fonts have been copied to ~/Library/Fonts/ and should appear in Font Book.
Additional files are available in:
Web fonts and other files are available in:
#{{share}}/fonts/webfonts
#{{share}}/{formula_name}
EOS
end