Fonts
FONT UTILITIES
check_app_fonts(folders)
Checks each font in a folder to see if it is installed or outdated. @param folders: Folder paths containing fonts to check. @return: A tuple containing a dict of missing fonts and a dict of outdated fonts.
Source code in src/utils/fonts.py
244 245 246 247 248 249 250 251 252 253 254 255 |
|
get_document_fonts(container=None, fonts=None, ps_fonts=None)
Get a list of all fonts used in a given Photoshop Document or LayerSet. @param container: Photoshop Document or LayerSet object. @param fonts: Existing fonts list to build onto. @param ps_fonts: Pre-computed Photoshop fonts list. @return: Unique list of font names.
Source code in src/utils/fonts.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
get_font_details(path)
Gets the font name and postscript name for a given font file. @param path: Path to ttf or otf file. @return: Tuple containing name and postscript name.
Source code in src/utils/fonts.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
get_fonts_from_folder(folder)
Return a dictionary of font details for the fonts contained in a target directory. @param folder: Directory containing font files to read (supports TTF and OTF fonts). @return: Dictionary of FontDetails.
Source code in src/utils/fonts.py
158 159 160 161 162 163 164 165 166 167 168 169 |
|
get_installed_fonts_dict()
Gets a dictionary of every font installed by the user. @return: Dictionary with postScriptName as key, and tuple of display name and version as value.
Source code in src/utils/fonts.py
172 173 174 175 176 177 178 179 180 181 182 183 184 |
|
get_missing_fonts(fonts)
Checks each font to see if it's present in the Photoshop font list. @param fonts: A dictionary of fonts to check for. @return: Tuple containing a dictionary of fonts missing and fonts found.
Source code in src/utils/fonts.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
|
get_outdated_fonts(fonts, missing=None)
Compares the version of each font given against installed fonts. @param fonts: A dictionary of fonts to check against installed fonts. @param missing: An optional dictionary of fonts Photoshop couldn't locate, check in install dir. @return: A dict of fonts with outdated version number. Dict contains the newer version.
Source code in src/utils/fonts.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|
get_ps_font_dict()
Gets a dictionary of every font accessible in Photoshop. @return: Dictionary with postScriptName as key, display name as value.
Source code in src/utils/fonts.py
86 87 88 89 90 91 92 93 94 95 |
|
register_font(font_path)
Add FontResource using given font file, refresh Photoshop fonts. @param font_path: Path to compatible font file. @return: True if succeeded, False if failed.
Source code in src/utils/fonts.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
unregister_font(font_path)
Remove FontResource using given font file, refresh Photoshop fonts. @param font_path: Path to compatible font file. @return: True if succeeded, False if failed.
Source code in src/utils/fonts.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|