FontBook Module Reference
New in version 0.0.6.
Control the macOS FontBook application using JXA-like syntax.
Classes:
|
A class for managing and interacting with Font Book.app. |
|
A class for managing and interacting with documents in Font Book.app. |
|
A wrapper around lists of Font Book documents that employs fast enumeration techniques. |
A class for managing and interacting with the all fonts library object in Font Book.app. |
|
|
A class for managing and interacting with font collections in Font Book.app. |
|
A wrapper around lists of Font Book font containers that employs fast enumeration techniques. |
|
A class for managing and interacting with font containers in Font Book.app. |
|
A wrapper around lists of Font Book font containers that employs fast enumeration techniques. |
|
A class for managing and interacting with font domains in Font Book.app. |
|
A wrapper around lists of Font Book font domains that employs fast enumeration techniques. |
|
A class for managing and interacting with font families in Font Book.app. |
|
A wrapper around lists of Font Book font families that employs fast enumeration techniques. |
|
A class for managing and interacting with font libraries in Font Book.app. |
|
A wrapper around lists of Font Book font libraries that employs fast enumeration techniques. |
|
A class for managing and interacting with typefaces in Font Book.app. |
|
A wrapper around lists of Font Book documents that employs fast enumeration techniques. |
|
A class for managing and interacting with documents in Font Book.app. |
- class PyXA.apps.FontBook.XAFontBookApplication(properties)[source]
Bases:
XASBApplication
A class for managing and interacting with Font Book.app.
New in version 0.0.6.
Methods:
documents
([filter])Returns a list of documents matching the filter.
font_collections
([filter])Returns a list of font collections matching the filter.
font_containers
([filter])Returns a list of font containers matching the filter.
font_domains
([filter])Returns a list of font domains matching the filter.
font_families
([filter])Returns a list of font families matching the filter.
font_libraries
([filter])Returns a list of font libraries matching the filter.
typefaces
([filter])Returns a list of typefaces matching the filter.
Attributes:
The All Fonts library.
The library where new fonts are installed.
The name of the application.
The currently selected collections.
The currently selected font families.
The currently selected typefaces.
Whether to validate fonts before installing them.
The version of the Font Book application.
- documents(filter: dict | None = None) XAFontBookDocumentList [source]
Returns a list of documents matching the filter.
New in version 0.0.6.
- font_collections(filter: dict | None = None) XAFontBookFontCollectionList [source]
Returns a list of font collections matching the filter.
New in version 0.0.6.
- font_containers(filter: dict | None = None) XAFontBookFontContainerList [source]
Returns a list of font containers matching the filter.
New in version 0.0.6.
- font_domains(filter: dict | None = None) XAFontBookFontDomainList [source]
Returns a list of font domains matching the filter.
New in version 0.0.6.
- font_families(filter: dict | None = None) XAFontBookFontFamilyList [source]
Returns a list of font families matching the filter.
New in version 0.0.6.
- font_libraries(filter: dict | None = None) XAFontBookFontLibraryList [source]
Returns a list of font libraries matching the filter.
New in version 0.0.6.
- property fonts_library: XAFontBookFontBookAllFontsLibraryObject
The All Fonts library.
- property installation_target: XAFontBookFontLibrary
The library where new fonts are installed.
- property name: str
The name of the application.
- property selected_collections: XAFontBookFontCollectionList
The currently selected collections.
- property selected_font_families: XAFontBookFontFamilyList
The currently selected font families.
- property selection: XAFontBookTypefaceList
The currently selected typefaces.
- typefaces(filter: dict | None = None) XAFontBookTypefaceList [source]
Returns a list of typefaces matching the filter.
New in version 0.0.6.
- property validate_fonts_before_installing: bool
Whether to validate fonts before installing them.
- property version: str
The version of the Font Book application.
- class PyXA.apps.FontBook.XAFontBookDocument(properties)[source]
Bases:
XAObject
A class for managing and interacting with documents in Font Book.app.
See also
New in version 0.0.6.
Attributes:
Whether the document has been modified since its last save.
The name of the document.
The file path of the document.
- property modified: bool
Whether the document has been modified since its last save.
- property name: str
The name of the document.
- class PyXA.apps.FontBook.XAFontBookDocumentList(properties: dict, filter: dict | None = None)[source]
Bases:
XAList
A wrapper around lists of Font Book documents that employs fast enumeration techniques.
All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property.
New in version 0.0.6.
Methods:
by_modified
(modified)by_name
(name)by_path
(path)modified
()name
()path
()- by_modified(modified: bool) XAFontBookDocument [source]
- by_name(name: str) XAFontBookDocument [source]
- by_path(path: str) XAFontBookDocument [source]
- class PyXA.apps.FontBook.XAFontBookFontBookAllFontsLibraryObject(properties)[source]
Bases:
XAFontBookFontDomain
A class for managing and interacting with the all fonts library object in Font Book.app.
See also
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookFontCollection(properties)[source]
Bases:
XAObject
,XAClipboardCodable
A class for managing and interacting with font collections in Font Book.app.
See also
New in version 0.0.6.
Attributes:
The display name of the collection.
The display name of the collection.
Whether the collection is enabled.
The name of the collection.
All properties of the collection.
Methods:
font_families
([filter])Returns a list of font families matching the filter.
Gets a clipboard-codable representation of the collection.
typefaces
([filter])Returns a list of typefaces matching the filter.
- property display_name: str
The display name of the collection.
- property displayed_name: str
The display name of the collection.
- property enabled: bool
Whether the collection is enabled.
- font_families(filter: dict | None = None) XAFontBookFontFamilyList [source]
Returns a list of font families matching the filter.
New in version 0.0.6.
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of the collection.
When the clipboard content is set to a collection, the name of the collection is added to the clipboard.
- Returns:
The name of the collection
- Return type:
str
New in version 0.0.8.
- property name: str
The name of the collection.
- property properties: dict
All properties of the collection.
- typefaces(filter: dict | None = None) XAFontBookTypefaceList [source]
Returns a list of typefaces matching the filter.
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookFontCollectionList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XAList
,XAClipboardCodable
A wrapper around lists of Font Book font containers that employs fast enumeration techniques.
All properties of font containers can be called as methods on the wrapped list, returning a list containing each container’s value for the property.
New in version 0.0.6.
Methods:
by_display_name
(display_name)by_displayed_name
(displayed_name)by_enabled
(enabled)by_name
(name)by_properties
(properties)enabled
()Gets a clipboard-codable representation of each collection in the list.
name
()- by_display_name(display_name: str) XAFontBookFontCollection [source]
- by_displayed_name(displayed_name: str) XAFontBookFontCollection [source]
- by_enabled(enabled: bool) XAFontBookFontCollection [source]
- by_name(name: str) XAFontBookFontCollection [source]
- by_properties(properties: dict) XAFontBookFontCollection [source]
- get_clipboard_representation() list[str] [source]
Gets a clipboard-codable representation of each collection in the list.
When the clipboard content is set to a list of collections, the name of each collection is added to the clipboard.
- Returns:
The list of collection names
- Return type:
list[str]
New in version 0.0.8.
- class PyXA.apps.FontBook.XAFontBookFontContainer(properties)[source]
Bases:
XAObject
,XAClipboardCodable
A class for managing and interacting with font containers in Font Book.app.
See also
New in version 0.0.6.
Attributes:
The font domain for the container.
The files for the container.
The unique identifier of the container.
The name of the container.
The path to the main container.
All properties of the container.
Methods:
font_domains
([filter])Returns a list of font domains matching the filter.
font_families
([filter])Returns a list of font families matching the filter.
Gets a clipboard-codable representation of the container.
typefaces
([filter])Returns a list of typefaces matching the filter.
- property domain: XAFontBookFontDomain
The font domain for the container.
- font_domains(filter: dict | None = None) XAFontBookFontDomainList [source]
Returns a list of font domains matching the filter.
New in version 0.0.6.
- font_families(filter: dict | None = None) XAFontBookFontFamilyList [source]
Returns a list of font families matching the filter.
New in version 0.0.6.
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of the container.
When the clipboard content is set to a container, the name of the container is added to the clipboard.
- Returns:
The name of the container
- Return type:
str
New in version 0.0.8.
- property id: str
The unique identifier of the container.
- property name: str
The name of the container.
- property path: str
The path to the main container.
- property properties: dict
All properties of the container.
- typefaces(filter: dict | None = None) XAFontBookTypefaceList [source]
Returns a list of typefaces matching the filter.
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookFontContainerList(properties: dict, filter: dict | None = None)[source]
Bases:
XAList
,XAClipboardCodable
A wrapper around lists of Font Book font containers that employs fast enumeration techniques.
All properties of font containers can be called as methods on the wrapped list, returning a list containing each container’s value for the property.
New in version 0.0.6.
Methods:
by_domain
(domain)by_files
(files)by_id
(id)by_name
(name)by_path
(path)by_properties
(properties)domain
()files
()Gets a clipboard-codable representation of each container in the list.
id
()name
()path
()- by_domain(domain: XAFontBookFontDomain) XAFontBookFontContainer [source]
- by_files(files: list[XAPath]) XAFontBookFontContainer [source]
- by_id(id: str) XAFontBookFontContainer [source]
- by_name(name: str) XAFontBookFontContainer [source]
- by_path(path: str) XAFontBookFontContainer [source]
- by_properties(properties: dict) XAFontBookFontContainer [source]
- domain() XAFontBookFontDomainList [source]
- get_clipboard_representation() list[str] [source]
Gets a clipboard-codable representation of each container in the list.
When the clipboard content is set to a list of containers, the name of each container is added to the clipboard.
- Returns:
The list of container names
- Return type:
list[str]
New in version 0.0.8.
- class PyXA.apps.FontBook.XAFontBookFontDomain(properties)[source]
Bases:
XAFontBookFontLibrary
A class for managing and interacting with font domains in Font Book.app.
See also
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookFontDomainList(properties: dict, filter: dict | None = None)[source]
Bases:
XAFontBookFontLibraryList
A wrapper around lists of Font Book font domains that employs fast enumeration techniques.
All properties of font domains can be called as methods on the wrapped list, returning a list containing each domain’s value for the property.
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookFontFamily(properties)[source]
Bases:
XAObject
,XAClipboardCodable
A class for managing and interacting with font families in Font Book.app.
See also
New in version 0.0.6.
Methods:
delete
()Permanently deletes the typeface.
Gets a clipboard-codable representation of the font family.
typefaces
([filter])Returns a list of typefaces matching the filter.
Attributes:
The display name of the font family.
The display name of the font family.
Whether teh font family contains duplicated faces.
Whether the font family is enabled.
The font files of the font family.
The name of the font family.
All properties of the font family.
- property display_name: str
The display name of the font family.
- property displayed_name: str
The display name of the font family.
- property duplicated: bool
Whether teh font family contains duplicated faces.
- property enabled: bool
Whether the font family is enabled.
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of the font family.
When the clipboard content is set to a font family, the name of the font family is added to the clipboard.
- Returns:
The name of the font family
- Return type:
str
New in version 0.0.8.
- property name: str
The name of the font family.
- property properties: dict
All properties of the font family.
- typefaces(filter: dict | None = None) XAFontBookTypefaceList [source]
Returns a list of typefaces matching the filter.
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookFontFamilyList(properties: dict, filter: dict | None = None)[source]
Bases:
XAList
,XAClipboardCodable
A wrapper around lists of Font Book font families that employs fast enumeration techniques.
All properties of font families can be called as methods on the wrapped list, returning a list containing each font family’s value for the property.
New in version 0.0.6.
Methods:
by_display_name
(display_name)by_displayed_name
(displayed_name)by_duplicates
(duplicated)by_enabled
(enabled)by_files
(files)by_name
(name)by_properties
(properties)enabled
()files
()Gets a clipboard-codable representation of each font family in the list.
name
()- by_display_name(display_name: str) XAFontBookFontFamily [source]
- by_displayed_name(displayed_name: str) XAFontBookFontFamily [source]
- by_duplicates(duplicated: bool) XAFontBookFontFamily [source]
- by_enabled(enabled: bool) XAFontBookFontFamily [source]
- by_files(files: list[XAPath]) XAFontBookFontFamily [source]
- by_name(name: str) XAFontBookFontFamily [source]
- by_properties(properties: dict) XAFontBookFontFamily [source]
- get_clipboard_representation() list[str] [source]
Gets a clipboard-codable representation of each font family in the list.
When the clipboard content is set to a list of font families, the name of each font family is added to the clipboard.
- Returns:
The list of font family names
- Return type:
list[str]
New in version 0.0.8.
- class PyXA.apps.FontBook.XAFontBookFontLibrary(properties)[source]
Bases:
XAFontBookFontCollection
A class for managing and interacting with font libraries in Font Book.app.
See also
New in version 0.0.6.
Methods:
font_containers
([filter])Returns a list of font containers matching the filter.
Attributes:
The unique identifier of the domain.
- font_containers(filter: dict | None = None) XAFontBookFontContainerList [source]
Returns a list of font containers matching the filter.
New in version 0.0.6.
- property id: str
The unique identifier of the domain.
- class PyXA.apps.FontBook.XAFontBookFontLibraryList(properties: dict, filter: dict | None = None)[source]
Bases:
XAFontBookFontCollectionList
A wrapper around lists of Font Book font libraries that employs fast enumeration techniques.
All properties of font libraries can be called as methods on the wrapped list, returning a list containing each library’s value for the property.
New in version 0.0.6.
- class PyXA.apps.FontBook.XAFontBookTypeface(properties)[source]
Bases:
XAObject
,XAClipboardCodable
A class for managing and interacting with typefaces in Font Book.app.
See also
New in version 0.0.6.
Attributes:
The copyright string for the typeface.
The display name of the typeface.
The display name of the typeface.
Whether the typeface is duplicated.
Whether the typeface is enabled.
The name of the typeface's font family.
The font files for the typeface.
The container of the typeface.
The font family that contains the typeface.
The type of the typeface.
The unique identifier for the typeface.
The name of the typeface.
The PostScript font name.
All properties of the typeface.
The name of the typeface's style.
Methods:
Gets a clipboard-codable representation of the typeface.
- property copyright: str
The copyright string for the typeface.
- property display_name: str
The display name of the typeface.
- property displayed_name: str
The display name of the typeface.
- property duplicated: bool
Whether the typeface is duplicated.
- property enabled: bool
Whether the typeface is enabled.
- property family_name: str
The name of the typeface’s font family.
- property font_container: XAFontBookFontContainer
The container of the typeface.
- property font_family: XAFontBookFontFamily
The font family that contains the typeface.
- property font_type: str
The type of the typeface.
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of the typeface.
When the clipboard content is set to a typeface, the name of the typeface is added to the clipboard.
- Returns:
The name of the typeface
- Return type:
str
New in version 0.0.8.
- property id: str
The unique identifier for the typeface.
- property name: str
The name of the typeface.
- property post_script_name: str
The PostScript font name.
- property properties: dict
All properties of the typeface.
- property style_name: str
The name of the typeface’s style.
- class PyXA.apps.FontBook.XAFontBookTypefaceList(properties: dict, filter: dict | None = None)[source]
Bases:
XAList
,XAClipboardCodable
A wrapper around lists of Font Book documents that employs fast enumeration techniques.
All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property.
New in version 0.0.6.
Methods:
by_copyright
(copyright)by_display_name
(display_name)by_displayed_name
(displayed_name)by_duplicated
(duplicated)by_enabled
(enabled)by_family_name
(family_name)by_files
(files)by_font_container
(font_container)by_font_family
(font_family)by_font_type
(font_type)by_id
(id)by_name
(name)by_post_script_name
(post_script_name)by_properties
(properties)by_style_name
(style_name)enabled
()files
()Gets a clipboard-codable representation of each typeface in the list.
id
()name
()- by_copyright(copyright: str) XAFontBookTypeface [source]
- by_display_name(display_name: str) XAFontBookTypeface [source]
- by_displayed_name(displayed_name: str) XAFontBookTypeface [source]
- by_duplicated(duplicated: bool) XAFontBookTypeface [source]
- by_enabled(enabled: bool) XAFontBookTypeface [source]
- by_family_name(family_name: str) XAFontBookTypeface [source]
- by_files(files: list[XAPath]) XAFontBookTypeface [source]
- by_font_container(font_container: XAFontBookFontContainer) XAFontBookTypeface [source]
- by_font_family(font_family: XAFontBookFontFamily) XAFontBookTypeface [source]
- by_font_type(font_type: str) XAFontBookTypeface [source]
- by_id(id: str) XAFontBookTypeface [source]
- by_name(name: str) XAFontBookTypeface [source]
- by_post_script_name(post_script_name: str) XAFontBookTypeface [source]
- by_properties(properties: dict) XAFontBookTypeface [source]
- by_style_name(style_name: str) XAFontBookTypeface [source]
- font_container() XAFontBookFontContainerList [source]
- font_family() XAFontBookFontFamilyList [source]
- get_clipboard_representation() list[str] [source]
Gets a clipboard-codable representation of each typeface in the list.
When the clipboard content is set to a list of typefaces, the name of each typeface is added to the clipboard.
- Returns:
The list of typeface names
- Return type:
list[str]
New in version 0.0.8.
- class PyXA.apps.FontBook.XAFontBookWindow(properties)[source]
Bases:
XASBWindow
A class for managing and interacting with documents in Font Book.app.
See also
New in version 0.0.6.
Attributes:
Whether the window floats.
Whether the window is a modal window.
Whether the window has a title bar.
- property floating: bool
Whether the window floats.
- property modal: bool
Whether the window is a modal window.
- property titled: bool
Whether the window has a title bar.