| 1 |
|
| 2 |
|
| 3 |
import sys, fontforge |
| 4 |
|
| 5 |
|
| 6 |
font=fontforge.open(sys.argv[1]) |
| 7 |
pen = font["A"].glyphPen() |
| 8 |
font.close() |
| 9 |
|
| 10 |
|
| 11 |
exception_occured = False |
| 12 |
try: |
| 13 |
pen.moveTo((100,100)) |
| 14 |
pen.lineTo((100,200)) |
| 15 |
pen = None |
| 16 |
|
| 17 |
assert(False) |
| 18 |
except RuntimeError: |
| 19 |
exception_occured = True |
| 20 |
|
| 21 |
assert(exception_occured) |
| 22 |
|
| 23 |
|
| 24 |
font2=fontforge.open(sys.argv[1]) |
| 25 |
layers = font2["B"].layers |
| 26 |
font2.close() |
| 27 |
|
| 28 |
|
| 29 |
exception_occured = False |
| 30 |
try: |
| 31 |
new_l = layers[0].dup() |
| 32 |
|
| 33 |
assert(False) |
| 34 |
except RuntimeError: |
| 35 |
exception_occured = True |
| 36 |
|
| 37 |
assert(exception_occured) |
| 38 |
|
| 39 |
|
| 40 |
font3 = fontforge.open(sys.argv[1]) |
| 41 |
l_refs = font3["C"].layerrefs |
| 42 |
font3.close() |
| 43 |
|
| 44 |
|
| 45 |
exception_occured = False |
| 46 |
try: |
| 47 |
refs = l_refs["Fore"] |
| 48 |
|
| 49 |
assert(False) |
| 50 |
except RuntimeError: |
| 51 |
exception_occured = True |
| 52 |
|
| 53 |
assert(exception_occured) |
| 54 |
|
| 55 |
|
| 56 |
font4 = fontforge.open(sys.argv[1]) |
| 57 |
mk_data = font4["D"].mathKern |
| 58 |
font4.close() |
| 59 |
|
| 60 |
|
| 61 |
exception_occured = False |
| 62 |
try: |
| 63 |
bl = mk_data.bottomLeft |
| 64 |
|
| 65 |
assert(False) |
| 66 |
except RuntimeError: |
| 67 |
exception_occured = True |
| 68 |
|
| 69 |
assert(exception_occured) |
| 70 |
|
| 71 |
|
| 72 |
font5 = fontforge.open(sys.argv[1]) |
| 73 |
glyph_E = font5["E"] |
| 74 |
glyph_F = font5["F"] |
| 75 |
font5.close() |
| 76 |
|
| 77 |
|
| 78 |
exception_occured = False |
| 79 |
try: |
| 80 |
tti = glyph_E.ttinstrs |
| 81 |
|
| 82 |
assert(False) |
| 83 |
except RuntimeError: |
| 84 |
exception_occured = True |
| 85 |
|
| 86 |
assert(exception_occured) |
| 87 |
|
| 88 |
|
| 89 |
exception_occured = False |
| 90 |
try: |
| 91 |
glyph_F.correctDirection() |
| 92 |
|
| 93 |
assert(False) |
| 94 |
except RuntimeError: |
| 95 |
exception_occured = True |
| 96 |
|
| 97 |
assert(exception_occured) |
| 98 |
|
| 99 |
|
| 100 |
font6 = fontforge.open(sys.argv[1]) |
| 101 |
layers = font6.layers |
| 102 |
font6.close() |
| 103 |
|
| 104 |
|
| 105 |
exception_occured = False |
| 106 |
try: |
| 107 |
layers.add("new-layer", False) |
| 108 |
|
| 109 |
assert(False) |
| 110 |
except RuntimeError: |
| 111 |
exception_occured = True |
| 112 |
|
| 113 |
assert(exception_occured) |
| 114 |
|
| 115 |
|
| 116 |
font7 = fontforge.open(sys.argv[1]) |
| 117 |
fore_info = font7.layers["Fore"] |
| 118 |
font7.close() |
| 119 |
|
| 120 |
|
| 121 |
exception_occured = False |
| 122 |
try: |
| 123 |
is_q = fore_info.is_quadratic |
| 124 |
|
| 125 |
assert(False) |
| 126 |
except RuntimeError: |
| 127 |
exception_occured = True |
| 128 |
|
| 129 |
assert(exception_occured) |
| 130 |
|
| 131 |
|
| 132 |
font8 = fontforge.open(sys.argv[1]) |
| 133 |
private = font8.private |
| 134 |
font8.close() |
| 135 |
|
| 136 |
|
| 137 |
exception_occured = False |
| 138 |
try: |
| 139 |
private["BlueValues"] = None |
| 140 |
|
| 141 |
assert(False) |
| 142 |
except RuntimeError: |
| 143 |
exception_occured = True |
| 144 |
|
| 145 |
assert(exception_occured) |
| 146 |
|
| 147 |
|
| 148 |
font9 = fontforge.open(sys.argv[1]) |
| 149 |
sel_ref = font9.selection |
| 150 |
font9.close() |
| 151 |
|
| 152 |
|
| 153 |
exception_occured = False |
| 154 |
try: |
| 155 |
sel_ref.select("A", "C", "Z") |
| 156 |
|
| 157 |
assert(False) |
| 158 |
except RuntimeError: |
| 159 |
exception_occured = True |
| 160 |
|
| 161 |
assert(exception_occured) |
| 162 |
|
| 163 |
|
| 164 |
font10 = fontforge.open(sys.argv[1]) |
| 165 |
cvt = font10.cvt |
| 166 |
font10.close() |
| 167 |
|
| 168 |
|
| 169 |
exception_occured = False |
| 170 |
try: |
| 171 |
cvt += [10, 12] |
| 172 |
|
| 173 |
assert(False) |
| 174 |
except RuntimeError: |
| 175 |
exception_occured = True |
| 176 |
|
| 177 |
assert(exception_occured) |
| 178 |
|
| 179 |
|
| 180 |
font11 = fontforge.open(sys.argv[1]) |
| 181 |
math = font11.math |
| 182 |
font11.close() |
| 183 |
|
| 184 |
|
| 185 |
exception_occured = False |
| 186 |
try: |
| 187 |
has = math.exists() |
| 188 |
|
| 189 |
assert(False) |
| 190 |
except RuntimeError: |
| 191 |
exception_occured = True |
| 192 |
|
| 193 |
assert(exception_occured) |
| 194 |
|
| 195 |
|
| 196 |
font12 = fontforge.open(sys.argv[1]) |
| 197 |
devtable = font12.math.AxisHeightDeviceTable |
| 198 |
font12.close() |
| 199 |
|
| 200 |
|
| 201 |
exception_occured = False |
| 202 |
try: |
| 203 |
devtable[10] = 2 |
| 204 |
|
| 205 |
assert(False) |
| 206 |
except RuntimeError: |
| 207 |
exception_occured = True |
| 208 |
|
| 209 |
assert(exception_occured) |