Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 4d706d6

Browse files
author
Mitch Talmadge
committed
Removed created/modified requirement from ttxTools - Fixes Errors 109, 115, 116, 117, 119, 135, 136, 143, 145, 154, 155, 156, 157, 159, 160, and 161.
1 parent e30216b commit 4d706d6

File tree

4 files changed

+3
-23
lines changed

4 files changed

+3
-23
lines changed

src/main/java/me/MitchT/EmojiTools/EmojiTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public class EmojiTools {
1616

17-
public static final String VERSION_STRING = "V1.6";
17+
public static final String VERSION_STRING = "V1.6.5";
1818
public static final int PROJECT_ID = 1; //Used in AptiAPI
1919

2020
private static final Image logoImage = new ImageIcon(EmojiTools.class.getResource("/Images/EmojiToolsLogo.png")).getImage();

src/main/resources/FontTemplates/NotoColorEmoji.tmpl.ttx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
<magicNumber value="0x5f0f3cf5"/>
1515
<flags value="00000000 00001011"/>
1616
<unitsPerEm value="2048"/>
17-
<created value="Wed May 22 20:00:43 2013"/>
18-
<modified value="Thu Jan 09 07:11:49 2014"/>
1917
<xMin value="0"/>
2018
<yMin value="-500"/>
2119
<xMax value="2550"/>

src/main/resources/PythonScripts/fontTools/merge.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ def merge(self, m, tables):
199199
'magicNumber': equal,
200200
'flags': mergeBits(headFlagsMergeBitMap),
201201
'unitsPerEm': equal,
202-
'created': current_time,
203-
'modified': current_time,
204202
'xMin': min,
205203
'yMin': min,
206204
'xMax': max,

src/main/resources/PythonScripts/fontTools/ttLib/tables/_h_e_a_d.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from fontTools.misc import sstruct
44
from fontTools.misc.textTools import safeEval, num2binary, binary2num
55
from . import DefaultTable
6-
import time
7-
import calendar
86

97
headFormat = """
108
> # big endian
@@ -14,8 +12,6 @@
1412
magicNumber: I
1513
flags: H
1614
unitsPerEm: H
17-
created: Q
18-
modified: Q
1915
xMin: h
2016
yMin: h
2117
xMax: h
@@ -38,8 +34,6 @@ def decompile(self, data, ttFont):
3834
assert rest == "\0\0"
3935

4036
def compile(self, ttFont):
41-
if ttFont.recalcTimestamp:
42-
self.modified = int(time.time() - mac_epoch_diff)
4337
data = sstruct.pack(headFormat, self)
4438
return data
4539

@@ -49,11 +43,6 @@ def toXML(self, writer, ttFont):
4943
formatstring, names, fixes = sstruct.getformat(headFormat)
5044
for name in names:
5145
value = getattr(self, name)
52-
if name in ("created", "modified"):
53-
try:
54-
value = time.asctime(time.gmtime(max(0, value + mac_epoch_diff)))
55-
except ValueError:
56-
value = time.asctime(time.gmtime(0))
5746
if name in ("magicNumber", "checkSumAdjustment"):
5847
if value < 0:
5948
value = value + 0x100000000
@@ -67,13 +56,8 @@ def toXML(self, writer, ttFont):
6756

6857
def fromXML(self, name, attrs, content, ttFont):
6958
value = attrs["value"]
70-
if name in ("created", "modified"):
71-
value = calendar.timegm(time.strptime(value)) - mac_epoch_diff
72-
elif name in ("macStyle", "flags"):
59+
if name in ("macStyle", "flags"):
7360
value = binary2num(value)
7461
else:
7562
value = safeEval(value)
76-
setattr(self, name, value)
77-
78-
# Difference between the original Mac epoch (1904) to the epoch on this machine.
79-
mac_epoch_diff = calendar.timegm((1904, 1, 1, 0, 0, 0, 0, 0, 0))
63+
setattr(self, name, value)

0 commit comments

Comments
 (0)