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

Commit

Permalink
Removed created/modified requirement from ttxTools - Fixes Errors 109…
Browse files Browse the repository at this point in the history
…, 115, 116, 117, 119, 135, 136, 143, 145, 154, 155, 156, 157, 159, 160, and 161.
  • Loading branch information
Mitch Talmadge committed Sep 18, 2015
1 parent e30216b commit 4d706d6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/MitchT/EmojiTools/EmojiTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public class EmojiTools {

public static final String VERSION_STRING = "V1.6";
public static final String VERSION_STRING = "V1.6.5";
public static final int PROJECT_ID = 1; //Used in AptiAPI

private static final Image logoImage = new ImageIcon(EmojiTools.class.getResource("/Images/EmojiToolsLogo.png")).getImage();
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/FontTemplates/NotoColorEmoji.tmpl.ttx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
<magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00001011"/>
<unitsPerEm value="2048"/>
<created value="Wed May 22 20:00:43 2013"/>
<modified value="Thu Jan 09 07:11:49 2014"/>
<xMin value="0"/>
<yMin value="-500"/>
<xMax value="2550"/>
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/PythonScripts/fontTools/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ def merge(self, m, tables):
'magicNumber': equal,
'flags': mergeBits(headFlagsMergeBitMap),
'unitsPerEm': equal,
'created': current_time,
'modified': current_time,
'xMin': min,
'yMin': min,
'xMax': max,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval, num2binary, binary2num
from . import DefaultTable
import time
import calendar

headFormat = """
> # big endian
Expand All @@ -14,8 +12,6 @@
magicNumber: I
flags: H
unitsPerEm: H
created: Q
modified: Q
xMin: h
yMin: h
xMax: h
Expand All @@ -38,8 +34,6 @@ def decompile(self, data, ttFont):
assert rest == "\0\0"

def compile(self, ttFont):
if ttFont.recalcTimestamp:
self.modified = int(time.time() - mac_epoch_diff)
data = sstruct.pack(headFormat, self)
return data

Expand All @@ -49,11 +43,6 @@ def toXML(self, writer, ttFont):
formatstring, names, fixes = sstruct.getformat(headFormat)
for name in names:
value = getattr(self, name)
if name in ("created", "modified"):
try:
value = time.asctime(time.gmtime(max(0, value + mac_epoch_diff)))
except ValueError:
value = time.asctime(time.gmtime(0))
if name in ("magicNumber", "checkSumAdjustment"):
if value < 0:
value = value + 0x100000000
Expand All @@ -67,13 +56,8 @@ def toXML(self, writer, ttFont):

def fromXML(self, name, attrs, content, ttFont):
value = attrs["value"]
if name in ("created", "modified"):
value = calendar.timegm(time.strptime(value)) - mac_epoch_diff
elif name in ("macStyle", "flags"):
if name in ("macStyle", "flags"):
value = binary2num(value)
else:
value = safeEval(value)
setattr(self, name, value)

# Difference between the original Mac epoch (1904) to the epoch on this machine.
mac_epoch_diff = calendar.timegm((1904, 1, 1, 0, 0, 0, 0, 0, 0))
setattr(self, name, value)

0 comments on commit 4d706d6

Please sign in to comment.