¿Hay algún comando de shell para obtener una lista de fuentes activadas? Algo como:
some_font_util -activated -format 'file: name'
para obtener una lista de fuentes activadas en una forma como:
/Library/Fonts/CourNI.ttf: Courier New Italic
…o algo similar?
Estoy usando León. Algo de MacPorts o AppleScript (para ejecutar con osascript
comando) también sería bienvenido.
Sé que esta es una publicación bastante antigua, pero me topé con ella en Google mientras buscaba algo similar (en su mayoría solo quería enumerar las fuentes activas a través de la Terminal). Terminé recordando que las fuentes activadas se enumeran en Información del sistema que puede ser extraído del comando system_profiler. Dicho esto, aquí está el comando para extraer información de fuentes de system_profiler:
system_profiler SPFontsDataType
Eso es. Debería devolver una gran lista de datos de fuentes en el formato de:
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
que deberías poder grep y manipular como quieras.
system_profiler -xml SPFontsDataType
produce una salida XML que se puede analizar con precisión utilizando alguna herramienta XML. Gracias.$ fc-list : file family |grep \/Library
grepping /Library filtra un montón de fuentes en /usr/X11*, que solo usa X11. Teniendo en cuenta su ejemplo, supongo que preferiría los específicos de OS X. Si me equivoco en esta suposición, simplemente saque todo después de la familia.
Ese comando devuelve muchas líneas por sí mismo, aquí hay algunas interesantes que vi en la lista:
/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 Esquema Braille 6 Dot.ttf: Apple Braille
/Sistema/Biblioteca/Fuentes/Símbolos Apple.ttf: Símbolos Apple
/Sistema/Biblioteca/Fuentes/Apple Braille Pinpoint 6 Dot.ttf: Apple Braille
/Sistema/Biblioteca/Fuentes/Apple Braille. ttf: Apple Braille
/Biblioteca/Fuentes/AppleMyungjo.ttf: AppleMyungjo
/Sistema/Biblioteca/Fuentes/Apple Braille Esquema 8 puntos.ttf: Apple Braille
/Biblioteca/Fuentes/Apple LiSung Light.ttf: Apple LiSung
/Biblioteca/Fuentes/Apple Cancillería.ttf: Cancillería de Apple
/System/Library/Fonts/Apple Color Emoji.ttf: Apple Color Emoji,Apple 彩色表情> 符號,Apple farve-emoji,Apple Farben-Emoji,Applen väri-emoji,Apple Emoji couleur,Colore Emoji Apple,Apple カラー絵文字, Apple 컬러 이모티콘, Apple Kleur-Emoji, Apple farge-emoji, Apple Emoji em Cores, Цветные эмодзи Apple, Apple färg-emoji, Apple 彩色表情符号, لون, Apple Emoji color
/Library/Fonts/Comic Sans Sans MS
/Library/Fonts/Microsoft/MS Gothic.ttf: MS Gothic,MS ゴシック
/Library/Fonts/Microsoft/Stencil: Stencil
/Library/Fonts/Microsoft/Verdana: Verdana
/Library/Fonts/Microsoft/Georgia: Georgia
/ Biblioteca/Fuentes/Microsoft/Onyx: Onyx
fc-list
binario todavía está disponible en /usr/X11/bin/fc-list
, no se ejecutará sin una instalación adecuada de X11.system_profiler
método me parece más natural para macs... :)
jason salaz
clt60