@@ -246,6 +246,7 @@ def extractOpenTypeInfo(source, destination):
246
246
_extractInfoPost (source , info )
247
247
_extractInfoCFF (source , info )
248
248
_extractInfoGasp (source , info )
249
+ _extractLibInfo (source , destination .lib )
249
250
250
251
251
252
def _extractInfoHead (source , info ):
@@ -258,10 +259,7 @@ def _extractInfoHead(source, info):
258
259
# upm
259
260
info .unitsPerEm = head .unitsPerEm
260
261
# created
261
- format = "%Y/%m/%d %H:%M:%S"
262
- created = head .created
263
- created = time .gmtime (max (0 , created + mac_epoch_diff ))
264
- info .openTypeHeadCreated = time .strftime (format , created )
262
+ info .openTypeHeadCreated = formatDate (head .created )
265
263
# lowestRecPPEM
266
264
info .openTypeHeadLowestRecPPEM = head .lowestRecPPEM
267
265
# flags
@@ -517,6 +515,13 @@ def _extractInfoGasp(source, info):
517
515
info .openTypeGaspRangeRecords = records
518
516
519
517
518
+ def _extractLibInfo (source , lib ):
519
+ head = source ["head" ]
520
+ lib ["public.openTypeHeadModified" ] = formatDate (head .modified )
521
+ post = source ["post" ]
522
+ lib ["public.openTypePostUnderlinePosition" ] = post .underlinePosition
523
+
524
+
520
525
# Tools
521
526
522
527
@@ -531,6 +536,12 @@ def binaryToIntList(value, start=0):
531
536
return intList
532
537
533
538
539
+ def formatDate (date ):
540
+ format = "%Y/%m/%d %H:%M:%S"
541
+ date = time .gmtime (max (0 , date + mac_epoch_diff ))
542
+ return time .strftime (format , date )
543
+
544
+
534
545
# --------
535
546
# Outlines
536
547
# --------
0 commit comments