是否有任何shell命令来获取激活字体的列表?就像是:
some_font_util -activated -format 'file: name'
以如下形式获取激活字体的列表:
/Library/Fonts/CourNI.ttf: Courier New Italic
…或类似的东西?
我正在使用Lion。osascript
也欢迎来自MacPorts或AppleScript(用于通过命令运行)的内容。
是否有任何shell命令来获取激活字体的列表?就像是:
some_font_util -activated -format 'file: name'
以如下形式获取激活字体的列表:
/Library/Fonts/CourNI.ttf: Courier New Italic
…或类似的东西?
我正在使用Lion。osascript
也欢迎来自MacPorts或AppleScript(用于通过命令运行)的内容。
Answers:
我知道这是一篇很老的文章,但是我在搜索类似内容时偶然发现了它(主要是想通过Terminal列出活动字体。)我最终想起了激活的字体列在System Information中,该信息可以从system_profiler命令中拉出。话虽这么说,这是从system_profiler中提取字体信息的命令:
system_profiler SPFontsDataType
而已。它应以以下格式返回大量字体数据:
Fonts:
Arial Narrow.ttf:
Kind: TrueType
Valid: Yes
Enabled: Yes
Location: /Library/Fonts/Arial Narrow.ttf
Typefaces:
ArialNarrow:
Full Name: Arial Narrow
Family: Arial Narrow
Style: Regular
Version: Version 2.38.1x
Vendor: The Monotype Corporation
Unique Name: Arial Narrow Regular : 2007
Designer: Robin Nicholas, Patricia Saunders
Copyright: © 2007 The Monotype Corporation. All Rights Reserved.
Trademark: Arial is a trademark of The Monotype Corporation in the United States and/or other countries.
Description: Monotype Drawing Office 1982. A contemporary sans serif design, Arial contains more humanist characteristics than many of its predecessors and as such is more in tune with the mood of the last decades of the twentieth century. The overall treatment of curves is softer and fuller than in most industrial-style sans serif faces. Terminal strokes are cut on the diagonal which helps to give the face a less mechanical appearance. Arial is an extremely versatile family of typefaces which can be used with equal success for text setting in reports, presentations, magazines etc, and for display use in newspapers, advertising and promotions.
Outline: Yes
Valid: Yes
Enabled: Yes
Duplicate: No
Copy Protected: No
Embeddable: Yes
您应该能够根据需要进行grep和操作。
system_profiler -xml SPFontsDataType
XML可以使用某些XML工具精确解析的输出。谢谢。
$ fc-list : file family |grep \/Library
grepping / Library过滤掉/ usr / X11 *中的一堆字体,这些字体仅由X11使用。考虑到您的示例,我假设您希望使用OS X特定的示例。如果我在这个假设上有误,那就简单地带走家人之后的一切。
该命令自行返回许多行,这是我在列表中看到的一些有趣的行:
/System/Library/Fonts/AppleGothic.ttf:AppleGothic
/ Library / Fonts / Apple LiGothic Medium.ttf:Apple LiGothic
/ System / Library / Fonts / Apple Braille Pinpoint 8 Dot.ttf:Apple Braille
/ System / Library / Fonts / Apple盲文大纲6 Dot.ttf:Apple盲文
/ System / Library / Fonts / Apple Symbols.ttf:Apple Symbols
/ System / Library / Fonts / Apple Braille Pinpoint 6 Dot.ttf:Apple盲文
/ System / Library / Fonts / Apple Braille。 ttf:Apple盲文
/Library/Fonts/AppleMyungjo.ttf:AppleMyungjo/
系统/图书馆/ Fonts / Apple Braille Outline 8 Dot.ttf:Apple盲文
/ Library / Fonts / Apple LiSung Light.ttf:Apple LiSung
/ Library / Fonts / Apple Chancery.ttf:Apple Chancery
/ System / Library / Fonts / Apple Color Emoji.ttf:Apple Color Emoji,Apple彩色表情>符号,Apple farve-emoji,Apple Farben-Emoji,Applenväri-emoji,Apple Emoji couleur,Colore Emoji Apple,Appleカラー絵文字, Apple컬러이모티콘,Apple Kleur-Emoji,Apple farge-emoji,Apple Emoji em Cores,ЦветныеэмодзиApple,Applefärg-emoji,Apple彩色表情符号,لون,Apple Emoji颜色
/ Library / Fonts / Comic Sans MS.ttf:Comic Sans MS
/图书馆/字体/微软/ MS Gothic.ttf:MS哥特式,MSゴシック
/ Library / Fonts / Microsoft / Stencil:模具
/ Library / Fonts / Microsoft / Verdana:Verdana
/ Library / Fonts / Microsoft / Georgia:乔治亚州
/图书馆/字体/微软/玛瑙:玛瑙
fc-list
二进制文件仍在其中/usr/X11/bin/fc-list
,也无法在没有正确安装X11的情况下运行它。