Lista de fuentes (activadas) con comando de shell en os x

¿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 osascriptcomando) también sería bienvenido.

Por mi propia curiosidad morbosa, ¿puedo preguntar por qué lo necesita (1) programáticamente y (2) en un formato tan específico?
simplemente quiero imprimir fontdemo (un poco de texto con todas mis fuentes) con el comando textutil, por lo que realmente solo necesito "fontname" pero el archivo ayuda a filtrar el directorio de fuentes correcto (como lo hace en su ejemplo). :) como: echo 'texto de demostración' | textutil -stdin -convert rtf -fuente $NOMBRE DE LA FUENTE ... etc.

Respuestas (2)

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.

¡SI! Esta es la forma correcta. Cambió la respuesta aceptada. Además, usarlo como system_profiler -xml SPFontsDataTypeproduce 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

Necesito instalar fonconfig macport. ¡Excelente! Gracias.
Desde OS X 10.8 Mountain Lion, X11 ya no está incluido en el sistema operativo, e incluso si el fc-listbinario todavía está disponible en /usr/X11/bin/fc-list, no se ejecutará sin una instalación adecuada de X11.
X11 nunca se ha incluido, siempre ha sido una instalación opcional.
X11 se incluyó en el disco de instalación 10.5, pero tuvo que ejecutar el instalador manualmente. @GuillaumeAlgis
@ jm666 debería ser fontconfig, consulte brewformulas.org/Fontconfig
@xudifsd Sí, necesita el paquete fontconfig . Como dije en mi primer comentario, yo uso macports porque (para mí) es mejor como cerveza. Pero, el system_profilermétodo me parece más natural para macs... :)