Вы правы в том, что в Mac OS X есть тонны шрифтов. Эти шрифты распределяются через четыре или более папок, в зависимости от установки программного обеспечения и количества учетных записей пользователей на вашем компьютере.
+ 1 к вашему вопросу, поскольку я пытался сделать то же самое, поэтому я написал небольшой сценарий, который выполняет эту работу. Он извлекает шрифты из четырех / пяти разных мест, пишет в текстовом документе, а затем изменяет шрифты. Однако, когда вы запустите его, ваша система может начать отставать (как моя сделала несколько минут назад). Но отставание того стоит! Вот скрипт:
--"get all the fonts on the system"
display dialog "WARNING" & return & return & "This script may cause your computer to lag. Are you sure you want to proceed with the font sampler?" with icon caution
set the font_folders to {"/Users/" & the short user name of (system info) & "/Library/Fonts/", "/Library/Fonts/", "/Network/Library/Fonts/", "/System/Library/Fonts/", "/System Folder/Fonts/"}
set these_fonts to {}
repeat with this_font_folder in the font_folders
try
tell application "Finder" to set the end of these_fonts to every item of ((this_font_folder as POSIX file) as alias)
end try
end repeat
--"write a bunch of stuff in a text document"
tell application "TextEdit"
activate
set zoomed of the front window to true
set the name of the front window to "Font Sampler"
end tell
repeat with this_font in these_fonts
tell application "Finder" to set this_font to the name of this_font
tell application "TextEdit" to set the text of document 1 to the text of document 1 & this_font & ": The quick brown fox jumps over the lazy dog." & return
end repeat
--"set the font of each consecutive line to the next font (i.e. Line 1's font is Font 1, Line 2's font is Font 2, etc.)"
repeat with i from 1 to the count of these_fonts
tell application "Finder" to set this_font to the name of item i of these_fonts
tell application "TextEdit" to tell paragraph i of the text of document 1 to set the font to this_font
end repeat