| 1 |
import os |
| 2 |
import sys |
| 3 |
import linecache |
| 4 |
|
| 5 |
PATH = sys.argv[1] |
| 6 |
|
| 7 |
section_2 = "\t<key>openTypeGaspRangeRecords</key>\n\t<array>\n\t<dict>\n\t<key>rangeGaspBehavior</key>\n\t<array>\n\t<integer>0</integer>\n\t<integer>1</integer>\n\t<integer>2</integer>\n\t<integer>3</integer>\n\t</array>\n\t<key>rangeMaxPPEM</key>\n\t<integer>65535</integer>\n\t</dict>\n\t</array>\n" |
| 8 |
|
| 9 |
os.chdir(PATH) |
| 10 |
|
| 11 |
section_1 = "" |
| 12 |
l = 0 |
| 13 |
while l < 35: |
| 14 |
section_1 = section_1 + linecache.getline('fontinfo.plist', l) |
| 15 |
l += 1 |
| 16 |
|
| 17 |
section_3 = "" |
| 18 |
l = 35 |
| 19 |
while True: |
| 20 |
section_3 = section_3 + linecache.getline('fontinfo.plist', l) |
| 21 |
l += 1 |
| 22 |
if (linecache.getline('fontinfo.plist', l) == ""): |
| 23 |
break |
| 24 |
|
| 25 |
data = section_1 + section_2 + section_3 |
| 26 |
fontinfo = open("fontinfo.plist" , "w") |
| 27 |
fontinfo.write(data) |
| 28 |
fontinfo.close() |
| 29 |
|
| 30 |
|
| 31 |
|