-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path07_font.py
More file actions
69 lines (65 loc) · 1.51 KB
/
07_font.py
File metadata and controls
69 lines (65 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
from appscript import *
indd = app("Adobe InDesign CC 2019")
fonts = indd.fonts # all fonts
print("count of all fonts:", len(fonts()))
headers = ["allowEditableEmbedding",
"allowOutlines",
"allowPDFEmbedding",
#
"fontFamily",
"fontStyleName",
"fontStyleNameNative",
"fontType",
#
"name",
"fullName",
"fullNameNative",
"postscriptName"
]
with open("fonts.csv", "w", encoding="utf-8") as file:
file.write("\t".join(headers) + "\n")
#
for font in fonts():
try:
a = font.allow_editable_embedding()
except:
a = ""
#
try:
b = font.allow_outlines()
except:
b = ""
#
try:
c = font.allow_PDF_embedding()
except:
c = ""
#
d = font.font_family()
#
try:
e = font.font_style_name()
f = font.font_style_name_native()
except:
e = f = ""
#
try:
g = font.font_type()
except:
g = ""
#
h = font.name()
#
try:
i = font.full_name()
j = font.full_name_native()
except:
i = j = ""
#
try:
k = font.postscript_name()
except:
k = ""
#
#
file.write(f"{a}\t{b}\t{c}\t{d}\t{e}\t{f}\t{g}\t{h}\t{i}\t{j}\t{k}\n")