Remove AppleDouble resource fork files from font_files
Files starting with _ that are AppleDouble metadata (not real fonts) were being included in casks, causing Font Book issues. Deleted 57 such files from font_files/ and added detection to the cleanup script to prevent them in the future. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c85bbccd26
commit
7948c86aa0
60 changed files with 17 additions and 31 deletions
|
|
@ -33,11 +33,26 @@ class FontFolderCleaner:
|
||||||
|
|
||||||
def move_file_to_correct_directory(self, file_path, folder_path):
|
def move_file_to_correct_directory(self, file_path, folder_path):
|
||||||
"""Move file to the appropriate subdirectory."""
|
"""Move file to the appropriate subdirectory."""
|
||||||
if file_path.name == '.DS_Store':
|
if file_path.name == '.DS_Store' or file_path.name.startswith('._'):
|
||||||
file_path.unlink()
|
file_path.unlink()
|
||||||
print(f"Removed .DS_Store file: {file_path}")
|
print(f"Removed macOS metadata file: {file_path}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Remove AppleDouble resource fork files (start with _ and aren't real fonts)
|
||||||
|
if file_path.name.startswith('_') and file_path.suffix.lower() in (
|
||||||
|
'.ttf', '.otf', '.ttc', '.woff', '.woff2', '.eot', '.svg',
|
||||||
|
):
|
||||||
|
# Check if it's an AppleDouble file by reading magic bytes
|
||||||
|
try:
|
||||||
|
with open(file_path, 'rb') as f:
|
||||||
|
magic = f.read(4)
|
||||||
|
if magic == b'\x00\x05\x16\x07': # AppleDouble magic number
|
||||||
|
file_path.unlink()
|
||||||
|
print(f"Removed AppleDouble resource fork: {file_path}")
|
||||||
|
return
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
target_dir = self.get_target_directory(file_path)
|
target_dir = self.get_target_directory(file_path)
|
||||||
target_path = folder_path / target_dir / file_path.name
|
target_path = folder_path / target_dir / file_path.name
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,5 @@ cask "font-clancy" do
|
||||||
name "Clancy"
|
name "Clancy"
|
||||||
homepage "http://clancy.genet-godzilla.ts.net:8085/Fonts/homebrew-fonts"
|
homepage "http://clancy.genet-godzilla.ts.net:8085/Fonts/homebrew-fonts"
|
||||||
|
|
||||||
font "homebrew-fonts/font_files/font-clancy/otf/_clancy-free.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-clancy/otf/clancy-free.otf"
|
font "homebrew-fonts/font_files/font-clancy/otf/clancy-free.otf"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,6 @@ cask "font-idgrotesk" do
|
||||||
name "Idgrotesk"
|
name "Idgrotesk"
|
||||||
homepage "http://clancy.genet-godzilla.ts.net:8085/Fonts/homebrew-fonts"
|
homepage "http://clancy.genet-godzilla.ts.net:8085/Fonts/homebrew-fonts"
|
||||||
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-bold.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-bolditalic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-book.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-bookitalic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-italic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-light.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-lightitalic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-medium.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-mediumitalic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-regular.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-semibold.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-semibolditalic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-thin.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/_idgrotesktrial-thinitalic.ttf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-bold.ttf"
|
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-bold.ttf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-bolditalic.ttf"
|
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-bolditalic.ttf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-book.ttf"
|
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-book.ttf"
|
||||||
|
|
@ -38,20 +24,6 @@ cask "font-idgrotesk" do
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-semibolditalic.ttf"
|
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-semibolditalic.ttf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-thin.ttf"
|
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-thin.ttf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-thinitalic.ttf"
|
font "homebrew-fonts/font_files/font-idgrotesk/ttf/idgrotesktrial-thinitalic.ttf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-bold.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-bolditalic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-book.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-bookitalic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-italic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-light.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-lightitalic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-medium.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-mediumitalic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-regular.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-semibold.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-semibolditalic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-thin.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/_idgrotesktrial-thinitalic.otf"
|
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/idgrotesktrial-bold.otf"
|
font "homebrew-fonts/font_files/font-idgrotesk/otf/idgrotesktrial-bold.otf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/idgrotesktrial-bolditalic.otf"
|
font "homebrew-fonts/font_files/font-idgrotesk/otf/idgrotesktrial-bolditalic.otf"
|
||||||
font "homebrew-fonts/font_files/font-idgrotesk/otf/idgrotesktrial-book.otf"
|
font "homebrew-fonts/font_files/font-idgrotesk/otf/idgrotesktrial-book.otf"
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue