text_fonts
TextFonts
Bases: Photoshop
An installed font.
Source code in photoshop/api/_text_fonts.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
length
property
The number pf elements in the collection.
__contains__(name)
Check if a font is installed. Lookup by font postScriptName (fastest) or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | Name or postScriptName of the font to look for. | required |
Returns:
Name | Type | Description |
---|---|---|
bool | True if font is found, otherwise False. |
Source code in photoshop/api/_text_fonts.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
__getitem__(key)
Access a given TextFont using dictionary key lookup, must provide the postScriptName.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key | str | The postScriptName of the font. | required |
Returns:
Type | Description |
---|---|
TextFont instance. |
Source code in photoshop/api/_text_fonts.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
get(key, default=None)
Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key | str | The postScriptName of the font. | required |
default | Any | Value to return if font isn't found. | None |
Returns:
Type | Description |
---|---|
Union[TextFont, Any] | TextFont instance. |
Source code in photoshop/api/_text_fonts.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
getByName(name)
Gets the font by the font name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the font. | required |
Returns:
Type | Description |
---|---|
TextFont | font instance. |
Source code in photoshop/api/_text_fonts.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
Last update: 2024-11-17
Created: 2024-11-17
Created: 2024-11-17