Esempio n. 1
0
	def toXML(self, writer, ttFont):
		writer.comment("FontForge's timestamp, font source creation and modification dates")
		writer.newline()
		formatstring, names, fixes = sstruct.getformat(FFTMFormat)
		for name in names:
			value = getattr(self, name)
			if name in ("FFTimeStamp", "sourceCreated", "sourceModified"):
				value = timestampToString(value)
			writer.simpletag(name, value=value)
			writer.newline()
Esempio n. 2
0
def test_date_parsing_with_locale():
    l = locale.getlocale(locale.LC_TIME)
    try:
        locale.setlocale(locale.LC_TIME, 'de_DE.utf8')
    except locale.Error:
        pytest.skip("Locale de_DE not available")

    try:
        assert timestampFromString(timestampToString(timestampNow()))
    finally:
        locale.setlocale(locale.LC_TIME, l)
Esempio n. 3
0
 def toXML(self, writer, ttFont):
     writer.comment(
         "FontForge's timestamp, font source creation and modification dates"
     )
     writer.newline()
     formatstring, names, fixes = sstruct.getformat(FFTMFormat)
     for name in names:
         value = getattr(self, name)
         if name in ("FFTimeStamp", "sourceCreated", "sourceModified"):
             value = timestampToString(value)
         writer.simpletag(name, value=value)
         writer.newline()
Esempio n. 4
0
	def toXML(self, writer, ttFont):
		writer.comment("Most of this table will be recalculated by the compiler")
		writer.newline()
		formatstring, names, fixes = sstruct.getformat(headFormat)
		for name in names:
			value = getattr(self, name)
			if name in ("created", "modified"):
				value = timestampToString(value)
			if name in ("magicNumber", "checkSumAdjustment"):
				if value < 0:
					value = value + 0x100000000
				value = hex(value)
				if value[-1:] == "L":
					value = value[:-1]
			elif name in ("macStyle", "flags"):
				value = num2binary(value, 16)
			writer.simpletag(name, value=value)
			writer.newline()
Esempio n. 5
0
 def toXML(self, writer, ttFont):
     writer.comment(
         "Most of this table will be recalculated by the compiler")
     writer.newline()
     formatstring, names, fixes = sstruct.getformat(headFormat)
     for name in names:
         value = getattr(self, name)
         if name in ("created", "modified"):
             value = timestampToString(value)
         if name in ("magicNumber", "checkSumAdjustment"):
             if value < 0:
                 value = value + 0x100000000
             value = hex(value)
             if value[-1:] == "L":
                 value = value[:-1]
         elif name in ("macStyle", "flags"):
             value = num2binary(value, 16)
         writer.simpletag(name, value=value)
         writer.newline()